#!/bin/bash fetch_source () { : } build () { if ! which systemd >/dev/null; then pwarning "No systemd binary found in PATH. " perror "Make sure the system uses systemd before using this module." fi COPYLIST="list_dpkg_output" [ -e "$COPYLIST" ] && rm "$COPYLIST" list_packet_files >> "$COPYLIST" tarcopy "$(cat "$COPYLIST" | sort -u)" "$MODULE_BUILD_DIR" mkdir -p "${MODULE_BUILD_DIR}/etc/systemd/system" for svc in kexec reboot poweroff halt; do sed 's/umount\.target//' "${MODULE_BUILD_DIR}/lib/systemd/system/systemd-${svc}.service" \ > "${MODULE_BUILD_DIR}/etc/systemd/system/systemd-${svc}.service" \ || perror "Could not remove umount.target from $svc" done } post_copy() { [ -d "${TARGET_BUILD_DIR}/usr/lib/systemd/system" ] \ && ! [ -L "${TARGET_BUILD_DIR}/usr/lib/systemd/system" ] \ && perror "/usr/lib/systemd/system must not exist in target build dir" ln -nfs "../../../lib/systemd/system" "${TARGET_BUILD_DIR}/usr/lib/systemd/system" }