2012-01-10 12:10:16 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2012-05-31 02:37:53 +02:00
|
|
|
if [ -f /var/run/qubes-service/yum-proxy-setup ]; then
|
|
|
|
echo proxy=http://10.137.255.254:8082/ > /etc/yum.conf.d/qubes-proxy.conf
|
|
|
|
else
|
|
|
|
echo > /etc/yum.conf.d/qubes-proxy.conf
|
|
|
|
fi
|
|
|
|
|
2012-01-10 12:10:16 +01:00
|
|
|
# Set IP address again (besides action in udev rules); this is needed by
|
2013-03-14 04:23:32 +01:00
|
|
|
# DispVM (to override DispVM-template IP) and in case when qubes-ip was
|
2012-01-10 12:10:16 +01:00
|
|
|
# called by udev before loading evtchn kernel module - in which case
|
|
|
|
# xenstore-read fails
|
2013-03-13 02:26:40 +01:00
|
|
|
INTERFACE=eth0 /usr/lib/qubes/setup-ip
|
2012-01-10 12:10:16 +01:00
|
|
|
|
2013-03-13 02:26:40 +01:00
|
|
|
if [ -e /dev/xvdb -a ! -e /etc/this-is-dvm ] ; then
|
2013-11-21 03:36:56 +01:00
|
|
|
resize2fs /dev/xvdb 2> /dev/null || echo "'resize2fs /dev/xvdb' failed"
|
2012-01-10 12:10:16 +01:00
|
|
|
mount /rw
|
|
|
|
|
|
|
|
if ! [ -d /rw/home ] ; then
|
|
|
|
echo
|
|
|
|
echo "--> Virgin boot of the VM: Linking /home to /rw/home"
|
|
|
|
|
|
|
|
mkdir -p /rw/config
|
|
|
|
touch /rw/config/rc.local
|
2012-09-23 23:25:39 +02:00
|
|
|
touch /rw/config/rc.local-early
|
2012-01-10 12:10:16 +01:00
|
|
|
|
|
|
|
mkdir -p /rw/home
|
2012-11-16 14:03:36 +01:00
|
|
|
cp -a /home.orig/user /rw/home
|
2012-01-10 12:10:16 +01:00
|
|
|
|
|
|
|
mkdir -p /rw/usrlocal
|
2012-11-16 14:03:36 +01:00
|
|
|
cp -a /usr/local.orig/* /rw/usrlocal
|
2012-01-10 12:10:16 +01:00
|
|
|
|
2013-03-13 02:26:40 +01:00
|
|
|
touch /var/lib/qubes/first-boot-completed
|
2012-01-10 12:10:16 +01:00
|
|
|
fi
|
2012-06-11 22:33:57 +02:00
|
|
|
# Chown home if user UID have changed - can be the case on template switch
|
2012-11-16 14:03:36 +01:00
|
|
|
HOME_USER_UID=`ls -dn /rw/home/user | awk '{print $3}'`
|
2012-06-11 22:33:57 +02:00
|
|
|
if [ "`id -u user`" -ne "$HOME_USER_UID" ]; then
|
2012-11-16 14:03:36 +01:00
|
|
|
find /rw/home/user -uid "$HOME_USER_UID" -print0 | xargs -0 chown user:user
|
2012-06-11 22:33:57 +02:00
|
|
|
fi
|
2012-11-16 14:03:36 +01:00
|
|
|
if [ -L /home ]; then
|
|
|
|
rm /home
|
|
|
|
mkdir /home
|
|
|
|
fi
|
|
|
|
mount /home
|
2012-01-10 12:10:16 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
[ -x /rw/config/rc.local ] && /rw/config/rc.local
|
|
|
|
|
|
|
|
# Start services which haven't own proper systemd unit:
|
|
|
|
|
|
|
|
# Start AppVM specific services
|
|
|
|
if [ ! -f /etc/systemd/system/cups.service ]; then
|
|
|
|
if [ -f /var/run/qubes-service/cups ]; then
|
|
|
|
/sbin/service cups start
|
|
|
|
# Allow also notification icon
|
|
|
|
sed -i -e '/^NotShowIn=.*QUBES/s/;QUBES//' /etc/xdg/autostart/print-applet.desktop
|
|
|
|
else
|
|
|
|
# Disable notification icon
|
|
|
|
sed -i -e '/QUBES/!s/^NotShowIn=.*/\1QUBES;/' /etc/xdg/autostart/print-applet.desktop
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
exit 0
|