#!/bin/bash type emergency_shell &>/dev/null || source /lib/dracut-lib.sh # Copy dnbd3-client too, needed for controlling dnbd0 mkdir -p "${NEWROOT}/opt/openslx/sbin" cp "$(which dnbd3-client)" "${NEWROOT}/opt/openslx/sbin/dnbd3-client" # Copy our services over to stage 4, so they still appear in # systemd-analyze plot etc. new_systemd_system_unit_path="${NEWROOT}/lib/systemd/system" mkdir --parents "$new_systemd_system_unit_path/initrd.target.wants" for dir in /run/systemd/system /lib/systemd/system /etc/systemd/system; do for file in "$dir"/s3-*.{service,target} "$dir"/dracut-*.{service,target}; do [ -f "$file" ] || continue name="${file##*/}" cp "${file}" "${new_systemd_system_unit_path}/${name}" source_path="../${name}" target_path="${new_systemd_system_unit_path}/initrd.target.wants/${name}" ln -nfs "$source_path" "$target_path" || \ warn "Failed to link \"$source_path\" to \"$target_path\"." done done