summaryrefslogtreecommitdiffstats
path: root/builder/build-initramfs.sh
diff options
context:
space:
mode:
authortorben2016-03-01 10:53:34 +0100
committertorben2016-03-01 10:53:34 +0100
commit6f4c7623c24d55d7041c55e1a8fd471e0f08d8e3 (patch)
treebaf286e9d368dd140c85dd5b91612262e73b0b85 /builder/build-initramfs.sh
parentAdd todo. (diff)
downloadsystemd-init-6f4c7623c24d55d7041c55e1a8fd471e0f08d8e3.tar.gz
systemd-init-6f4c7623c24d55d7041c55e1a8fd471e0f08d8e3.tar.xz
systemd-init-6f4c7623c24d55d7041c55e1a8fd471e0f08d8e3.zip
Fix dracut logging.
Diffstat (limited to 'builder/build-initramfs.sh')
-rwxr-xr-xbuilder/build-initramfs.sh14
1 files changed, 9 insertions, 5 deletions
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