Impact: Resolves build failures in some configurations Makes it possible to disable CONFIG_RD_GZIP . In that case, the built-in initramfs will be compressed by whatever compressor is available (bzip2 or lzma) or left uncompressed if none is available. It also removes a couple of warnings which occur when no ramdisk compression at all is chosen. It also restores the select ZLIB_INFLATE in drivers/block/Kconfig which somehow came missing. This is needed to activate compilation of the stuff in zlib_deflate.
Showing the changes to scripts (1 of 7 files). Show all
Unified · Split
| @@ -5,7 +5,7 @@ · 4 unmodified lines | ||
| 5 | 5 | # Released under the terms of the GNU GPL |
| 6 | 6 | # |
| 7 | 7 | # Generate a cpio packed initramfs. It uses gen_init_cpio to generate |
| 8 | −# the cpio archive, and gzip to pack it. | |
| 8 | +# the cpio archive, and then compresses it. | |
| 9 | 9 | # The script may also be used to generate the inputfile used for gen_init_cpio |
| 10 | 10 | # This script assumes that gen_init_cpio is located in usr/ directory |
| 11 | 11 | |
| @@ -16,8 +16,8 @@ usage() { · 4 unmodified lines | ||
| 16 | 16 | cat << EOF |
| 17 | 17 | Usage: |
| 18 | 18 | $0 [-o <file>] [-u <uid>] [-g <gid>] {-d | <cpio_source>} ... |
| 19 | − -o <file> Create gzipped initramfs file named <file> using | |
| 20 | − gen_init_cpio and gzip | |
| 19 | + -o <file> Create compressed initramfs file named <file> using | |
| 20 | + gen_init_cpio and compressor depending on the extension | |
| 21 | 21 | -u <uid> User ID to map to user ID 0 (root). |
| 22 | 22 | <uid> is only meaningful if <cpio_source> is a |
| 23 | 23 | directory. "squash" forces all files to uid 0. |
| @@ -225,6 +225,7 @@ cpio_list= · 201 unmodified lines | ||
| 225 | 225 | output="/dev/stdout" |
| 226 | 226 | output_file="" |
| 227 | 227 | is_cpio_compressed= |
| 228 | +compr="gzip -9 -f" | |
| 228 | 229 | |
| 229 | 230 | arg="$1" |
| 230 | 231 | case "$arg" in |
| @@ -233,11 +234,15 @@ case "$arg" in · 2 unmodified lines | ||
| 233 | 234 | echo "deps_initramfs := \\" |
| 234 | 235 | shift |
| 235 | 236 | ;; |
| 236 | − "-o") # generate gzipped cpio image named $1 | |
| 237 | + "-o") # generate compressed cpio image named $1 | |
| 237 | 238 | shift |
| 238 | 239 | output_file="$1" |
| 239 | 240 | cpio_list="$(mktemp ${TMPDIR:-/tmp}/cpiolist.XXXXXX)" |
| 240 | 241 | output=${cpio_list} |
| 242 | + echo "$output_file" | grep -q "\.gz$" && compr="gzip -9 -f" | |
| 243 | + echo "$output_file" | grep -q "\.bz2$" && compr="bzip2 -9 -f" | |
| 244 | + echo "$output_file" | grep -q "\.lzma$" && compr="lzma -9 -f" | |
| 245 | + echo "$output_file" | grep -q "\.cpio$" && compr="cat" | |
| 241 | 246 | shift |
| 242 | 247 | ;; |
| 243 | 248 | esac |
| @@ -274,7 +279,7 @@ while [ $# -gt 0 ]; do · 30 unmodified lines | ||
| 274 | 279 | esac |
| 275 | 280 | done |
| 276 | 281 | |
| 277 | −# If output_file is set we will generate cpio archive and gzip it | |
| 282 | +# If output_file is set we will generate cpio archive and compress it | |
| 278 | 283 | # we are carefull to delete tmp files |
| 279 | 284 | if [ ! -z ${output_file} ]; then |
| 280 | 285 | if [ -z ${cpio_file} ]; then |
| @@ -287,7 +292,7 @@ if [ ! -z ${output_file} ]; then · 6 unmodified lines | ||
| 287 | 292 | if [ "${is_cpio_compressed}" = "compressed" ]; then |
| 288 | 293 | cat ${cpio_tfile} > ${output_file} |
| 289 | 294 | else |
| 290 | − cat ${cpio_tfile} | gzip -f -9 - > ${output_file} | |
| 295 | + cat ${cpio_tfile} | ${compr} - > ${output_file} | |
| 291 | 296 | fi |
| 292 | 297 | [ -z ${cpio_file} ] && rm ${cpio_tfile} |
| 293 | 298 | fi |