summaryrefslogtreecommitdiffstats
path: root/modules.d/slx-uuid/module-setup.sh
blob: c89daae9d67ab5990a537aac7bdf12dd0660b2eb (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
#!/usr/bin/env bash
check() {
	# Tell dracut that this module should only be included if it is required
	# explicitly.
	if ! hash dmidecode; then
		echo "dmidecode is missing from this system, please install it."
		return 1
	fi
	return 255
}
depends() {
	echo busybox
}
install() {
	mkdir -p "$initdir/etc/bad-uuid.d"
	# check if we have any uuid blacklists installed by openslx/mltk on this system
	for blacklist in /opt/openslx/bad-uuid.d/*; do
		[ -s "$blacklist" ] || continue
		inst_simple "$blacklist" "/etc/bad-uuid.d/${blacklist##*/}"
	done
	# add this module's default blacklist
	inst_simple "$moddir/bad-uuid-defaults.conf" "/etc/bad-uuid.d/bad-uuid-defaults.conf"

	inst_multiple dmidecode
	inst_hook pre-pivot 10 "$moddir/hooks/copy-system-uuid-to-newroot.sh"

	slx_service "s3-get-system-uuid" "Get system UUID" \
		--wafter "s3-parse-network-kcl.service" \
		--wafter "dracut-cmdline.service"
}