diff --git a/misc/fstab b/misc/fstab index b7d0fee..8012120 100644 --- a/misc/fstab +++ b/misc/fstab @@ -8,6 +8,7 @@ # /dev/mapper/dmroot / ext4 defaults,noatime 1 1 /dev/xvdb /rw ext4 noauto,defaults 1 2 +/rw/home /home none noauto,bind,defaults 0 0 /dev/xvdc1 swap swap defaults 0 0 tmpfs /dev/shm tmpfs defaults 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 diff --git a/vm-init.d/qubes_core b/vm-init.d/qubes_core index 4830587..b3927fd 100755 --- a/vm-init.d/qubes_core +++ b/vm-init.d/qubes_core @@ -65,14 +65,19 @@ start() touch /rw/config/rc.local mkdir -p /rw/home - cp -a /home.orig/user /home + cp -a /home.orig/user /rw/home mkdir -p /rw/usrlocal - cp -a /usr/local.orig/* /usr/local + cp -a /usr/local.orig/* /rw/usrlocal touch /var/lib/qubes/first_boot_completed fi fi + if [ -L /home ]; then + rm /home + mkdir /home + fi + mount /home /usr/lib/qubes/qrexec_agent 2>/var/log/qubes/qrexec_agent.log & diff --git a/vm-init.d/qubes_core_appvm b/vm-init.d/qubes_core_appvm index a0cfe06..6e851d1 100755 --- a/vm-init.d/qubes_core_appvm +++ b/vm-init.d/qubes_core_appvm @@ -45,7 +45,11 @@ start() echo -n $"Executing Qubes Core scripts for AppVM:" if xenstore-read qubes_save_request 2>/dev/null ; then - ln -sf /home_volatile /home + if [ -L /home ]; then + rm /home + mkdir /home + fi + mount --bind /home_volatile /home touch /etc/this_is_dvm mount /rw possibly_run_save_script diff --git a/vm-systemd/misc-post.sh b/vm-systemd/misc-post.sh index df4c8a4..cbd0c63 100755 --- a/vm-systemd/misc-post.sh +++ b/vm-systemd/misc-post.sh @@ -24,18 +24,23 @@ if [ -e /dev/xvdb -a ! -e /etc/this_is_dvm ] ; then touch /rw/config/rc.local-early mkdir -p /rw/home - cp -a /home.orig/user /home + cp -a /home.orig/user /rw/home mkdir -p /rw/usrlocal - cp -a /usr/local.orig/* /usr/local + cp -a /usr/local.orig/* /rw/usrlocal touch /var/lib/qubes/first_boot_completed fi # Chown home if user UID have changed - can be the case on template switch - HOME_USER_UID=`ls -dn /home/user | awk '{print $3}'` + HOME_USER_UID=`ls -dn /rw/home/user | awk '{print $3}'` if [ "`id -u user`" -ne "$HOME_USER_UID" ]; then - find /home/user -uid "$HOME_USER_UID" -print0 | xargs -0 chown user:user + find /rw/home/user -uid "$HOME_USER_UID" -print0 | xargs -0 chown user:user fi + if [ -L /home ]; then + rm /home + mkdir /home + fi + mount /home fi [ -x /rw/config/rc.local ] && /rw/config/rc.local diff --git a/vm-systemd/prepare-dvm.sh b/vm-systemd/prepare-dvm.sh index 2229afc..ae57829 100755 --- a/vm-systemd/prepare-dvm.sh +++ b/vm-systemd/prepare-dvm.sh @@ -13,7 +13,11 @@ possibly_run_save_script() } if xenstore-read qubes_save_request 2>/dev/null ; then - ln -sf /home_volatile /home + if [ -L /home ]; then + rm /home + mkdir /home + fi + mount --bind /home_volatile /home touch /etc/this_is_dvm mount /rw possibly_run_save_script