diff options
author | jandob | 2016-03-29 19:06:18 +0200 |
---|---|---|
committer | jandob | 2016-03-29 19:06:18 +0200 |
commit | 252b073349d374dc23f55701c4abdc1ffb4ade97 (patch) | |
tree | ae5965509e6089a6a3a64fc28586b09be655a788 /builder/dnbd3-rootfs/hooks/prepare-root-partition.sh | |
parent | add tee dependency (diff) | |
download | systemd-init-252b073349d374dc23f55701c4abdc1ffb4ade97.tar.gz systemd-init-252b073349d374dc23f55701c4abdc1ffb4ade97.tar.xz systemd-init-252b073349d374dc23f55701c4abdc1ffb4ade97.zip |
add logging to file functionality
Diffstat (limited to 'builder/dnbd3-rootfs/hooks/prepare-root-partition.sh')
-rwxr-xr-x | builder/dnbd3-rootfs/hooks/prepare-root-partition.sh | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/builder/dnbd3-rootfs/hooks/prepare-root-partition.sh b/builder/dnbd3-rootfs/hooks/prepare-root-partition.sh index b57a915c..95d13e51 100755 --- a/builder/dnbd3-rootfs/hooks/prepare-root-partition.sh +++ b/builder/dnbd3-rootfs/hooks/prepare-root-partition.sh @@ -9,10 +9,11 @@ type emergency_shell >/dev/null 2>&1 || source /lib/dracut-lib.sh # endregion exceptions.try { +source /etc/openslx logging.set_commands_level debug logging.set_level debug - -source /etc/openslx +[[ "$SLX_LOG_FILE_PATH" == "" ]] && SLX_LOG_FILE_PATH=/var/log/openslx +logging.set_log_file "$SLX_LOG_FILE_PATH" # region find writable partition if [[ "$SLX_WRITABLE_DEVICE_IDENTIFIER" != '' ]] && @@ -110,7 +111,14 @@ if [[ $return_code != 0 ]]; then fi # endregion # region scan partitions -read_only_device="$(container-unpack-xmount "$SLX_DNBD3_DEVICE")" +if [ "$SLX_LOG_FILE_PATH" != "" ]; then + read_only_device="$(container-unpack-xmount "$SLX_DNBD3_DEVICE" \ + 2>>"$SLX_LOG_FILE_PATH")" +else + read_only_device="$(container-unpack-xmount "$SLX_DNBD3_DEVICE")" +fi + + # Fail fast if no device could be determined. [ -z "$read_only_device" ] && exit 1 # endregion |