vm/core: use mount --bind instead of symlink for /home
Many applications doesn't like /home as symlink ($HOME differs from real location).
This commit is contained in:
		
							parent
							
								
									0a6e95225a
								
							
						
					
					
						commit
						2c9fe0803d
					
				| @ -8,6 +8,7 @@ | |||||||
| # | # | ||||||
| /dev/mapper/dmroot /                       ext4 defaults,noatime        1 1 | /dev/mapper/dmroot /                       ext4 defaults,noatime        1 1 | ||||||
| /dev/xvdb		/rw			ext4	noauto,defaults	1 2 | /dev/xvdb		/rw			ext4	noauto,defaults	1 2 | ||||||
|  | /rw/home        /home       none    noauto,bind,defaults 0 0 | ||||||
| /dev/xvdc1      swap                    swap    defaults        0 0 | /dev/xvdc1      swap                    swap    defaults        0 0 | ||||||
| tmpfs                   /dev/shm                tmpfs   defaults        0 0 | tmpfs                   /dev/shm                tmpfs   defaults        0 0 | ||||||
| devpts                  /dev/pts                devpts  gid=5,mode=620  0 0 | devpts                  /dev/pts                devpts  gid=5,mode=620  0 0 | ||||||
|  | |||||||
| @ -65,14 +65,19 @@ start() | |||||||
|             touch /rw/config/rc.local |             touch /rw/config/rc.local | ||||||
| 
 | 
 | ||||||
|             mkdir -p /rw/home |             mkdir -p /rw/home | ||||||
|             cp -a /home.orig/user /home |             cp -a /home.orig/user /rw/home | ||||||
| 
 | 
 | ||||||
|             mkdir -p /rw/usrlocal |             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 |             touch /var/lib/qubes/first_boot_completed | ||||||
|         fi |         fi | ||||||
| 	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 & | 	/usr/lib/qubes/qrexec_agent 2>/var/log/qubes/qrexec_agent.log & | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -45,7 +45,11 @@ start() | |||||||
| 	echo -n $"Executing Qubes Core scripts for AppVM:" | 	echo -n $"Executing Qubes Core scripts for AppVM:" | ||||||
| 
 | 
 | ||||||
| 	if xenstore-read qubes_save_request 2>/dev/null ; then | 	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 | 		touch /etc/this_is_dvm | ||||||
| 		mount /rw | 		mount /rw | ||||||
| 		possibly_run_save_script | 		possibly_run_save_script | ||||||
|  | |||||||
| @ -24,18 +24,23 @@ if [ -e /dev/xvdb -a ! -e /etc/this_is_dvm ] ; then | |||||||
|         touch /rw/config/rc.local-early |         touch /rw/config/rc.local-early | ||||||
| 
 | 
 | ||||||
|         mkdir -p /rw/home |         mkdir -p /rw/home | ||||||
|         cp -a /home.orig/user /home |         cp -a /home.orig/user /rw/home | ||||||
| 
 | 
 | ||||||
|         mkdir -p /rw/usrlocal |         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 |         touch /var/lib/qubes/first_boot_completed | ||||||
|     fi |     fi | ||||||
|     # Chown home if user UID have changed - can be the case on template switch |     # 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 |     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 |     fi | ||||||
|  |     if [ -L /home ]; then | ||||||
|  |         rm /home | ||||||
|  |         mkdir /home | ||||||
|  |     fi | ||||||
|  |     mount /home | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| [ -x /rw/config/rc.local ] && /rw/config/rc.local | [ -x /rw/config/rc.local ] && /rw/config/rc.local | ||||||
|  | |||||||
| @ -13,7 +13,11 @@ possibly_run_save_script() | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| if xenstore-read qubes_save_request 2>/dev/null ; then | 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 |     touch /etc/this_is_dvm | ||||||
|     mount /rw |     mount /rw | ||||||
|     possibly_run_save_script |     possibly_run_save_script | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Marek Marczykowski
						Marek Marczykowski