aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Thomsen <oss@cogitri.dev>2020-06-06 10:01:37 +0200
committerRasmus Thomsen <oss@cogitri.dev>2020-06-07 14:11:31 +0200
commite100ed3cd39722e6106eec18b7c33c61a3b86c59 (patch)
tree2200b94fc612dc9550019e629ab8748b520cf56d
parentd6931444cc061febbdba88842500730bcdd1a5f8 (diff)
downloadaports-e100ed3cd39722e6106eec18b7c33c61a3b86c59.tar.gz
aports-e100ed3cd39722e6106eec18b7c33c61a3b86c59.tar.bz2
aports-e100ed3cd39722e6106eec18b7c33c61a3b86c59.tar.xz
community/qemu: run pre-install as pre-upgrade hook so users are created during upgrade
We introduced a new user in qemu previously with 2f32bfc751bae19369fc06666e8f4b2ce88d17fd, but that user is only ever created when qemu is installed from scratch and not when upgrading an exisiting qemu installation. This broke upgrading from 3.11 -> 3.12 where we expect the qemu user to be available in 3.12 but it wasn't unless you removed and installed qemu again. Also redirect the stderr of adduser to /dev/null so users don't see "adduser: user 'qemu' in use" during upgrades. fixes #11618
-rw-r--r--community/qemu/APKBUILD4
-rw-r--r--community/qemu/qemu.pre-install2
l---------community/qemu/qemu.pre-upgrade1
3 files changed, 4 insertions, 3 deletions
diff --git a/community/qemu/APKBUILD b/community/qemu/APKBUILD
index 0947e58393..7cd4366c20 100644
--- a/community/qemu/APKBUILD
+++ b/community/qemu/APKBUILD
@@ -4,7 +4,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=qemu
pkgver=5.0.0
-pkgrel=1
+pkgrel=2
pkgdesc="QEMU is a generic machine emulator and virtualizer"
url="https://qemu.org/"
arch="all"
@@ -50,7 +50,7 @@ makedepends="
zlib-static
"
pkggroups="qemu"
-install="$pkgname.pre-install $pkgname.post-install"
+install="$pkgname.pre-install $pkgname.post-install $pkgname.pre-upgrade"
# suid needed for qemu-bridge-helper
# strip fails on .img files
# some tests does not run on our builders
diff --git a/community/qemu/qemu.pre-install b/community/qemu/qemu.pre-install
index 19ed30d902..8f4c8a6ba1 100644
--- a/community/qemu/qemu.pre-install
+++ b/community/qemu/qemu.pre-install
@@ -2,6 +2,6 @@
addgroup -S -g 34 kvm 2>/dev/null
addgroup -S -g 36 qemu 2>/dev/null
-adduser -S -u 36 -G kvm -s /sbin/nologin qemu
+adduser -S -u 36 -G kvm -s /sbin/nologin qemu 2>/dev/null
exit 0
diff --git a/community/qemu/qemu.pre-upgrade b/community/qemu/qemu.pre-upgrade
new file mode 120000
index 0000000000..2241ed2f37
--- /dev/null
+++ b/community/qemu/qemu.pre-upgrade
@@ -0,0 +1 @@
+qemu.pre-install \ No newline at end of file