misc-post.sh 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 ] ; 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. mkdir -p /rw/home
  20. cp -a /home.orig/user /home
  21. mkdir -p /rw/usrlocal
  22. cp -a /usr/local.orig/* /usr/local
  23. touch /var/lib/qubes/first_boot_completed
  24. fi
  25. fi
  26. [ -x /rw/config/rc.local ] && /rw/config/rc.local
  27. if ! [ -f /home/user/.gnome2/nautilus-scripts/.scripts_created ] ; then
  28. echo "Creating symlinks for nautilus actions..."
  29. su user -c 'mkdir -p /home/user/.gnome2/nautilus-scripts'
  30. su user -c 'ln -s /usr/lib/qubes/qvm-copy-to-vm.gnome /home/user/.gnome2/nautilus-scripts/"Copy to other AppVM"'
  31. su user -c 'ln -s /usr/bin/qvm-open-in-dvm /home/user/.gnome2/nautilus-scripts/"Open in DisposableVM"'
  32. su user -c 'touch /home/user/.gnome2/nautilus-scripts/.scripts_created'
  33. fi
  34. if ! [ -f /home/user/.gnome2/nautilus-scripts/.scripts_created2 ] ; then
  35. # as we have recently renamed tools, the symlinks would need to be fixed for older templates
  36. su user -c 'ln -sf /usr/lib/qubes/qvm-copy-to-vm.gnome /home/user/.gnome2/nautilus-scripts/"Copy to other AppVM"'
  37. su user -c 'ln -sf /usr/bin/qvm-open-in-dvm /home/user/.gnome2/nautilus-scripts/"Open in DisposableVM"'
  38. su user -c 'touch /home/user/.gnome2/nautilus-scripts/.scripts_created2'
  39. fi
  40. # Start services which haven't own proper systemd unit:
  41. # Start AppVM specific services
  42. if [ ! -f /etc/systemd/system/cups.service ]; then
  43. if [ -f /var/run/qubes-service/cups ]; then
  44. /sbin/service cups start
  45. # Allow also notification icon
  46. sed -i -e '/^NotShowIn=.*QUBES/s/;QUBES//' /etc/xdg/autostart/print-applet.desktop
  47. else
  48. # Disable notification icon
  49. sed -i -e '/QUBES/!s/^NotShowIn=.*/\1QUBES;/' /etc/xdg/autostart/print-applet.desktop
  50. fi
  51. fi
  52. exit 0