diff options
Diffstat (limited to 'builder')
10 files changed, 32 insertions, 12 deletions
diff --git a/builder/build-initramfs.sh b/builder/build-initramfs.sh index b3d43015..0ceef33f 100755 --- a/builder/build-initramfs.sh +++ b/builder/build-initramfs.sh @@ -78,11 +78,11 @@ declare -A core_dependencies=( [dmsetup]='create a (temporary) writable layer during boot' \ [grep]='retrieve right boot partition during boot' \ [mktemp]='create save temporary files and dictionaries' \ + [tee]='read from standard input and write to standard output and files' \ [readlink]="connect dracut module with dracut's module system" \ [rm]='remove (temporary) files' \ [shift]='parse command line' \ [sed]='process strings' \ - [tee]='write stdout to file' \ ['cmake gcc make']='dynamically compile needed resources against current or given kernel') # shellcheck disable=SC2034 declare -A optional_dependencies=( @@ -557,7 +557,7 @@ main() { if ! ln --symbolic --force "$_dracut_modules_source" \ "$_dracut_modules_target" 2>/dev/null; then logging.warn \ - "Link \"$_dracut_modules_source\" to \"$_dracut_modules_target\" fails. We will copy them. So we have to recopy it every time to ensure that recompiled things take effect." + "Linking \"$_dracut_modules_source\" to \"$_dracut_modules_target\" failed. We will copy them. So we have to recopy it every time to ensure that recompiled things take effect." cp --recursive --force --no-target-directory \ "$(dirname "${BASH_SOURCE[0]}")/$(basename "$_dracut_modules_source")" \ "$_dracut_modules_target" @@ -603,7 +603,7 @@ main() { logging.set_commands_level "$_commands_log_level_backup" logging.set_level "$_log_level_backup" if [[ "$_return_code" != 0 ]]; then - logging.error 'Building initial ram file system fails.' + logging.error 'Building initial ram file system failed.' exit 1 fi exceptions.activate diff --git a/builder/dnbd3-rootfs/hooks/copy-dnbd3-service-into-newroot.sh b/builder/dnbd3-rootfs/hooks/copy-dnbd3-service-into-newroot.sh index a1554752..ee308af6 100755 --- a/builder/dnbd3-rootfs/hooks/copy-dnbd3-service-into-newroot.sh +++ b/builder/dnbd3-rootfs/hooks/copy-dnbd3-service-into-newroot.sh @@ -10,6 +10,8 @@ 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" systemd_system_unit_path="$(dirname "$(find / -name dracut-mount.service \ -type f -print -quit)")" diff --git a/builder/dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh b/builder/dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh index f0a07dfb..a887d8c9 100755 --- a/builder/dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh +++ b/builder/dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh @@ -10,6 +10,8 @@ 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)" diff --git a/builder/dnbd3-rootfs/hooks/copy-openslx-configuration-into-newroot.sh b/builder/dnbd3-rootfs/hooks/copy-openslx-configuration-into-newroot.sh index 8bf51724..6a56f857 100755 --- a/builder/dnbd3-rootfs/hooks/copy-openslx-configuration-into-newroot.sh +++ b/builder/dnbd3-rootfs/hooks/copy-openslx-configuration-into-newroot.sh @@ -8,10 +8,12 @@ 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 +[[ "$SLX_LOG_FILE_PATH" == "" ]] && SLX_LOG_FILE_PATH=/var/log/openslx +logging.set_log_file "$SLX_LOG_FILE_PATH" -source "/etc/openslx" mkdir --parents "${NEWROOT}${SLX_CONFIGURATION_LOCATION}" cp "/etc/openslx" "${NEWROOT}${SLX_CONFIGURATION_LOCATION}" } diff --git a/builder/dnbd3-rootfs/hooks/fetch-config.sh b/builder/dnbd3-rootfs/hooks/fetch-config.sh index 0b8d5a0a..7921a99f 100755 --- a/builder/dnbd3-rootfs/hooks/fetch-config.sh +++ b/builder/dnbd3-rootfs/hooks/fetch-config.sh @@ -10,6 +10,9 @@ 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" + # NOTE: "getarg" raises an exception so deactivate exceptions for now. exceptions.deactivate configuration_file_name="$(getarg slx_configuration_filename=)" diff --git a/builder/dnbd3-rootfs/hooks/mount-root-device.sh b/builder/dnbd3-rootfs/hooks/mount-root-device.sh index 49bfcdc6..35443def 100755 --- a/builder/dnbd3-rootfs/hooks/mount-root-device.sh +++ b/builder/dnbd3-rootfs/hooks/mount-root-device.sh @@ -9,6 +9,8 @@ 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" if ! getarg root=; then source "/etc/openslx" diff --git a/builder/dnbd3-rootfs/hooks/prepare-kernel-command-line-parameter.sh b/builder/dnbd3-rootfs/hooks/prepare-kernel-command-line-parameter.sh index cb58d981..ba234c55 100755 --- a/builder/dnbd3-rootfs/hooks/prepare-kernel-command-line-parameter.sh +++ b/builder/dnbd3-rootfs/hooks/prepare-kernel-command-line-parameter.sh @@ -8,6 +8,8 @@ core.import logging ( 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" SLX_INITIAL_KERNEL_COMMAND_LINE="$(cat /proc/cmdline | tr --delete '\n')" 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 diff --git a/builder/dnbd3-rootfs/module-setup.sh b/builder/dnbd3-rootfs/module-setup.sh index fecadb2e..3599d797 100755 --- a/builder/dnbd3-rootfs/module-setup.sh +++ b/builder/dnbd3-rootfs/module-setup.sh @@ -251,15 +251,14 @@ install() { basename bash blockdev \ cat cut \ dd diff dirname dmsetup \ - find \ + find fsck.ext4 \ grep \ insmod \ losetup lsblk \ - mktemp mount mountpoint \ + mkfifo mkfs.ext4 mktemp mount mountpoint \ sed sleep sort \ - touch tr \ - wget \ - mkfs.ext4 fsck.ext4 + tee touch tr \ + wget } # endregion # region vim modline diff --git a/builder/dnbd3-rootfs/scripts/rebash b/builder/dnbd3-rootfs/scripts/rebash -Subproject c27ca6ac577c6da7983453ad84290cd9b951f56 +Subproject 9adcbb8f7eb07b519f30cac0a0e9c4d382f4901 |
