dom0: Place DispVM savefile in shm only when exists (#262)

This commit is contained in:
Marek Marczykowski 2011-07-16 02:21:41 +02:00
parent 182e1ccf2b
commit 7c5aa0d3ea

View File

@ -23,17 +23,19 @@ start()
printf "\x00\x00\x00\x00" > /var/run/qubes/dispVM_seq printf "\x00\x00\x00\x00" > /var/run/qubes/dispVM_seq
chown root:qubes /var/run/qubes/dispVM_seq chown root:qubes /var/run/qubes/dispVM_seq
chmod 660 /var/run/qubes/dispVM_seq chmod 660 /var/run/qubes/dispVM_seq
ROOT=/var/lib/qubes/dvmdata/savefile_root
DEFAULT=/var/lib/qubes/dvmdata/default_savefile DEFAULT=/var/lib/qubes/dvmdata/default_savefile
if [ -f /var/lib/qubes/dvmdata/dont_use_shm ] ; then # setup DispVM files only when they exists
ln -s $DEFAULT /var/run/qubes/current_savefile if [ -r $DEFAULT ]; then
else if [ -f /var/lib/qubes/dvmdata/dont_use_shm ] ; then
mkdir -m 770 /dev/shm/qubes ln -s $DEFAULT /var/run/qubes/current_savefile
chown root.qubes /dev/shm/qubes else
cp -a $(readlink $DEFAULT) /dev/shm/qubes/current_savefile mkdir -m 770 /dev/shm/qubes
chown root.qubes /dev/shm/qubes/current_savefile chown root.qubes /dev/shm/qubes
chmod 660 /dev/shm/qubes/current_savefile cp -a $(readlink $DEFAULT) /dev/shm/qubes/current_savefile
ln -s /dev/shm/qubes/current_savefile /var/run/qubes/current_savefile chown root.qubes /dev/shm/qubes/current_savefile
chmod 660 /dev/shm/qubes/current_savefile
ln -s /dev/shm/qubes/current_savefile /var/run/qubes/current_savefile
fi
fi fi
touch /var/lock/subsys/qubes_setupdvm touch /var/lock/subsys/qubes_setupdvm