summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbdoulaye Walsimou Gaye <walsimou@walsimou.com>2009-08-10 23:22:11 +0200
committerAbdoulaye Walsimou Gaye <walsimou@walsimou.com>2009-08-10 23:22:11 +0200
commit41f9bb9b7c0d6414b67e935069076b85ad1d5e15 (patch)
tree84d569bc5487fc6a7885b4a8b073d7d78bd02d6b
parent990849c74997332b825a9ad565768e921b813bac (diff)
downloadembtoolkit-41f9bb9b7c0d6414b67e935069076b85ad1d5e15.tar.gz
embtoolkit-41f9bb9b7c0d6414b67e935069076b85ad1d5e15.tar.bz2
embtoolkit-41f9bb9b7c0d6414b67e935069076b85ad1d5e15.tar.xz
Rootfs: give ability to build cpio archive for initramfs
Signed-off-by: Abdoulaye Walsimou Gaye <walsimou@walsimou.com>
-rw-r--r--kconfig/fs.kconfig20
-rw-r--r--mk/fs.mk11
-rw-r--r--mk/rootfs.mk8
3 files changed, 37 insertions, 2 deletions
diff --git a/kconfig/fs.kconfig b/kconfig/fs.kconfig
index 9ce3741..9add022 100644
--- a/kconfig/fs.kconfig
+++ b/kconfig/fs.kconfig
@@ -31,7 +31,6 @@ config EMBTK_ROOTFS_HAVE_JFFS2
bool "Build a JFFS2 root filesystem image"
help
Build a JFFS2 root filesystem image for your target
-
config EMBTK_ROOTFS_HAVE_JFFS2_BLOCKSIZE
depends on EMBTK_ROOTFS_HAVE_JFFS2
help
@@ -39,4 +38,23 @@ config EMBTK_ROOTFS_HAVE_JFFS2_BLOCKSIZE
int "Erase block size to use in KB"
default 512
+#INITRAMFS cpio archive
+config EMBTK_ROOTFS_HAVE_INITRAMFS_CPIO
+ bool "Build cpio archive for initramfs"
+ help
+ Build a cpio archive, in order to use it later as source file for
+ initramfs in the linux kernel.
+choice
+ depends on EMBTK_ROOTFS_HAVE_INITRAMFS_CPIO
+ prompt "Compression program to use"
+ config EMBTK_ROOTFS_HAVE_INITRAMFS_CPIO_GZIPED
+ bool "gzip"
+ help
+ Use gzip compression algorithm.
+ config EMBTK_ROOTFS_HAVE_INITRAMFS_CPIO_BZIPED
+ bool "bzip2"
+ help
+ Use bzip2 compression algorithm.
+endchoice
+
endmenu
diff --git a/mk/fs.mk b/mk/fs.mk
index 5181cf4..72ba177 100644
--- a/mk/fs.mk
+++ b/mk/fs.mk
@@ -42,3 +42,14 @@ build_jffs2_rootfs:
-o $(EMBTK_ROOT)/rootfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG).jffs2
@rm -rf $(EMBTK_ROOT)/rootfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG).jffs2.temp
+build_initramfs_archive:
+ $(call EMBTK_GENERIC_MESSAGE,"Generating cpio archive for initramfs...")
+ifeq ($(EMBTK_ROOTFS_HAVE_INITRAMFS_CPIO_GZIPED),y)
+ @$(FAKEROOT_BIN) -i $(EMBTK_ROOT)/.fakeroot.001 -- \
+ $(EMBTK_ROOT)/scripts/mkinitramfs $(ROOTFS) gzip \
+ $(EMBTK_ROOT)/initramfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG)
+else
+ @$(FAKEROOT_BIN) -i $(EMBTK_ROOT)/.fakeroot.001 -- \
+ $(EMBTK_ROOT)/scripts/mkinitramfs $(ROOTFS) bzip2 \
+ $(EMBTK_ROOT)/initramfs-$(GNU_TARGET)-$(EMBTK_MCU_FLAG)
+endif
diff --git a/mk/rootfs.mk b/mk/rootfs.mk
index 6d6d7a2..7429b78 100644
--- a/mk/rootfs.mk
+++ b/mk/rootfs.mk
@@ -32,6 +32,12 @@ include $(EMBTK_ROOT)/mk/fakeroot.mk
include $(EMBTK_ROOT)/mk/makedevs.mk
HOSTTOOLS_COMPONENTS += makedevs_install fakeroot_install
+#Does CPIO archive for initramfs selected?
+ifeq ($(CONFIG_EMBTK_ROOTFS_HAVE_INITRAMFS_CPIO),y)
+FILESYSTEMS += build_initramfs_archive
+endif
+
+#Does jffs2 filesystem selected?
ifeq ($(CONFIG_EMBTK_ROOTFS_HAVE_JFFS2),y)
include $(EMBTK_ROOT)/mk/lzo.mk
include $(EMBTK_ROOT)/mk/mtd-utils.mk
@@ -66,7 +72,7 @@ else
endif
rootfs_clean: $(HOSTTOOLS_COMPONENTS_CLEAN) $(ROOTFS_COMPONENTS_CLEAN)
- @rm -rf rootfs-*
+ @rm -rf rootfs-* initramfs-*
else
rootfs_build: