summaryrefslogtreecommitdiffstats
path: root/builder/dnbd3-rootfs/hooks/prepare-root-partition.sh
diff options
context:
space:
mode:
authorjandob2016-03-29 19:06:18 +0200
committerjandob2016-03-29 19:06:18 +0200
commit252b073349d374dc23f55701c4abdc1ffb4ade97 (patch)
treeae5965509e6089a6a3a64fc28586b09be655a788 /builder/dnbd3-rootfs/hooks/prepare-root-partition.sh
parentadd tee dependency (diff)
downloadsystemd-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-xbuilder/dnbd3-rootfs/hooks/prepare-root-partition.sh14
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