startup-dvm.sh 831 B

123456789101112131415161718192021222324
  1. #!/bin/sh
  2. # Setup DispVM things at Qubes system startup
  3. printf "\x00\x00\x00\x00" > /var/run/qubes/dispVM.seq
  4. chown root:qubes /var/run/qubes/dispVM.seq
  5. chmod 660 /var/run/qubes/dispVM.seq
  6. DEFAULT=/var/lib/qubes/dvmdata/default-savefile
  7. DEFAULT_CONFIG=/var/lib/qubes/dvmdata/default-dvm.conf
  8. # setup DispVM files only when they exists
  9. if [ -r $DEFAULT ]; then
  10. ln -s $DEFAULT_CONFIG /var/run/qubes/current-dvm.conf
  11. if [ -f /var/lib/qubes/dvmdata/dont-use-shm ] ; then
  12. ln -s $DEFAULT /var/run/qubes/current-savefile
  13. else
  14. mkdir -m 770 /dev/shm/qubes
  15. chown root.qubes /dev/shm/qubes
  16. cp -a $(readlink $DEFAULT) /dev/shm/qubes/current-savefile
  17. chown root.qubes /dev/shm/qubes/current-savefile
  18. chmod 660 /dev/shm/qubes/current-savefile
  19. ln -s /dev/shm/qubes/current-savefile /var/run/qubes/current-savefile
  20. fi
  21. fi