From 051d806f0a52c7dd9134ffb5fa39dc66e3885896 Mon Sep 17 00:00:00 2001 From: Olivier MEDOC Date: Mon, 11 Jul 2016 15:15:45 +0200 Subject: [PATCH 1/3] archlinux: update installer script in prevision of pacman.d drop-ins --- archlinux/PKGBUILD.install | 57 ++++++++++++++++++++++++++++++++------ 1 file changed, 48 insertions(+), 9 deletions(-) diff --git a/archlinux/PKGBUILD.install b/archlinux/PKGBUILD.install index 4233c9a..765f497 100644 --- a/archlinux/PKGBUILD.install +++ b/archlinux/PKGBUILD.install @@ -212,12 +212,59 @@ APPENDLINE=$3 grep -q "$APPENDLINE" "$FILE" || sed "/$APPENDAFTERLINE/a$APPENDLINE" -i "$FILE" } +config_cleanupmark() { +FILE="$1" +BEGINMARK="$2" +ENDMARK="$3" +if grep -q "$BEGINMARK" "$FILE"; then + if grep -q "$ENDMARK" "$FILE"; then + cp "$FILE" "$FILE.qubes-update-orig" + sed -i -e "/^$BEGINMARK\$/,/^$ENDMARK\$/{ + /^$ENDMARK\$/b + /^$BEGINMARK$/!d + }" "$FILE" + rm -f "$FILE.qubes-update-orig" + else + echo "ERROR: found $BEGINMARK marker but not $ENDMARK in $FILE. Please cleanup this file manually." + fi +elif grep -q "$ENDMARK" "$FILE"; then + echo "ERROR: found $ENDMARK marker but not $BEGINMARK in $FILE. Please cleanup this file manually." +fi +} + update_finalize() { # Archlinux specific: Prepare pacman.conf to add qubes specific config QUBES_MARKER="### QUBES CONFIG MARKER ###" config_prependtomark "/etc/pacman.conf" "# REPOSITORIES" "$QUBES_MARKER" + # Ensure pam.d will not be modified by archlinux package updates + config_appendtomark '/etc/pacman.conf' "$QUBES_MARKER" 'NoUpgrade = etc/pam.d/su' + config_appendtomark '/etc/pacman.conf' "$QUBES_MARKER" 'NoUpgrade = etc/pam.d/su-l' + + # Add Qubes setup script markers at the right place (this won't work at the end of pacman.conf)" + config_appendtomark "/etc/pacman.conf" "$QUBES_MARKER" "### QUBES END ###" + config_appendtomark "/etc/pacman.conf" "$QUBES_MARKER" "### QUBES BEGIN ###" + + + ## Archlinux specific: Cleanup pre pacman.d qubes marker + ## Commented out until pacman.d snipped are supported + #QUBES_MARKER="### QUBES CONFIG MARKER ###" + #if grep -q "$QUBES_MARKER" /etc/pacman.conf; then + # if ! grep -q "### QUBES CONFIG END MARKER ###" /etc/pacman.conf; then + # # Perform cleanup before continuing + # config_prependtomark "/etc/pacman.conf" "# REPOSITORIES" "### QUBES CONFIG END MARKER ###" + # config_cleanupmark "/etc/pacman.conf" "$QUBES_MARKER" "### QUBES CONFIG END MARKER ###" + # fi + #fi + #config_prependtomark "/etc/pacman.conf" "# REPOSITORIES" "$QUBES_MARKER" + #config_prependtomark "/etc/pacman.conf" "# REPOSITORIES" "### QUBES CONFIG END MARKER ###" + # + ## Add qubes includes + #config_appendtomark "/etc/pacman.conf" "$QUBES_MARKER" "Include /etc/pacman.d/qubes-noupdate.conf" + #config_appendtomark "/etc/pacman.conf" "$QUBES_MARKER" "Include /etc/pacman.d/qubes-updateproxy.conf" + #config_prependtomark "/etc/pacman.conf" "### QUBES CONFIG END MARKER ###" "Include /etc/pacman.d/qubes-repositories.conf" + # Archlinux specific: Update pam.d configuration for su to enable systemd-login wrapper # Also remove pam_unix.so from su configuration # as system-login (which include system-auth) already gives pam_unix.so @@ -237,20 +284,12 @@ account include system-login session include system-login EOF cp /etc/pam.d/su /etc/pam.d/su-l - - echo "Ensure pam.d will not be modified by archlinux package updates" - config_appendtomark '/etc/pacman.conf' "$QUBES_MARKER" 'NoUpgrade = etc/pam.d/su' - config_appendtomark '/etc/pacman.conf' "$QUBES_MARKER" 'NoUpgrade = etc/pam.d/su-l' fi # Archlinux specific: ensure tty1 is enabled rm -f /etc/systemd/system/getty.target.wants/getty@tty*.service systemctl enable getty\@tty1.service - - # Add Qubes setup script markers at the right place (this won't work at the end of pacman.conf)" - config_appendtomark "/etc/pacman.conf" "$QUBES_MARKER" "### QUBES END ###" - config_appendtomark "/etc/pacman.conf" "$QUBES_MARKER" "### QUBES BEGIN ###" - + systemctl daemon-reload } From c82b82d7b46165326c97062249649c1afe3a8012 Mon Sep 17 00:00:00 2001 From: Olivier MEDOC Date: Mon, 11 Jul 2016 15:29:31 +0200 Subject: [PATCH 2/3] archlinux: provide automatic qubes-trigger-sync-appmenus through pacman hooks --- archlinux/PKGBUILD | 10 +++++++--- archlinux/PKGBUILD.qubes-update-desktop-icons.hook | 11 +++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 archlinux/PKGBUILD.qubes-update-desktop-icons.hook diff --git a/archlinux/PKGBUILD b/archlinux/PKGBUILD index b34452e..36eff5d 100644 --- a/archlinux/PKGBUILD +++ b/archlinux/PKGBUILD @@ -6,7 +6,7 @@ # Maintainer: Olivier Medoc pkgname=qubes-vm-core pkgver=`cat version` -pkgrel=6 +pkgrel=7 epoch= pkgdesc="The Qubes core files for installation inside a Qubes VM." arch=("x86_64") @@ -25,10 +25,10 @@ options=() install=PKGBUILD.install changelog= -source=(PKGBUILD.qubes-ensure-lib-modules.service) +source=(PKGBUILD.qubes-ensure-lib-modules.service PKGBUILD.qubes-update-desktop-icons.hook) noextract=() -md5sums=('88f4b3d5b156888a9d38f5bc28702ab8') #generate with 'makepkg -g' +md5sums=('88f4b3d5b156888a9d38f5bc28702ab8' 'bbfb946d6d2787e5abf8e2236502a3d4') build() { @@ -78,6 +78,10 @@ package() { # Install systemd script allowing to automount /lib/modules install -m 644 $srcdir/PKGBUILD.qubes-ensure-lib-modules.service ${pkgdir}/usr/lib/systemd/system/qubes-ensure-lib-modules.service + # Install pacman hook to update desktop icons + mkdir -p ${pkgdir}/usr/share/libalpm/hooks/ + install -m 644 $srcdir/PKGBUILD.qubes-update-desktop-icons.hook ${pkgdir}/usr/share/libalpm/hooks/qubes-update-desktop-icons.hook + # Archlinux specific: enable autologin on tty1 mkdir -p $pkgdir/etc/systemd/system/getty@tty1.service.d/ cat < $pkgdir/etc/systemd/system/getty@tty1.service.d/autologin.conf diff --git a/archlinux/PKGBUILD.qubes-update-desktop-icons.hook b/archlinux/PKGBUILD.qubes-update-desktop-icons.hook new file mode 100644 index 0000000..0501566 --- /dev/null +++ b/archlinux/PKGBUILD.qubes-update-desktop-icons.hook @@ -0,0 +1,11 @@ +[Trigger] +Type = File +Operation = Install +Operation = Upgrade +Operation = Remove +Target = usr/share/applications/*.desktop + +[Action] +Description = Updating the Qubes desktop file App Icons... +When = PostTransaction +Exec = /usr/lib/qubes/qubes-trigger-sync-appmenus.sh From 245c6d1716487055b4fff5be4a68f79f4daa67d8 Mon Sep 17 00:00:00 2001 From: Olivier MEDOC Date: Mon, 11 Jul 2016 15:32:36 +0200 Subject: [PATCH 3/3] archlinux: remove unnecessary glib-compile-scheme This is now automatically handled through pacman hooks --- archlinux/PKGBUILD.install | 6 ------ 1 file changed, 6 deletions(-) diff --git a/archlinux/PKGBUILD.install b/archlinux/PKGBUILD.install index 765f497..a8177c3 100644 --- a/archlinux/PKGBUILD.install +++ b/archlinux/PKGBUILD.install @@ -333,8 +333,6 @@ post_install() { configure_systemd 0 update_finalize - - glib-compile-schemas /usr/share/glib-2.0/schemas &> /dev/null || : } @@ -351,8 +349,6 @@ post_upgrade() { update_finalize - /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas &> /dev/null || : - } ###################### @@ -376,8 +372,6 @@ pre_remove() { ## arg 1: the old package version post_remove() { - /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas &> /dev/null || : - if [ -L /lib/firmware/updates ] ; then rm /lib/firmware/updates fi