commit a26d79ca81d6e46c445c8db87a89740c9b4d17e9
tree 1134141b627cbf3c469f7067054ee4680fe58b36
parent 8e4d9dcb4205dd43c4297168022ed0c6874fb918
author Thomas Chou <[EMAIL PROTECTED]> 1164481758 -0800
committer Linus Torvalds <[EMAIL PROTECTED]> 1164490113 -0800

[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 <[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]>

 scripts/gen_initramfs_list.sh |    3 ++-
 usr/Makefile                  |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/scripts/gen_initramfs_list.sh b/scripts/gen_initramfs_list.sh
index 331c079..4c723fd 100644
--- a/scripts/gen_initramfs_list.sh
+++ b/scripts/gen_initramfs_list.sh
@@ -158,7 +158,7 @@ unknown_option() {
 }
 
 list_header() {
-       echo "deps_initramfs := \\"
+       :
 }
 
 header() {
@@ -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
diff --git a/usr/Makefile b/usr/Makefile
index e338e7b..382702a 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -20,7 +20,7 @@ $(obj)/initramfs_data.o: $(obj)/initramf
 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))
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to