From 18ba64b65a1d24c7d37e4ddab5c12668e0e097df Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Thu, 9 Jun 2011 14:18:46 -0400 Subject: mkinitcpio: allow overriding the compression method Signed-off-by: Dave Reisner --- mkinitcpio | 11 ++++++++++- mkinitcpio.5.txt | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/mkinitcpio b/mkinitcpio index 3e3b684..c97f93d 100755 --- a/mkinitcpio +++ b/mkinitcpio @@ -54,6 +54,7 @@ usage: $APPNAME [options] -s Save build directory. default: no -t TMPDIR Use TMPDIR as the temporary build directory. -v Verbose output. Default: no. + -z COMPRESS Use COMPRESS on resulting image EOF cleanup @@ -99,7 +100,7 @@ get_kernver() { trap sighandler TERM INT -while getopts ':c:k:sb:g:p:m:nvH:LMhS:t:' arg; do +while getopts ':c:k:sb:g:p:m:nvH:LMhS:t:z:' arg; do case "${arg}" in c) CONFIG="${OPTARG}" ;; k) optkver=$OPTARG ;; @@ -125,6 +126,7 @@ while getopts ':c:k:sb:g:p:m:nvH:LMhS:t:' arg; do exit 0 ;; M) SHOW_AUTOMODS=1 ;; t) TMPDIR=$OPTARG ;; + z) optcompress=$OPTARG ;; h|?) usage ;; :) echo "${OPTARG} requires a value..."; usage ;; esac @@ -256,11 +258,18 @@ if (( SHOW_AUTOMODS )); then exit 0 fi + if [[ -z $GENIMG ]]; then msg "Starting dry run: %s" "$KERNELVERSION" else + COMPRESSION=${optcompress:-$COMPRESSION} + if ! type -P "$COMPRESSION" >/dev/null; then + die "Unable to locate compression method: %s" "$optcompress" + fi + msg "Starting build: %s" "$KERNELVERSION" fi + #parse 'global' hook, as defined in ${CONFIG} parse_hook diff --git a/mkinitcpio.5.txt b/mkinitcpio.5.txt index 9871099..cbcbca6 100644 --- a/mkinitcpio.5.txt +++ b/mkinitcpio.5.txt @@ -57,6 +57,9 @@ Options *-h*:: Output a short overview of available command-line switches. +*-z* 'compress':: + Override the compression method with the 'compress' program. + About Hooks ----------- A hook is a script that executes in the initial ramdisk. Scripts are -- cgit v1.2.3-24-g4f1b