summaryrefslogtreecommitdiffstats
path: root/core/modules/systemd-distro/module.build
blob: b685344b40fadeb89bdedfc0f1636c685543fcd7 (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
26
27
28
29
30
#!/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
	mkdir -p "${MODULE_BUILD_DIR}/lib/udev"
	for f in /lib/udev/hwdb.bin /etc/udev/hwdb.bin; do
		[ -f "$f" ] || continue
		cp "$f" "${MODULE_BUILD_DIR}/lib/udev/hwdb.bin" || perror "Copy $f failed"
		break
	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"
}