aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Landau <landau.alex@gmail.com>2007-04-26 03:17:29 -0400
committerSam Ravnborg <sam@ravnborg.org>2007-05-02 14:58:10 -0400
commitc299ec2d8e8d2f1a99d5c993fca485257b950d40 (patch)
tree52a072f07fc96729731f8cc03a628e15f92008fc
parentb4d5171ac7d9806b1ea61903ff954cd9620135bf (diff)
kbuild: handle compressed cpio initramfs-es
Make kbuild handle compressed cpio initramfs-es. An already compressed cpio is copied directly to usr/, while a non-compressed cpio is filtered through gzip (no changes here) on its way to usr/. If the user has created a compressed cpio by other means, this saves him from uncompressing it, just to be compressed again by kbuild. Signed-off-by: Alex Landau <landau.alex@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
-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