mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-02-04 06:47:13 +08:00
42 lines
819 B
Bash
42 lines
819 B
Bash
#!/bin/bash
|
|
|
|
declare -l USELVM
|
|
|
|
. /etc/rc.conf
|
|
|
|
units=('chakra-persistent-settings.service'
|
|
'chakra-daemons.target'
|
|
'rc-local.service')
|
|
|
|
post_install() {
|
|
[[ "$USELVM" = yes ]] && units+=("lvm.service" "udev-settle.service")
|
|
|
|
/bin/systemctl enable "${units[@]}"
|
|
|
|
post_upgrade
|
|
|
|
# we do this here explicitly so that there isn't a lagtime of an extra reboot
|
|
# before the gluework to /etc/rc.conf goes into effect
|
|
/lib/systemd/chakra-persistent-settings
|
|
}
|
|
|
|
post_upgrade() {
|
|
if ps -C systemd >/dev/null 2>&1; then
|
|
/bin/systemctl daemon-reload
|
|
else
|
|
return 0
|
|
fi
|
|
}
|
|
|
|
pre_remove() {
|
|
if ps -C systemd >/dev/null 2>&1; then
|
|
/bin/systemctl disable "${units[@]}"
|
|
/bin/systemctl daemon-reload
|
|
else
|
|
return 0
|
|
fi
|
|
}
|
|
|
|
post_remove() {
|
|
rm -f /etc/{modprobe,modules-load}.d/rc.conf
|
|
} |