summaryrefslogtreecommitdiff
path: root/mkinitramfs
diff options
context:
space:
mode:
authorBert Schulze <spambemyguest@googlemail.com>2010-04-04 17:43:48 +0200
committermaximilian attems <maks@debian.org>2010-04-04 18:02:02 +0200
commitfe7e630857d2fd1c9b7af48f33d46e626ac6509e (patch)
tree20c62e19b7d24887bc033d3c630bc49a56531960 /mkinitramfs
parent0164c63083cf31e83660e866614c0cd83bd34bfd (diff)
downloadinitramfs-tools-fe7e630857d2fd1c9b7af48f33d46e626ac6509e.tar.gz
initramfs-tools-fe7e630857d2fd1c9b7af48f33d46e626ac6509e.zip
mkinitramfs: -c compression support / commandline override
fixed the commandline argument to select the compressor. also your test with "command" needed to be negated otherwise the fallback to gzip would take place everytime. -- frohe ostern Bert Schulze [ nuked trailing whitespace, and add comment for usage() ] Signed-off-by: maximilian attems <maks@debian.org>
Diffstat (limited to 'mkinitramfs')
-rwxr-xr-xmkinitramfs15
1 files changed, 12 insertions, 3 deletions
diff --git a/mkinitramfs b/mkinitramfs
index 33ef99b..110aca8 100755
--- a/mkinitramfs
+++ b/mkinitramfs
@@ -11,7 +11,7 @@ errors_to="2>/dev/null"
# BUSYBOXDIR="/usr/lib/initramfs-tools/bin/"
export BUSYBOXDIR="/bin"
-OPTIONS=`getopt -o d:ko:r:v -n "$0" -- "$@"`
+OPTIONS=`getopt -o c:d:ko:r:v -n "$0" -- "$@"`
# Check for non-GNU getopt
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
@@ -20,6 +20,10 @@ eval set -- "$OPTIONS"
while true; do
case "$1" in
+ -c)
+ compress="$2"
+ shift 2
+ ;;
-d)
CONFDIR="$2"
shift 2
@@ -124,8 +128,13 @@ case "${version}" in
esac
# Check userspace and kernel support for compressed initramfs images
-compress=${COMPRESS}
-if command -v ${compress} >/dev/null 2>&1; then
+if [ -z "${compress}" ]; then
+ compress=${COMPRESS}
+else
+ COMPRESS=${compress}
+fi
+
+if ! command -v ${compress} >/dev/null 2>&1; then
compress=gzip
[ "${verbose}" = y ] && \
echo "No ${COMPRESS} in ${PATH}, using gzip"