summaryrefslogtreecommitdiffstats
path: root/core/modules/systemd-distro/module.build
blob: c7d9d09df031367a16f8d66a8f4b6f8356a564bd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/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
	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"
}