misc-post.sh 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #!/bin/sh
  2. if [ -f /var/run/qubes-service/yum-proxy-setup ]; then
  3. echo proxy=http://10.137.255.254:8082/ > /etc/yum.conf.d/qubes-proxy.conf
  4. else
  5. echo > /etc/yum.conf.d/qubes-proxy.conf
  6. fi
  7. # Set IP address again (besides action in udev rules); this is needed by
  8. # DispVM (to override DispVM-template IP) and in case when qubes-ip was
  9. # called by udev before loading evtchn kernel module - in which case
  10. # xenstore-read fails
  11. INTERFACE=eth0 /usr/lib/qubes/setup-ip
  12. if [ -e /dev/xvdb -a ! -e /etc/this-is-dvm ] ; then
  13. resize2fs /dev/xvdb 2> /dev/null || echo "'resize2fs /dev/xvdb' failed"
  14. mount /rw
  15. if ! [ -d /rw/home ] ; then
  16. echo
  17. echo "--> Virgin boot of the VM: Linking /home to /rw/home"
  18. mkdir -p /rw/config
  19. touch /rw/config/rc.local
  20. touch /rw/config/rc.local-early
  21. mkdir -p /rw/home
  22. cp -a /home.orig/user /rw/home
  23. mkdir -p /rw/usrlocal
  24. cp -a /usr/local.orig/* /rw/usrlocal
  25. touch /var/lib/qubes/first-boot-completed
  26. fi
  27. # Chown home if user UID have changed - can be the case on template switch
  28. HOME_USER_UID=`ls -dn /rw/home/user | awk '{print $3}'`
  29. if [ "`id -u user`" -ne "$HOME_USER_UID" ]; then
  30. find /rw/home/user -uid "$HOME_USER_UID" -print0 | xargs -0 chown user:user
  31. fi
  32. if [ -L /home ]; then
  33. rm /home
  34. mkdir /home
  35. fi
  36. mount /home
  37. fi
  38. [ -x /rw/config/rc.local ] && /rw/config/rc.local
  39. # Start services which haven't own proper systemd unit:
  40. # Start AppVM specific services
  41. if [ ! -f /etc/systemd/system/cups.service ]; then
  42. if [ -f /var/run/qubes-service/cups ]; then
  43. /sbin/service cups start
  44. # Allow also notification icon
  45. sed -i -e '/^NotShowIn=.*QUBES/s/;QUBES//' /etc/xdg/autostart/print-applet.desktop
  46. else
  47. # Disable notification icon
  48. sed -i -e '/QUBES/!s/^NotShowIn=.*/\1QUBES;/' /etc/xdg/autostart/print-applet.desktop
  49. fi
  50. fi
  51. if [ -f /var/run/qubes-service/network-manager ]; then
  52. # Allow also notification icon
  53. sed -i -e '/QUBES/!s/^OnlyShowIn=.*/\0QUBES;/' /etc/xdg/autostart/nm-applet.desktop
  54. sed -i -e '/^NotShowIn=.*/s/QUBES;//' /etc/xdg/autostart/nm-applet.desktop
  55. else
  56. # Disable notification icon
  57. sed -i -e '/^OnlyShowIn=.*/s/QUBES;//' /etc/xdg/autostart/nm-applet.desktop
  58. sed -i -e '/QUBES/!s/^NotShowIn=.*/\0QUBES;/' /etc/xdg/autostart/nm-applet.desktop
  59. fi
  60. exit 0