kvmd.install: Don't apply config patches again

This commit is contained in:
Maxim Devaev 2024-02-05 16:45:51 +02:00
parent af9c2f1f59
commit c45d19c98e

View File

@ -1,9 +1,12 @@
# shellcheck disable=SC2148
# arg 1: the new package version
post_install() {
post_upgrade
post_upgrade "$1" ""
}
# arg 1: the new package version
# arg 2: the old package version
post_upgrade() {
echo "==> Ensuring KVMD users and groups ..."
systemd-sysusers /usr/lib/sysusers.d/kvmd.conf
@ -52,6 +55,8 @@ post_upgrade() {
done
echo "==> Patching configs ..."
if [[ "$(vercmp "$1" 3.301)" -lt 0 ]]; then
[ ! -f /etc/fstab ] || (sed -i -e "s|,data=journal||g" /etc/fstab && touch -t 200701011000 /etc/fstab)
[ ! -f /etc/fstab ] || (sed -i -e "/tmpfs \/run\s/d" /etc/fstab && touch -t 200701011000 /etc/fstab)
[ ! -f /etc/pacman.conf ] || sed -i -e "s|^Server = https://pikvm.org/repos/|Server = https://files.pikvm.org/repos/arch/|g" /etc/pacman.conf
@ -61,6 +66,7 @@ post_upgrade() {
[ ! -f /etc/pam.d/system-login ] || sed -i -e '/\<pam_systemd\.so\>/ s/^#*/#/' /etc/pam.d/system-login
[ ! -f /etc/pam.d/system-auth ] || sed -i -e '/\<pam_systemd_home\.so\>/ s/^#*/#/' /etc/pam.d/system-auth
[ -e /etc/systemd/network/99-default.link ] || ln -s /dev/null /etc/systemd/network/99-default.link
fi
# Some update deletes /etc/motd, WTF
# shellcheck disable=SC2015,SC2166