summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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