diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2017-01-05 05:29:36 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-01-05 12:40:16 -0500 |
commit | 9e3596b0c6539e28546ff7c72a06576627068353 (patch) | |
tree | 1c150c70bb2f1d2d3960f48c06eebe2d63078e1e | |
parent | ae30ab4cd711a147cafaf5674c333c5a84fe53fb (diff) |
kbuild: initramfs cleanup, set target from Kconfig
Rather than keep a list of all possible compression types in the
Makefile, set the target explicitly from Kconfig.
Reviewed-by: Francisco Blas Izquierdo Riera (klondike) <klondike@klondike.es>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | usr/Makefile | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/usr/Makefile b/usr/Makefile index 746c3fd0b933..0b87e71c00fc 100644 --- a/usr/Makefile +++ b/usr/Makefile | |||
@@ -6,7 +6,9 @@ klibcdirs:; | |||
6 | PHONY += klibcdirs | 6 | PHONY += klibcdirs |
7 | 7 | ||
8 | suffix_y = $(subst $\",,$(CONFIG_INITRAMFS_COMPRESSION)) | 8 | suffix_y = $(subst $\",,$(CONFIG_INITRAMFS_COMPRESSION)) |
9 | AFLAGS_initramfs_data.o += -DINITRAMFS_IMAGE="usr/initramfs_data.cpio$(suffix_y)" | 9 | datafile_y = initramfs_data.cpio$(suffix_y) |
10 | AFLAGS_initramfs_data.o += -DINITRAMFS_IMAGE="usr/$(datafile_y)" | ||
11 | |||
10 | 12 | ||
11 | # Generate builtin.o based on initramfs_data.o | 13 | # Generate builtin.o based on initramfs_data.o |
12 | obj-$(CONFIG_BLK_DEV_INITRD) := initramfs_data.o | 14 | obj-$(CONFIG_BLK_DEV_INITRD) := initramfs_data.o |
@@ -14,7 +16,7 @@ obj-$(CONFIG_BLK_DEV_INITRD) := initramfs_data.o | |||
14 | # initramfs_data.o contains the compressed initramfs_data.cpio image. | 16 | # initramfs_data.o contains the compressed initramfs_data.cpio image. |
15 | # The image is included using .incbin, a dependency which is not | 17 | # The image is included using .incbin, a dependency which is not |
16 | # tracked automatically. | 18 | # tracked automatically. |
17 | $(obj)/initramfs_data.o: $(obj)/initramfs_data.cpio$(suffix_y) FORCE | 19 | $(obj)/initramfs_data.o: $(obj)/$(datafile_y) FORCE |
18 | 20 | ||
19 | ##### | 21 | ##### |
20 | # Generate the initramfs cpio archive | 22 | # Generate the initramfs cpio archive |
@@ -38,10 +40,8 @@ endif | |||
38 | quiet_cmd_initfs = GEN $@ | 40 | quiet_cmd_initfs = GEN $@ |
39 | cmd_initfs = $(initramfs) -o $@ $(ramfs-args) $(ramfs-input) | 41 | cmd_initfs = $(initramfs) -o $@ $(ramfs-args) $(ramfs-input) |
40 | 42 | ||
41 | targets := initramfs_data.cpio.gz initramfs_data.cpio.bz2 \ | 43 | targets := $(datafile_y) |
42 | initramfs_data.cpio.lzma initramfs_data.cpio.xz \ | 44 | |
43 | initramfs_data.cpio.lzo initramfs_data.cpio.lz4 \ | ||
44 | initramfs_data.cpio | ||
45 | # do not try to update files included in initramfs | 45 | # do not try to update files included in initramfs |
46 | $(deps_initramfs): ; | 46 | $(deps_initramfs): ; |
47 | 47 | ||
@@ -51,6 +51,6 @@ $(deps_initramfs): klibcdirs | |||
51 | # 2) There are changes in which files are included (added or deleted) | 51 | # 2) There are changes in which files are included (added or deleted) |
52 | # 3) If gen_init_cpio are newer than initramfs_data.cpio | 52 | # 3) If gen_init_cpio are newer than initramfs_data.cpio |
53 | # 4) arguments to gen_initramfs.sh changes | 53 | # 4) arguments to gen_initramfs.sh changes |
54 | $(obj)/initramfs_data.cpio$(suffix_y): $(obj)/gen_init_cpio $(deps_initramfs) klibcdirs | 54 | $(obj)/$(datafile_y): $(obj)/gen_init_cpio $(deps_initramfs) klibcdirs |
55 | $(Q)$(initramfs) -l $(ramfs-input) > $(obj)/.initramfs_data.cpio.d | 55 | $(Q)$(initramfs) -l $(ramfs-input) > $(obj)/.initramfs_data.cpio.d |
56 | $(call if_changed,initfs) | 56 | $(call if_changed,initfs) |