kbuild: Include gen_initramfs_list.sh and the file list in the .d file
[safe/jmp/linux-2.6] / scripts / gen_initramfs_list.sh
index 41041e4..f3b5c05 100644 (file)
@@ -97,7 +97,7 @@ print_mtime() {
 }
 
 list_parse() {
-       echo "$1 \\"
+       [ ! -L "$1" ] && echo "$1 \\" || :
 }
 
 # for each file print a line in following format
@@ -202,6 +202,7 @@ input_file() {
                        print_mtime "$1" >> ${output}
                        cat "$1"         >> ${output}
                else
+                       echo "$1 \\"
                        cat "$1" | while read type dir file perm ; do
                                if [ "$type" == "file" ]; then
                                        echo "$file \\";
@@ -231,7 +232,7 @@ arg="$1"
 case "$arg" in
        "-l")   # files included in initramfs - used by kbuild
                dep_list="list_"
-               echo "deps_initramfs := \\"
+               echo "deps_initramfs := $0 \\"
                shift
                ;;
        "-o")   # generate compressed cpio image named $1
@@ -292,7 +293,8 @@ if [ ! -z ${output_file} ]; then
        if [ "${is_cpio_compressed}" = "compressed" ]; then
                cat ${cpio_tfile} > ${output_file}
        else
-               cat ${cpio_tfile} | ${compr}  - > ${output_file}
+               (cat ${cpio_tfile} | ${compr}  - > ${output_file}) \
+               || (rm -f ${output_file} ; false)
        fi
        [ -z ${cpio_file} ] && rm ${cpio_tfile}
 fi