[PATCH] kbuild: Handle compressed cpio initramfs-es

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/.

Signed-off-by: Alex Landau <[email protected]>
---
If the user has created a compressed cpio by other means, this saves
him from uncompressing it, just to be compressed again by kbuild.
--- a/scripts/gen_initramfs_list.sh
+++ b/scripts/gen_initramfs_list.sh
@@ -190,9 +190,10 @@
	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
@@ -222,6 +223,7 @@
cpio_list=
output="/dev/stdout"
output_file=""
+is_cpio_compressed=

arg="$1"
case "$arg" in
@@ -281,7 +283,11 @@
		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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux