summaryrefslogtreecommitdiffstats
path: root/builder/modules.d/dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh
diff options
context:
space:
mode:
Diffstat (limited to 'builder/modules.d/dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh')
-rwxr-xr-xbuilder/modules.d/dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh34
1 files changed, 1 insertions, 33 deletions
diff --git a/builder/modules.d/dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh b/builder/modules.d/dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh
index c722e734..5de1f2e9 100755
--- a/builder/modules.d/dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh
+++ b/builder/modules.d/dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh
@@ -1,17 +1,6 @@
#!/usr/bin/env bash
# -*- coding: utf-8 -*-
-# region imports
-source '/usr/lib/rebash/core.sh'
-core.import exceptions
-core.import logging
type emergency_shell >/dev/null 2>&1 || source /lib/dracut-lib.sh
-# endregion
-exceptions.try
-{
-logging.set_commands_level debug
-logging.set_level debug
-[[ "$SLX_LOG_FILE_PATH" == "" ]] && SLX_LOG_FILE_PATH=/var/log/openslx
-logging.set_log_file "$SLX_LOG_FILE_PATH"
# Needed to be able to go back to dracut at system shutdown.
temporary_directory_path="$(mktemp --directory)"
@@ -19,15 +8,7 @@ mount --options bind / "$temporary_directory_path"
cp --recursive --no-target-directory "$temporary_directory_path" /run/initramfs
umount "$temporary_directory_path"
rm --dir "$temporary_directory_path"
-}
-exceptions.catch
-{
- logging.warn "Failed to copy initramfs to /run/initramfs, shutdown hooks" \
- "will not work."
-}
-exceptions.try
-{
# Dracut may not be installed on the new root. Thus copy all services over.
dracut_mount_unit_path="$(systemctl show -p FragmentPath dracut-mount.service \
| cut -c 14-)"
@@ -50,18 +31,5 @@ do
source_path="../${file}"
target_path="${new_systemd_system_unit_path}/initrd.target.wants/${file}"
ln --symbolic "$source_path" "$targetPath" &>/dev/null || \
- logging.warn "Failed to link \"$source_path\" to \"$target_path\"."
+ warn "Failed to link \"$source_path\" to \"$target_path\"."
done
-}
-exceptions.catch
-{
- logging.error "$exceptions_last_traceback"
- emergency_shell "error in ${BASH_SOURCE[0]}"
-}
-
-# region vim modline
-
-# vim: set tabstop=4 shiftwidth=4 expandtab:
-# vim: foldmethod=marker foldmarker=region,endregion:
-
-# endregion