From e0a00899cf760933ba089c56b00765f5064109b8 Mon Sep 17 00:00:00 2001 From: Olivier MEDOC Date: Mon, 3 Feb 2014 20:10:36 +0100 Subject: [PATCH] archlinux: fixes in package uninstall trigger and disable additionnal qubes services --- archlinux/PKGBUILD | 2 +- archlinux/PKGBUILD.install | 36 +++++++++++++++++++++++++++++------- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/archlinux/PKGBUILD b/archlinux/PKGBUILD index 4b2179f..74c5304 100644 --- a/archlinux/PKGBUILD +++ b/archlinux/PKGBUILD @@ -6,7 +6,7 @@ # Maintainer: Olivier Medoc 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") diff --git a/archlinux/PKGBUILD.install b/archlinux/PKGBUILD.install index 1a9f098..19e9c71 100644 --- a/archlinux/PKGBUILD.install +++ b/archlinux/PKGBUILD.install @@ -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 }