summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2011-06-09 20:18:46 +0200
committerThomas Bächler <thomas@archlinux.org>2011-06-25 12:25:45 +0200
commit18ba64b65a1d24c7d37e4ddab5c12668e0e097df (patch)
treec91d5f83ad4301ab8c08c8395a953bce1c339ec2
parent199eea97bad60365dcfd5bac7ea55fc39b2f773a (diff)
downloadmkinitcpio-18ba64b65a1d24c7d37e4ddab5c12668e0e097df.tar.gz
mkinitcpio-18ba64b65a1d24c7d37e4ddab5c12668e0e097df.tar.xz
mkinitcpio: allow overriding the compression method
Signed-off-by: Dave Reisner <d@falconindy.com>
-rwxr-xr-xmkinitcpio11
-rw-r--r--mkinitcpio.5.txt3
2 files changed, 13 insertions, 1 deletions
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