Skip to content

Commit

Permalink
[PATCH] initramfs: handle more than one source dir or file list
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Acked-by: Matthew Wilcox <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
hippo5329 authored and Linus Torvalds committed Nov 25, 2006
1 parent 8e4d9dc commit a26d79c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion scripts/gen_initramfs_list.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ unknown_option() {
}

list_header() {
echo "deps_initramfs := \\"
:
}

header() {
Expand Down Expand Up @@ -227,6 +227,7 @@ arg="$1"
case "$arg" in
"-l") # files included in initramfs - used by kbuild
dep_list="list_"
echo "deps_initramfs := \\"
shift
;;
"-o") # generate gzipped cpio image named $1
Expand Down
2 changes: 1 addition & 1 deletion usr/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ $(obj)/initramfs_data.o: $(obj)/initramfs_data.cpio.gz FORCE
hostprogs-y := gen_init_cpio
initramfs := $(CONFIG_SHELL) $(srctree)/scripts/gen_initramfs_list.sh
ramfs-input := $(if $(filter-out "",$(CONFIG_INITRAMFS_SOURCE)), \
$(CONFIG_INITRAMFS_SOURCE),-d)
$(shell echo $(CONFIG_INITRAMFS_SOURCE)),-d)
ramfs-args := \
$(if $(CONFIG_INITRAMFS_ROOT_UID), -u $(CONFIG_INITRAMFS_ROOT_UID)) \
$(if $(CONFIG_INITRAMFS_ROOT_GID), -g $(CONFIG_INITRAMFS_ROOT_GID))
Expand Down

0 comments on commit a26d79c

Please sign in to comment.