Commit e327ec5b authored by Natanael Copa's avatar Natanael Copa

update-kernel: add --verbose option

parent 1548ce76
...@@ -40,24 +40,29 @@ Options: -b|--build <build_dir> Install custom-built kernel ...@@ -40,24 +40,29 @@ Options: -b|--build <build_dir> Install custom-built kernel
-f|--flavor <flavor> Install kernel of specified flavor -f|--flavor <flavor> Install kernel of specified flavor
-F|--feature <feature> Enable initfs feature -F|--feature <feature> Enable initfs feature
-p|--package <package> Additional module or firmware package -p|--package <package> Additional module or firmware package
-v|--verbose Verbose output
EOF EOF
exit $1 exit $1
} }
OPTS=$(getopt -l build-dir:,flavor:,feature:,help,package: -n $SCRIPT \ QUIET_OPT="--quiet"
-o b:f:F:hp: -- "$@") || usage 1 OPTS=$(getopt -l build-dir:,flavor:,feature:,help,package:,verbose -n $SCRIPT \
-o b:f:F:hp:v -- "$@") || usage 1
eval set -- "$OPTS" eval set -- "$OPTS"
while :; do while :; do
case "$1" in case "$1" in
-b|--build-dir) -b|--build-dir)
BUILDDIR=$2 BUILDDIR=$2
shift
;; ;;
-f|--flavor) -f|--flavor)
FLAVOR=$2 FLAVOR=$2
shift
;; ;;
-F|--feature) -F|--feature)
features="$features $2" features="$features $2"
shift
;; ;;
-h|--help) -h|--help)
echo "$SCRIPT @VERSION@" >&2 echo "$SCRIPT @VERSION@" >&2
...@@ -65,12 +70,16 @@ while :; do ...@@ -65,12 +70,16 @@ while :; do
;; ;;
-p|--package) -p|--package)
PACKAGES="$PACKAGES $2" PACKAGES="$PACKAGES $2"
shift
;;
-v|--verbose)
QUIET_OPT=
;; ;;
--) --)
break break
;; ;;
esac esac
shift 2 shift
done done
DESTDIR=$2 DESTDIR=$2
...@@ -113,7 +122,7 @@ clean_up() { ...@@ -113,7 +122,7 @@ clean_up() {
set +e set +e
ignore_sigs ignore_sigs
[ "$SUPERUSER" ] && apk del -q $VIRTUAL [ "$SUPERUSER" ] && apk del $QUIET_OPT $VIRTUAL
rm -fr $TMPDIR rm -fr $TMPDIR
} }
...@@ -121,7 +130,7 @@ trap clean_up EXIT $SIGNALS ...@@ -121,7 +130,7 @@ trap clean_up EXIT $SIGNALS
if [ "$SUPERUSER" ]; then if [ "$SUPERUSER" ]; then
apk add -qU -t $VIRTUAL mkinitfs squashfs-tools apk add $QUIET_OPT --update--cache -t $VIRTUAL mkinitfs squashfs-tools
fi fi
if [ -z "$features" ]; then if [ -z "$features" ]; then
...@@ -157,7 +166,7 @@ _apk() { ...@@ -157,7 +166,7 @@ _apk() {
wrapper="fakeroot $opt -s $fake_env --" wrapper="fakeroot $opt -s $fake_env --"
fi fi
$wrapper apk $cmd -p $ROOT --keys-dir /etc/apk/keys \ $wrapper apk $cmd $QUIET_OPT -p $ROOT --keys-dir /etc/apk/keys \
--repositories-file /etc/apk/repositories $* --repositories-file /etc/apk/repositories $*
} }
...@@ -169,7 +178,7 @@ extra_pkgs() { ...@@ -169,7 +178,7 @@ extra_pkgs() {
} }
# set up the root and get the APKINDEX for search # set up the root and get the APKINDEX for search
_apk add --quiet --initdb --update-cache _apk add --initdb --update-cache
if [ "$BUILDDIR" ]; then if [ "$BUILDDIR" ]; then
mkdir -p $BOOT mkdir -p $BOOT
...@@ -182,7 +191,7 @@ else ...@@ -182,7 +191,7 @@ else
fi fi
PACKAGES="$PACKAGES linux-$FLAVOR linux-firmware" PACKAGES="$PACKAGES linux-$FLAVOR linux-firmware"
fi fi
_apk add --quiet --no-scripts alpine-base $PACKAGES _apk add --no-scripts alpine-base $PACKAGES
KVER_FLAVOR= KVER_FLAVOR=
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment