Skip to content

Commit a26d79c

Browse files
hippo5329Linus Torvalds
authored andcommitted
[PATCH] initramfs: handle more than one source dir or file list
Fix bug 7401. Handle more than one source dir or file list to the initramfs gen scripts. The Kconfig help for INITRAMFS_SOURCE claims that you can specify multiple space-separated sources in order to allow unprivileged users to build an image. There are two bugs in the current implementation that prevent this from working. First, we pass "file1 dir2" to the gen_initramfs_list.sh script, which it obviously can't open. Second, gen_initramfs_list.sh -l outputs multiple definitions for deps_initramfs -- one for each argument. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Cc: Sam Ravnborg <sam@ravnborg.org> Acked-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent 8e4d9dc commit a26d79c

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎scripts/gen_initramfs_list.sh‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ unknown_option() {
158158
}
159159

160160
list_header() {
161-
echo "deps_initramfs := \\"
161+
:
162162
}
163163

164164
header() {
@@ -227,6 +227,7 @@ arg="$1"
227227
case "$arg" in
228228
"-l") # files included in initramfs - used by kbuild
229229
dep_list="list_"
230+
echo "deps_initramfs := \\"
230231
shift
231232
;;
232233
"-o") # generate gzipped cpio image named $1

‎usr/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ $(obj)/initramfs_data.o: $(obj)/initramfs_data.cpio.gz FORCE
2020
hostprogs-y := gen_init_cpio
2121
initramfs := $(CONFIG_SHELL) $(srctree)/scripts/gen_initramfs_list.sh
2222
ramfs-input := $(if $(filter-out "",$(CONFIG_INITRAMFS_SOURCE)), \
23-
$(CONFIG_INITRAMFS_SOURCE),-d)
23+
$(shell echo $(CONFIG_INITRAMFS_SOURCE)),-d)
2424
ramfs-args := \
2525
$(if $(CONFIG_INITRAMFS_ROOT_UID), -u $(CONFIG_INITRAMFS_ROOT_UID)) \
2626
$(if $(CONFIG_INITRAMFS_ROOT_GID), -g $(CONFIG_INITRAMFS_ROOT_GID))

0 commit comments

Comments
 (0)