aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/gen_initramfs_list.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/gen_initramfs_list.sh b/scripts/gen_initramfs_list.sh
index 43f75d6e4d96..3111f4ac23c4 100644
--- a/scripts/gen_initramfs_list.sh
+++ b/scripts/gen_initramfs_list.sh
@@ -191,9 +191,10 @@ input_file() {
191 source="$1" 191 source="$1"
192 if [ -f "$1" ]; then 192 if [ -f "$1" ]; then
193 ${dep_list}header "$1" 193 ${dep_list}header "$1"
194 is_cpio="$(echo "$1" | sed 's/^.*\.cpio/cpio/')" 194 is_cpio="$(echo "$1" | sed 's/^.*\.cpio\(\..*\)\?/cpio/')"
195 if [ $2 -eq 0 -a ${is_cpio} == "cpio" ]; then 195 if [ $2 -eq 0 -a ${is_cpio} == "cpio" ]; then
196 cpio_file=$1 196 cpio_file=$1
197 echo "$1" | grep -q '^.*\.cpio\..*' && is_cpio_compressed="compressed"
197 [ ! -z ${dep_list} ] && echo "$1" 198 [ ! -z ${dep_list} ] && echo "$1"
198 return 0 199 return 0
199 fi 200 fi
@@ -223,6 +224,7 @@ cpio_file=
223cpio_list= 224cpio_list=
224output="/dev/stdout" 225output="/dev/stdout"
225output_file="" 226output_file=""
227is_cpio_compressed=
226 228
227arg="$1" 229arg="$1"
228case "$arg" in 230case "$arg" in
@@ -282,7 +284,11 @@ if [ ! -z ${output_file} ]; then
282 cpio_tfile=${cpio_file} 284 cpio_tfile=${cpio_file}
283 fi 285 fi
284 rm ${cpio_list} 286 rm ${cpio_list}
285 cat ${cpio_tfile} | gzip -f -9 - > ${output_file} 287 if [ "${is_cpio_compressed}" = "compressed" ]; then
288 cat ${cpio_tfile} > ${output_file}
289 else
290 cat ${cpio_tfile} | gzip -f -9 - > ${output_file}
291 fi
286 [ -z ${cpio_file} ] && rm ${cpio_tfile} 292 [ -z ${cpio_file} ] && rm ${cpio_tfile}
287fi 293fi
288exit 0 294exit 0