aboutsummaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorMartin Schlemmer <azarah@nosferatu.za.org>2004-10-19 18:23:20 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-10-19 18:23:20 -0700
commit187ada2d0b0a75e5e3533dbfdbd0f5497d978b02 (patch)
treeec81c85afd9bfb2ff5ace21892abba940693ee30 /usr
parent6fa95f2bbf236668a7a0c6305dcda20da5dafbb9 (diff)
downloadhistory-187ada2d0b0a75e5e3533dbfdbd0f5497d978b02.tar.gz
[PATCH] Select cpio_list or source directory for initramfs image
Attached is a patch that adds CONFIG_INITRAMFS_SOURCE, enabling you to either specify a file as cpio_list, or a directory to generate a list from. It depreciate the INITRAMFS_LIST environment variable introduced not long ago. There are some issues (suggestions/patches welcome) that I am not sure about: 1) I put the menu entry under block devices, but I am not sure if this is the correct location? 2) There might be a better (or more correct) way to do this with kbuild? 3) Variable names and especially help text needs some love. 4) I am not sure if I am duplicating work in progress? Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'usr')
-rw-r--r--usr/Makefile20
1 files changed, 19 insertions, 1 deletions
diff --git a/usr/Makefile b/usr/Makefile
index d8910aec6ca560..96fe2c336da837 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -8,7 +8,7 @@ clean-files := initramfs_data.cpio.gz
# If you want a different list of files in the initramfs_data.cpio
# then you can either overwrite the cpio_list in this directory
# or set INITRAMFS_LIST to another filename.
-INITRAMFS_LIST ?= $(obj)/initramfs_list
+INITRAMFS_LIST := $(obj)/initramfs_list
# initramfs_data.o contains the initramfs_data.cpio.gz image.
# The image is included using .incbin, a dependency which is not
@@ -23,6 +23,24 @@ $(obj)/initramfs_data.o: $(obj)/initramfs_data.cpio.gz FORCE
# Commented out for now
# initramfs-y := $(obj)/root/hello
+quiet_cmd_gen_list = GEN_INITRAMFS_LIST $@
+ cmd_gen_list = $(shell \
+ if test -f $(CONFIG_INITRAMFS_SOURCE); then \
+ if [ $(CONFIG_INITRAMFS_SOURCE) != $@ ]; then \
+ echo 'cp -f $(CONFIG_INITRAMFS_SOURCE) $@'; \
+ else \
+ echo 'echo Using shipped $@'; \
+ fi; \
+ elif test -d $(CONFIG_INITRAMFS_SOURCE); then \
+ echo 'scripts/gen_initramfs_list.sh $(CONFIG_INITRAMFS_SOURCE) > $@'; \
+ else \
+ echo 'echo Using shipped $@'; \
+ fi)
+
+
+$(INITRAMFS_LIST): FORCE
+ $(call cmd,gen_list)
+
quiet_cmd_cpio = CPIO $@
cmd_cpio = ./$< $(INITRAMFS_LIST) > $@