summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortorben2015-11-20 13:41:55 +0100
committertorben2015-11-20 13:41:55 +0100
commitf2d0725870f7585ade5b56098a5b0c3225e6409a (patch)
tree4bea80a88d8ffac9d1f23b3486c6323112b4fa28
parentrebash update (diff)
downloadsystemd-init-f2d0725870f7585ade5b56098a5b0c3225e6409a.tar.gz
systemd-init-f2d0725870f7585ade5b56098a5b0c3225e6409a.tar.xz
systemd-init-f2d0725870f7585ade5b56098a5b0c3225e6409a.zip
Adding logging control via cli.
-rwxr-xr-xbuilder/build-initramfs.sh22
1 files changed, 11 insertions, 11 deletions
diff --git a/builder/build-initramfs.sh b/builder/build-initramfs.sh
index 1a39f6b2..4e973ee5 100755
--- a/builder/build-initramfs.sh
+++ b/builder/build-initramfs.sh
@@ -59,9 +59,6 @@ core.import logging
core.import utils
core.import exceptions
-logging.set_commands_log_level debug
-logging.set_log_level debug
-
exceptions._init
__NAME__='build-initramfs'
@@ -147,13 +144,14 @@ EOF
;;
-v|--verbose)
shift
- UTILS_VERBOSE='yes'
+ logging.set_commands_log_level info
+ logging.set_log_level info
;;
-d|--debug)
shift
_DEBUG='yes'
- UTILS_STANDARD_OUTPUT=/dev/stdout
- UTILS_ERROR_OUTPUT=/dev/stderr
+ logging.set_commands_log_level debug
+ logging.set_log_level debug
;;
-l|--load-environment)
shift
@@ -170,8 +168,8 @@ EOF
break
;;
*)
- utils_log 'critical' \
- "Given argument: \"$1\" is not available." '\n' && \
+ logging.critical \
+ "Given argument: \"$1\" is not available.\n"
if [[ "$_SCOPE" == 'local' ]]; then
build_initramfs_print_help_message "$0"
fi
@@ -196,7 +194,7 @@ EOF
# >>> build_initramfs_initialize_dracut
# ...
mkdir dracut
- utils_log 'Download and extract dracut.'
+ logging.info 'Download and extract dracut.'
curl --location \
https://www.kernel.org/pub/linux/utils/boot/dracut/dracut-043.tar.gz | \
tar --extract --gzip --directory dracut --strip-components 1
@@ -255,11 +253,13 @@ EOF
if [ "$UTILS_VERBOSE" == 'yes' ]; then
loglevel='--verbose'
fi
+ local modules='dnbd3-rootfs'
if [ "$_DEBUG" == 'yes' ]; then
loglevel="$loglevel --stdlog 4"
+ modules="$modules i18n"
fi
- # TODO load i18n if debug flag is set.
- dracut/dracut.sh --local $loglevel --force --modules "dnbd3-rootfs i18n" \
+ echo "$logging.level"
+ dracut/dracut.sh --local $loglevel --force --modules "$modules" \
--no-hostonly /boot/initramfs-test.img
logging.info 'All done!'
fi