2012-01-10 12:10:16 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2014-09-27 01:52:19 +02:00
|
|
|
if [ -f /var/run/qubes-service/yum-proxy-setup -o -f /var/run/qubes-service/updates-proxy-setup ]; then
|
2014-09-30 00:36:53 +02:00
|
|
|
if [ -d /etc/apt/apt.conf.d ]; then
|
2014-10-24 00:45:39 +02:00
|
|
|
echo 'Acquire::http::Proxy "http://10.137.255.254:8082/";' >> /etc/apt/apt.conf.d/01qubes-proxy
|
2014-09-30 00:36:53 +02:00
|
|
|
fi
|
|
|
|
if [ -d /etc/yum.conf.d ]; then
|
|
|
|
echo proxy=http://10.137.255.254:8082/ > /etc/yum.conf.d/qubes-proxy.conf
|
|
|
|
fi
|
2012-05-31 02:37:53 +02:00
|
|
|
else
|
2014-09-30 00:36:53 +02:00
|
|
|
if [ -d /etc/apt/apt.conf.d ]; then
|
|
|
|
rm -f /etc/apt/apt.conf.d/01qubes-proxy
|
|
|
|
fi
|
|
|
|
if [ -d /etc/yum.conf.d ]; then
|
|
|
|
echo > /etc/yum.conf.d/qubes-proxy.conf
|
|
|
|
fi
|
2012-05-31 02:37:53 +02:00
|
|
|
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
|
2013-06-07 05:20:55 +02:00
|
|
|
# qubesdb-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"
|
2014-09-05 22:42:14 +02:00
|
|
|
tune2fs -m 0 /dev/xvdb
|
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
|
2014-10-19 04:11:15 +02:00
|
|
|
/usr/sbin/service cups start
|
2012-01-10 12:10:16 +01:00
|
|
|
# Allow also notification icon
|
|
|
|
sed -i -e '/^NotShowIn=.*QUBES/s/;QUBES//' /etc/xdg/autostart/print-applet.desktop
|
|
|
|
else
|
|
|
|
# Disable notification icon
|
2014-11-30 16:43:11 +01:00
|
|
|
sed -i -e '/QUBES/!s/^NotShowIn=\(.*\)/NotShowIn=QUBES;\1/' /etc/xdg/autostart/print-applet.desktop
|
2012-01-10 12:10:16 +01:00
|
|
|
fi
|
|
|
|
fi
|
2014-05-30 22:44:50 +02:00
|
|
|
if [ -f /var/run/qubes-service/network-manager ]; then
|
|
|
|
# Allow also notification icon
|
|
|
|
sed -i -e '/QUBES/!s/^OnlyShowIn=.*/\0QUBES;/' /etc/xdg/autostart/nm-applet.desktop
|
2014-07-04 18:47:11 +02:00
|
|
|
sed -i -e '/^NotShowIn=.*/s/QUBES;//' /etc/xdg/autostart/nm-applet.desktop
|
2014-05-30 22:44:50 +02:00
|
|
|
else
|
|
|
|
# Disable notification icon
|
|
|
|
sed -i -e '/^OnlyShowIn=.*/s/QUBES;//' /etc/xdg/autostart/nm-applet.desktop
|
2014-07-04 18:47:11 +02:00
|
|
|
sed -i -e '/QUBES/!s/^NotShowIn=.*/\0QUBES;/' /etc/xdg/autostart/nm-applet.desktop
|
2014-05-30 22:44:50 +02:00
|
|
|
fi
|
2012-01-10 12:10:16 +01:00
|
|
|
|
|
|
|
exit 0
|