aboutsummaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <greg@kroah.com>2003-03-07 00:46:13 -0800
committerGreg Kroah-Hartman <greg@kroah.com>2003-03-07 00:46:13 -0800
commite9a2a4eba36871cb2a67fba65c62e4936d681f54 (patch)
tree6e4dc41c2ece4456d709bb54af698c6c3a1b909b /usr
parentd875bb1bba01825dc9276885f8a1e17b0f9a21d2 (diff)
downloadhistory-e9a2a4eba36871cb2a67fba65c62e4936d681f54.tar.gz
kbuild: handle any failures of the gen_init_cpio or initramfs image to stop the build.
This also shows how to add files to the initramfs build, but is commented out. Patch originally done by Kai.
Diffstat (limited to 'usr')
-rw-r--r--usr/Makefile26
1 files changed, 22 insertions, 4 deletions
diff --git a/usr/Makefile b/usr/Makefile
index 5ff4e0c1963db7..f50927e58c279e 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -1,16 +1,34 @@
obj-y := initramfs_data.o
-host-progs := gen_init_cpio
+host-progs := gen_init_cpio
clean-files := initramfs_data.cpio.gz
LDFLAGS_initramfs_data.o := $(LDFLAGS_BLOB) -r -T
-$(obj)/initramfs_data.o: $(src)/initramfs_data.scr $(obj)/initramfs_data.cpio.gz FORCE
+$(obj)/initramfs_data.o: $(src)/initramfs_data.scr \
+ $(obj)/initramfs_data.cpio.gz FORCE
$(call if_changed,ld)
-$(obj)/initramfs_data.cpio.gz: $(obj)/gen_init_cpio
- ./$< | gzip -9c > $@
+# initramfs-y are the programs which will be copied into the CPIO
+# archive. Currently, the filenames are hardcoded in gen_init_cpio,
+# but we need the information for the build as well, so it's duplicated
+# here.
+# Commented out for now
+# initramfs-y := $(obj)/root/hello
+
+quiet_cmd_cpio = CPIO $@
+ cmd_cpio = ./$< > $@
+
+$(obj)/initramfs_data.cpio: $(obj)/gen_init_cpio $(initramfs-y) FORCE
+ $(call if_changed,cpio)
+
+targets += $(obj)/initramfs_data.cpio
+
+$(obj)/initramfs_data.cpio.gz: $(obj)/initramfs_data.cpio FORCE
+ $(call if_changed,gzip)
+
+targets += $(obj)/initramfs_data.cpio.gz