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).
This commit is contained in:
parent
07967155d5
commit
1328cce87e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user