misc-post.sh 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/bin/sh
  2. # Set IP address again (besides action in udev rules); this is needed by
  3. # DispVM (to override DispVM-template IP) and in case when qubes_ip was
  4. # called by udev before loading evtchn kernel module - in which case
  5. # xenstore-read fails
  6. INTERFACE=eth0 /usr/lib/qubes/setup_ip
  7. if [ -e /dev/xvdb ] ; then
  8. mount /rw
  9. if ! [ -d /rw/home ] ; then
  10. echo
  11. echo "--> Virgin boot of the VM: Linking /home to /rw/home"
  12. mkdir -p /rw/config
  13. touch /rw/config/rc.local
  14. mkdir -p /rw/home
  15. cp -a /home.orig/user /home
  16. mkdir -p /rw/usrlocal
  17. cp -a /usr/local.orig/* /usr/local
  18. touch /var/lib/qubes/first_boot_completed
  19. fi
  20. fi
  21. [ -x /rw/config/rc.local ] && /rw/config/rc.local
  22. if ! [ -f /home/user/.gnome2/nautilus-scripts/.scripts_created ] ; then
  23. echo "Creating symlinks for nautilus actions..."
  24. su user -c 'mkdir -p /home/user/.gnome2/nautilus-scripts'
  25. su user -c 'ln -s /usr/lib/qubes/qvm-copy-to-vm.gnome /home/user/.gnome2/nautilus-scripts/"Copy to other AppVM"'
  26. su user -c 'ln -s /usr/bin/qvm-open-in-dvm /home/user/.gnome2/nautilus-scripts/"Open in DisposableVM"'
  27. su user -c 'touch /home/user/.gnome2/nautilus-scripts/.scripts_created'
  28. fi
  29. if ! [ -f /home/user/.gnome2/nautilus-scripts/.scripts_created2 ] ; then
  30. # as we have recently renamed tools, the symlinks would need to be fixed for older templates
  31. su user -c 'ln -sf /usr/lib/qubes/qvm-copy-to-vm.gnome /home/user/.gnome2/nautilus-scripts/"Copy to other AppVM"'
  32. su user -c 'ln -sf /usr/bin/qvm-open-in-dvm /home/user/.gnome2/nautilus-scripts/"Open in DisposableVM"'
  33. su user -c 'touch /home/user/.gnome2/nautilus-scripts/.scripts_created2'
  34. fi
  35. # Start services which haven't own proper systemd unit:
  36. # Start AppVM specific services
  37. if [ ! -f /etc/systemd/system/cups.service ]; then
  38. if [ -f /var/run/qubes-service/cups ]; then
  39. /sbin/service cups start
  40. # Allow also notification icon
  41. sed -i -e '/^NotShowIn=.*QUBES/s/;QUBES//' /etc/xdg/autostart/print-applet.desktop
  42. else
  43. # Disable notification icon
  44. sed -i -e '/QUBES/!s/^NotShowIn=.*/\1QUBES;/' /etc/xdg/autostart/print-applet.desktop
  45. fi
  46. fi
  47. exit 0