From ec988f9385434bc7d2094595677411ee1b7a2f7d Mon Sep 17 00:00:00 2001 From: Joanna Rutkowska Date: Wed, 15 Sep 2010 15:33:09 +0200 Subject: [PATCH] core-appvm.spec: create 'user' user in %pre instead of in %post ... otherwsie rpm -i throws an error when trying to set permissions for /home_volatile/user, as the user 'user' doesn't exist when the %files section is being processed during rpm install (if this is a first install of the rpm). --- rpm_spec/core-appvm.spec | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rpm_spec/core-appvm.spec b/rpm_spec/core-appvm.spec index 7974e23d..c9a009d1 100644 --- a/rpm_spec/core-appvm.spec +++ b/rpm_spec/core-appvm.spec @@ -45,6 +45,13 @@ The Qubes core files for installation inside a Qubes AppVM. %pre +if [ "$1" != 1 ] ; then +# do this whole %pre thing only when updating for the first time... +exit 0 +fi + +adduser --create-home user + mkdir -p $RPM_BUILD_ROOT/var/lib/qubes if [ -e $RPM_BUILD_ROOT/etc/fstab ] ; then mv $RPM_BUILD_ROOT/etc/fstab $RPM_BUILD_ROOT/var/lib/qubes/fstab.orig @@ -92,7 +99,6 @@ chown 500:500 $RPM_BUILD_ROOT/home_volatile/user %triggerin -- initscripts cp /var/lib/qubes/serial.conf /etc/init/serial.conf - %post if [ "$1" != 1 ] ; then @@ -101,7 +107,6 @@ exit 0 fi usermod -L root -adduser --create-home user usermod -L user if ! [ -f /var/lib/qubes/serial.orig ] ; then cp /etc/init/serial.conf /var/lib/qubes/serial.orig