setup-dvm-home.sh 756 B

12345678910111213141516171819202122
  1. #!/bin/sh
  2. # Source Qubes library.
  3. . /usr/lib/qubes/init/functions
  4. echo "Setting up DVM home" >&2
  5. touch /etc/this-is-dvm
  6. # If the user has customized DispVM settings, use its home instead of default skel
  7. [ -e /home_volatile/user/.qubes-dispvm-customized ] && already_customized=yes || already_customized=no
  8. [ -e /rw/home/user/.qubes-dispvm-customized ] && wants_customization=yes || wants_customization=no
  9. if [ "$wants_customization" = "yes" ] ; then
  10. if [ "$already_customized" = "no" ] ; then
  11. echo "Customizing /home from /rw/home/user" >&2
  12. rm -rf /home_volatile/user
  13. cp -af /rw/home/user /home_volatile/user
  14. chown -R user.user /home_volatile/user
  15. fi
  16. else
  17. initialize_home "/home_volatile" unconditionally
  18. fi