archlinux: fixes in package uninstall trigger and disable additionnal qubes services

This commit is contained in:
Olivier MEDOC 2014-02-03 20:10:36 +01:00 committed by Marek Marczykowski-Górecki
parent 6757337bd3
commit e0a00899cf
2 changed files with 30 additions and 8 deletions

View File

@ -6,7 +6,7 @@
# Maintainer: Olivier Medoc <o_medoc@yahoo.fr>
pkgname=qubes-vm-core
pkgver=`cat version`
pkgrel=14
pkgrel=16
epoch=
pkgdesc="The Qubes core files for installation inside a Qubes VM."
arch=("x86_64")

View File

@ -169,6 +169,11 @@ pre_install() {
mkdir -p /var/lib/qubes
# Backup fstab
if [ -e /etc/fstab ] ; then
mv /etc/fstab /var/lib/qubes/fstab.orig
fi
# Add qubes core related fstab entries
echo "xen /proc/xen xenfs defaults 0 0" >> /etc/fstab
echo "/dev/xvdi /mnt/removable auto noauto,user,rw 0 0" >> /etc/fstab
@ -189,9 +194,10 @@ update_qubesconfig
update_systemd
# do the rest of %post thing only when updating for the first time...
if [ -e /etc/init/serial.conf ] && ! [ -f /var/lib/qubes/serial.orig ] ; then
cp /etc/init/serial.conf /var/lib/qubes/serial.orig
fi
# Note: serial console wont work this way on archlinux. Maybe better using systemd ?
#if [ -e /etc/init/serial.conf ] && ! [ -f /var/lib/qubes/serial.orig ] ; then
# cp /etc/init/serial.conf /var/lib/qubes/serial.orig
#fi
# SELinux is not enabled on archlinux
# echo "--> Disabling SELinux..."
@ -223,13 +229,29 @@ pre_upgrade() {
## arg 1: the old package version
#pre_remove() {
#
#}
pre_remove() {
# no more packages left
if [ -e /var/lib/qubes/fstab.orig ] ; then
mv /var/lib/qubes/fstab.orig /etc/fstab
fi
mv /var/lib/qubes/removed-udev-scripts/* /etc/udev/rules.d/
if [ -e /var/lib/qubes/serial.orig ] ; then
mv /var/lib/qubes/serial.orig /etc/init/serial.conf
fi
}
## arg 1: the old package version
post_remove() {
for srv in qubes-dvm qubes-sysinit qubes-misc-post qubes-netwatcher qubes-network qubes-qrexec-agent; do
/usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas &> /dev/null || :
if [ -L /lib/firmware/updates ] ; then
rm /lib/firmware/updates
fi
for srv in qubes-dvm qubes-sysinit qubes-misc-post qubes-netwatcher qubes-network qubes-firewall qubes-qrexec-agent qubes-update-check qubes-yum-proxy qubes-meminfo-writer; do
systemctl disable $srv.service
done
}