vm/dispvm: use of user-provided DispVM settings (#651)

When /rw/home/user/.qubes-dispvm-customized is present use /rw/home/user
instead of default /etc/dispvm-dotfiles.tbz. Also make sure that /rw will not
remain mounted during DispVM creation.
This commit is contained in:
Marek Marczykowski 2012-11-12 13:44:10 +01:00
parent dff1d426df
commit ef2a3092ac
4 changed files with 18 additions and 5 deletions

View File

@ -2,7 +2,12 @@
apps="evince /usr/libexec/evinced soffice firefox"
cat /etc/dispvm-dotfiles.tbz | tar -xjf- --overwrite -C /home/user --owner user 2>&1 >/tmp/dispvm-dotfiles-errors.log
#If user have customized DispVM settings, use its home instead of default dotfiles
if [ -e /rw/home/user/.qubes-dispvm-customized ]; then
cp -af /rw/home/user /home/
else
cat /etc/dispvm-dotfiles.tbz | tar -xjf- --overwrite -C /home/user --owner user 2>&1 >/tmp/dispvm-dotfiles-errors.log
fi
for app in $apps ; do
echo "Launching: $app..."
@ -22,6 +27,10 @@ done
ps ax > /tmp/dispvm-prerun-proclist.log
cat /etc/dispvm-dotfiles.tbz | tar -xjf- --overwrite -C /home/user --owner user 2>&1 >>/tmp/dispvm-dotfiles-errors.log
if [ -e /rw/home/user/.qubes-dispvm-customized ]; then
cp -af /rw/home/user /home/
else
cat /etc/dispvm-dotfiles.tbz | tar -xjf- --overwrite -C /home/user --owner user 2>&1 >>/tmp/dispvm-dotfiles-errors.log
fi
echo done.

View File

@ -46,8 +46,10 @@ start()
if xenstore-read qubes_save_request 2>/dev/null ; then
ln -sf /home_volatile /home
possibly_run_save_script
touch /etc/this_is_dvm
mount /rw
possibly_run_save_script
umount /rw
dmesg -c >/dev/null
free | grep Mem: |
(read a b c d ; xenstore-write device/qubes_used_mem $c)

View File

@ -12,7 +12,7 @@ fi
# xenstore-read fails
INTERFACE=eth0 /usr/lib/qubes/setup_ip
if [ -e /dev/xvdb ] ; then
if [ -e /dev/xvdb -a ! -e /etc/this_is_dvm ] ; then
mount /rw
if ! [ -d /rw/home ] ; then

View File

@ -14,8 +14,10 @@ possibly_run_save_script()
if xenstore-read qubes_save_request 2>/dev/null ; then
ln -sf /home_volatile /home
possibly_run_save_script
touch /etc/this_is_dvm
mount /rw
possibly_run_save_script
umount /rw
dmesg -c >/dev/null
free | grep Mem: |
(read a b c d ; xenstore-write device/qubes_used_mem $c)