misc-post.sh 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. mount /rw
  14. if ! [ -d /rw/home ] ; then
  15. echo
  16. echo "--> Virgin boot of the VM: Linking /home to /rw/home"
  17. mkdir -p /rw/config
  18. touch /rw/config/rc.local
  19. touch /rw/config/rc.local-early
  20. mkdir -p /rw/home
  21. cp -a /home.orig/user /rw/home
  22. mkdir -p /rw/usrlocal
  23. cp -a /usr/local.orig/* /rw/usrlocal
  24. touch /var/lib/qubes/first-boot-completed
  25. fi
  26. # Chown home if user UID have changed - can be the case on template switch
  27. HOME_USER_UID=`ls -dn /rw/home/user | awk '{print $3}'`
  28. if [ "`id -u user`" -ne "$HOME_USER_UID" ]; then
  29. find /rw/home/user -uid "$HOME_USER_UID" -print0 | xargs -0 chown user:user
  30. fi
  31. if [ -L /home ]; then
  32. rm /home
  33. mkdir /home
  34. fi
  35. mount /home
  36. fi
  37. [ -x /rw/config/rc.local ] && /rw/config/rc.local
  38. # Start services which haven't own proper systemd unit:
  39. # Start AppVM specific services
  40. if [ ! -f /etc/systemd/system/cups.service ]; then
  41. if [ -f /var/run/qubes-service/cups ]; then
  42. /sbin/service cups start
  43. # Allow also notification icon
  44. sed -i -e '/^NotShowIn=.*QUBES/s/;QUBES//' /etc/xdg/autostart/print-applet.desktop
  45. else
  46. # Disable notification icon
  47. sed -i -e '/QUBES/!s/^NotShowIn=.*/\1QUBES;/' /etc/xdg/autostart/print-applet.desktop
  48. fi
  49. fi
  50. exit 0