summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-04-05 14:33:04 +0000
committerblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-04-05 14:33:04 +0000
commit1b760ca1fcb6b9d48e4254637989b3dca356c7db (patch)
tree3fcabaeef3909da34aff6587c5f674788704b0fb
parent97f7040e2dc9d620f3440a308a5ae8951a40ca9b (diff)
[image] define external cpio
Allow building image with an external cpio Signed-off-by: Tathagata Das <tathagata@alumnux.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31204 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--Config.in7
-rw-r--r--include/kernel-defaults.mk16
2 files changed, 23 insertions, 0 deletions
diff --git a/Config.in b/Config.in
index 4e874a69de..4231f85aa5 100644
--- a/Config.in
+++ b/Config.in
@@ -49,6 +49,13 @@ menu "Target Images"
depends LINUX_2_6_38
endchoice
+ config EXTERNAL_CPIO
+ string
+ prompt "Use external cpio" if TARGET_ROOTFS_INITRAMFS
+ default ""
+ help
+ Kernel uses specified external cpio as INITRAMFS_SOURCE
+
comment "Root filesystem archives"
config TARGET_ROOTFS_CPIOGZ
diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk
index 52ce03776c..9a1dace3e6 100644
--- a/include/kernel-defaults.mk
+++ b/include/kernel-defaults.mk
@@ -55,6 +55,7 @@ else
endif
ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
+ ifeq ($(strip $(CONFIG_EXTERNAL_CPIO)),"")
define Kernel/SetInitramfs
mv $(LINUX_DIR)/.config $(LINUX_DIR)/.config.old
grep -v -e INITRAMFS -e CONFIG_RD_ -e CONFIG_BLK_DEV_INITRD $(LINUX_DIR)/.config.old > $(LINUX_DIR)/.config
@@ -73,6 +74,21 @@ ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
define Kernel/SetInitramfs
mv $(LINUX_DIR)/.config $(LINUX_DIR)/.config.old
grep -v INITRAMFS $(LINUX_DIR)/.config.old > $(LINUX_DIR)/.config
+ echo 'CONFIG_INITRAMFS_SOURCE="$(call qstrip,$(CONFIG_EXTERNAL_CPIO))"' >> $(LINUX_DIR)/.config
+ echo 'CONFIG_INITRAMFS_ROOT_UID=$(shell id -u)' >> $(LINUX_DIR)/.config
+ echo 'CONFIG_INITRAMFS_ROOT_GID=$(shell id -g)' >> $(LINUX_DIR)/.config
+ echo "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_NONE),CONFIG_INITRAMFS_COMPRESSION_NONE=y,# CONFIG_INITRAMFS_COMPRESSION_NONE is not set)" >> $(LINUX_DIR)/.config
+ echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP),CONFIG_INITRAMFS_COMPRESSION_GZIP=y\nCONFIG_RD_GZIP=y,# CONFIG_INITRAMFS_COMPRESSION_GZIP is not set\n# CONFIG_RD_GZIP is not set)" >> $(LINUX_DIR)/.config
+ echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_BZIP2),CONFIG_INITRAMFS_COMPRESSION_BZIP2=y\nCONFIG_RD_BZIP2=y,# CONFIG_INITRAMFS_COMPRESSION_BZIP2 is not set\n# CONFIG_RD_BZIP2 is not set)" >> $(LINUX_DIR)/.config
+ echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZMA),CONFIG_INITRAMFS_COMPRESSION_LZMA=y\nCONFIG_RD_LZMA=y,# CONFIG_INITRAMFS_COMPRESSION_LZMA is not set\n# CONFIG_RD_LZMA is not set)" >> $(LINUX_DIR)/.config
+ echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZO),CONFIG_INITRAMFS_COMPRESSION_LZO=y\nCONFIG_RD_LZO=y,# CONFIG_INITRAMFS_COMPRESSION_LZO is not set\n# CONFIG_RD_LZO is not set)" >> $(LINUX_DIR)/.config
+ echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_XZ),CONFIG_INITRAMFS_COMPRESSION_XZ=y\nCONFIG_RD_XZ=y,# CONFIG_INITRAMFS_COMPRESSION_XZ is not set\n# CONFIG_RD_XZ is not set)" >> $(LINUX_DIR)/.config
+ endef
+ endif
+else
+ define Kernel/SetInitramfs
+ mv $(LINUX_DIR)/.config $(LINUX_DIR)/.config.old
+ grep -v INITRAMFS $(LINUX_DIR)/.config.old > $(LINUX_DIR)/.config
echo 'CONFIG_INITRAMFS_SOURCE=""' >> $(LINUX_DIR)/.config
endef
endif