2 obj-y := initramfs_data.o
4 host-progs := gen_init_cpio
6 clean-files := initramfs_data.cpio.gz
8 $(obj)/initramfs_data.S: $(obj)/initramfs_data.cpio.gz
9 echo '.section ".init.ramfs", "a"' > $@
10 od -v -An -t x1 -w8 $^ | cut -c2- | sed -e s"/ /,0x/g" -e s"/^/.byte 0x"/ >> $@
12 # initramfs-y are the programs which will be copied into the CPIO
13 # archive. Currently, the filenames are hardcoded in gen_init_cpio,
14 # but we need the information for the build as well, so it's duplicated
17 # Commented out for now
18 # initramfs-y := $(obj)/root/hello
20 quiet_cmd_cpio = CPIO $@
23 $(obj)/initramfs_data.cpio: $(obj)/gen_init_cpio $(initramfs-y) FORCE
24 $(call if_changed,cpio)
26 targets += initramfs_data.cpio
28 $(obj)/initramfs_data.cpio.gz: $(obj)/initramfs_data.cpio FORCE
29 $(call if_changed,gzip)
31 targets += initramfs_data.cpio.gz