summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Landau <landau.alex@gmail.com>2007-04-26 00:17:29 -0700
committerSam Ravnborg <sam@ravnborg.org>2007-05-02 20:58:10 +0200
commitc299ec2d8e8d2f1a99d5c993fca485257b950d40 (patch)
tree52a072f07fc96729731f8cc03a628e15f92008fc
parentb4d5171ac7d9806b1ea61903ff954cd9620135bf (diff)
downloadblackbird-op-linux-c299ec2d8e8d2f1a99d5c993fca485257b950d40.tar.gz
blackbird-op-linux-c299ec2d8e8d2f1a99d5c993fca485257b950d40.zip
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() {
source="$1"
if [ -f "$1" ]; then
${dep_list}header "$1"
- is_cpio="$(echo "$1" | sed 's/^.*\.cpio/cpio/')"
+ is_cpio="$(echo "$1" | sed 's/^.*\.cpio\(\..*\)\?/cpio/')"
if [ $2 -eq 0 -a ${is_cpio} == "cpio" ]; then
cpio_file=$1
+ echo "$1" | grep -q '^.*\.cpio\..*' && is_cpio_compressed="compressed"
[ ! -z ${dep_list} ] && echo "$1"
return 0
fi
@@ -223,6 +224,7 @@ cpio_file=
cpio_list=
output="/dev/stdout"
output_file=""
+is_cpio_compressed=
arg="$1"
case "$arg" in
@@ -282,7 +284,11 @@ if [ ! -z ${output_file} ]; then
cpio_tfile=${cpio_file}
fi
rm ${cpio_list}
- cat ${cpio_tfile} | gzip -f -9 - > ${output_file}
+ if [ "${is_cpio_compressed}" = "compressed" ]; then
+ cat ${cpio_tfile} > ${output_file}
+ else
+ cat ${cpio_tfile} | gzip -f -9 - > ${output_file}
+ fi
[ -z ${cpio_file} ] && rm ${cpio_tfile}
fi
exit 0
OpenPOWER on IntegriCloud