From 6f4c7623c24d55d7041c55e1a8fd471e0f08d8e3 Mon Sep 17 00:00:00 2001 From: torben Date: Tue, 1 Mar 2016 10:53:34 +0100 Subject: Fix dracut logging. --- builder/build-initramfs.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'builder/build-initramfs.sh') diff --git a/builder/build-initramfs.sh b/builder/build-initramfs.sh index 1f6dade8..5675fe9e 100755 --- a/builder/build-initramfs.sh +++ b/builder/build-initramfs.sh @@ -244,9 +244,8 @@ parse_command_line() { if [ "$debug" == 'yes' ]; then logging.set_level debug fi - + # NOTE: Remove the following line if this sanity check should be performed. return 0 - # TODO This sanity check is only needed for some cli combinations. if [[ "$UID" != '0' ]]; then logging.critical \ "You have to run this script as \"root\" not as \"${USER}\"." @@ -483,10 +482,15 @@ else # NOTE: We deactivate our exception handle since dracut returns "1" if it # is launched with help parameter ("-h" or "--help"). exceptions.deactivate - # TODO set logging temporary to debug since dracut uses its own logging handling. - if ! "$(dirname "${BASH_SOURCE[0]}")/dracut/dracut.sh" --local \ + # NOTE: We temporary allow dracut to forward all messages since we forward + # all logging configurations. + _commands_log_level_backup="$(logging.get_commands_level)" + logging.set_commands_level debug + "$(dirname "${BASH_SOURCE[0]}")/dracut/dracut.sh" --local \ $_loglevel --modules "$_modules" ${dracut_parameter[*]} "$file_path" - then + _return_code=$? + logging.set_commands_level "$_commands_log_level_backup" + if ! $_return_code; then logging.error 'Building initial ram file system fails.' exit 1 fi -- cgit v1.2.3-55-g7522