Remove DisposableVM savefile related files

In Qubes 4.0 we no longer use two-stage DisposableVM startup.
This commit is contained in:
Marek Marczykowski-Górecki 2017-05-29 11:56:42 +02:00
parent 3e7a45b4ac
commit 7e608a8bb4
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
16 changed files with 11 additions and 188 deletions

View File

@ -136,7 +136,6 @@ install-sysvinit: install-init
install vm-init.d/qubes-firewall $(DESTDIR)/etc/init.d/
install vm-init.d/qubes-qrexec-agent $(DESTDIR)/etc/init.d/
install vm-init.d/qubes-updates-proxy $(DESTDIR)/etc/init.d/
install vm-init.d/qubes-dvm $(DESTDIR)/etc/init.d/
install vm-init.d/qubes-updates-proxy-forwarder $(DESTDIR)/etc/init.d/
install -D vm-init.d/qubes-core.modules $(DESTDIR)/etc/sysconfig/modules/qubes-core.modules
install -D vm-init.d/qubes-misc.modules $(DESTDIR)/etc/sysconfig/modules/qubes-misc.modules
@ -205,7 +204,6 @@ install-common:
install -g user -m 2775 -d $(DESTDIR)/var/lib/qubes/dom0-updates
install -D -m 0644 misc/qubes-master-key.asc $(DESTDIR)/usr/share/qubes/qubes-master-key.asc
install misc/dispvm-prerun.sh $(DESTDIR)$(LIBDIR)/qubes/dispvm-prerun.sh
install misc/close-window $(DESTDIR)$(LIBDIR)/qubes/close-window
install misc/upgrades-installed-check $(DESTDIR)$(LIBDIR)/qubes/upgrades-installed-check
@ -303,7 +301,6 @@ endif
install -d $(DESTDIR)/var/run/qubes
install -d $(DESTDIR)/home_volatile/user
install -d $(DESTDIR)/rw
install-deb: install-common install-systemd install-systemd-dropins

View File

@ -475,7 +475,7 @@ post_remove() {
rm -rf /var/lib/qubes/xdg
for srv in qubes-dvm qubes-sysinit qubes-misc-post qubes-mount-dirs qubes-network qubes-qrexec-agent; do
for srv in qubes-sysinit qubes-misc-post qubes-mount-dirs qubes-network qubes-qrexec-agent; do
systemctl disable $srv.service
done

View File

@ -63,7 +63,6 @@ lib/systemd/system/netfilter-persistent.service.d/30_qubes.conf
lib/systemd/system/org.cups.cupsd.path.d/30_qubes.conf
lib/systemd/system/org.cups.cupsd.service.d/30_qubes.conf
lib/systemd/system/org.cups.cupsd.socket.d/30_qubes.conf
lib/systemd/system/qubes-dvm.service
lib/systemd/system/qubes-early-vm-config.service
lib/systemd/system/qubes-misc-post.service
lib/systemd/system/qubes-mount-dirs.service
@ -95,18 +94,15 @@ usr/lib/python2.7/dist-packages/qubesagent-*.egg-info/*
usr/lib/python2.7/dist-packages/qubesagent/*
usr/lib/qubes-bind-dirs.d/30_cron.conf
usr/lib/qubes/close-window
usr/lib/qubes/dispvm-prerun.sh
usr/lib/qubes/init/bind-dirs.sh
usr/lib/qubes/init/control-printer-icon.sh
usr/lib/qubes/init/functions
usr/lib/qubes/init/misc-post-stop.sh
usr/lib/qubes/init/misc-post.sh
usr/lib/qubes/init/mount-dirs.sh
usr/lib/qubes/init/prepare-dvm.sh
usr/lib/qubes/init/qubes-early-vm-config.sh
usr/lib/qubes/init/qubes-random-seed.sh
usr/lib/qubes/init/qubes-sysinit.sh
usr/lib/qubes/init/setup-dvm-home.sh
usr/lib/qubes/init/setup-rw.sh
usr/lib/qubes/init/setup-rwdev.sh
usr/lib/qubes/prepare-suspend

View File

@ -91,8 +91,6 @@ case "${1}" in
sed -i "/^127\.0\.0\.1\s/,+0s/\(\s`hostname`\)\+\(\s\|$\)/\2/g" /etc/hosts || true
fi
chown user:user /home_volatile/user
# Set default "runlevel"
rm -f /etc/systemd/system/default.target
ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target

View File

@ -43,7 +43,7 @@ if [ "${1}" = "remove" ] ; then
rm /lib/firmware/updates
fi
for srv in qubes-dvm qubes-sysinit qubes-misc-post qubes-network qubes-qrexec-agent; do
for srv in qubes-sysinit qubes-misc-post qubes-network qubes-qrexec-agent; do
systemctl disable ${srv}.service
done
fi

View File

@ -1,22 +0,0 @@
#!/bin/sh
# Source Qubes library.
. /usr/lib/qubes/init/functions
echo "Setting up DVM home" >&2
touch /etc/this-is-dvm
# If the user has customized DispVM settings, use its home instead of default skel
[ -e /home_volatile/user/.qubes-dispvm-customized ] && already_customized=yes || already_customized=no
[ -e /rw/home/user/.qubes-dispvm-customized ] && wants_customization=yes || wants_customization=no
if [ "$wants_customization" = "yes" ] ; then
if [ "$already_customized" = "no" ] ; then
echo "Customizing /home from /rw/home/user" >&2
rm -rf /home_volatile/user
cp -af /rw/home/user /home_volatile/user
chown -R user.user /home_volatile/user
fi
else
initialize_home "/home_volatile" unconditionally
fi

View File

@ -1,37 +0,0 @@
#!/bin/sh
# This script must be run as the `user` user.
# It is customarily launched from prepare-dvm.sh.
# At this point, the DispVM home directory customizations
# undertaken by mount-dirs.sh have taken place.
# We know this because dispvm-prerun.sh executes after
# local-fs.target, and mount-dirs.sh runs before it.
me=$( basename "$0" )
apps="/usr/libexec/evinced"
echo "$me started." >&2
for app in $apps ; do
echo "Launching $app" >&2
$app &
done
echo "Waiting for I/O to quiesce" >&2
PREV_IO=0
while true; do
IO=`vmstat -D | awk '/read|write/ {IOs+=$1} END {print IOs}'`
if [ $IO -lt $(( $PREV_IO + 50 )) ]; then
break;
fi
PREV_IO=$IO
sleep 2
done
echo "Closing windows" >&2
/usr/lib/qubes/close-window `xwininfo -root -children|tail -n +7 |awk '{print $1}'`
sleep 1
fuser -vkm /rw
echo "$me finished." >&2

View File

@ -20,7 +20,7 @@
#
#
%define qubes_services qubes-core qubes-core-netvm qubes-core-early qubes-firewall qubes-iptables qubes-updates-proxy qubes-qrexec-agent qubes-dvm qubes-updates-proxy-forwarder
%define qubes_services qubes-core qubes-core-netvm qubes-core-early qubes-firewall qubes-iptables qubes-updates-proxy qubes-qrexec-agent qubes-updates-proxy-forwarder
%define qubes_preset_file 75-qubes-vm.preset
%{!?version: %define version %(cat version)}
@ -126,8 +126,6 @@ Requires: qubes-utils >= 3.1.3
Requires: initscripts
Requires: gawk
Requires: sed
# for dispvm-prerun.sh
Requires: procps-ng
Requires: util-linux
# for qubes-desktop-run
Requires: pygobject3-base
@ -513,7 +511,6 @@ rm -f %{name}-%{version}
/usr/bin/qubes-session-autostart
%dir /usr/lib/qubes
/usr/lib/qubes/vusb-ctl.py*
/usr/lib/qubes/dispvm-prerun.sh
/usr/lib/qubes/sync-ntp-clock
/usr/lib/qubes/prepare-suspend
/usr/lib/qubes/qrexec-agent
@ -543,11 +540,9 @@ rm -f %{name}-%{version}
/usr/lib/qubes/init/misc-post-stop.sh
/usr/lib/qubes/init/misc-post.sh
/usr/lib/qubes/init/mount-dirs.sh
/usr/lib/qubes/init/prepare-dvm.sh
/usr/lib/qubes/init/qubes-early-vm-config.sh
/usr/lib/qubes/init/qubes-random-seed.sh
/usr/lib/qubes/init/qubes-sysinit.sh
/usr/lib/qubes/init/setup-dvm-home.sh
/usr/lib/qubes/init/setup-rw.sh
/usr/lib/qubes/init/setup-rwdev.sh
/usr/lib/qubes/init/functions
@ -569,8 +564,6 @@ rm -f %{name}-%{version}
/usr/share/qubes/mime-override/globs
/usr/share/qubes/qubes-master-key.asc
%dir /home_volatile
%attr(700,user,user) /home_volatile/user
%dir /mnt/removable
%dir /rw
@ -641,7 +634,6 @@ The Qubes core startup configuration for SysV init (or upstart).
/etc/init.d/qubes-sysinit
/etc/init.d/qubes-core-early
/etc/init.d/qubes-core
/etc/init.d/qubes-dvm
/etc/init.d/qubes-core-netvm
/etc/init.d/qubes-firewall
/etc/init.d/qubes-iptables
@ -712,7 +704,6 @@ The Qubes core startup configuration for SystemD init.
%files systemd
%defattr(-,root,root,-)
/lib/systemd/system/qubes-dvm.service
/lib/systemd/system/qubes-misc-post.service
/lib/systemd/system/qubes-mount-dirs.service
/lib/systemd/system/qubes-sysinit.service

View File

@ -1,43 +0,0 @@
#!/bin/bash
#
# chkconfig: 345 91 91
# description: Executes Qubes core scripts at AppVM boot
#
# This must run after GUI agent has started. Hence 91.
#
# Source function library.
. /etc/rc.d/init.d/functions
# Source Qubes library.
. /usr/lib/qubes/init/functions
start()
{
have_qubesdb || return
if qsvc qubes-dvm; then
echo -n $"Preparing Qubes DVM:"
/usr/lib/qubes/init/prepare-dvm.sh && success || failure
echo
fi
}
stop()
{
return 0
}
case "$1" in
start)
start
;;
stop)
stop
;;
*)
echo $"Usage: $0 {start|stop}"
exit 3
;;
esac
exit $RETVAL

View File

@ -83,7 +83,6 @@ enable qubes-gui-agent.service
enable qubes-update-check.timer
enable qubes-misc-post.service
enable qubes-updates-proxy.service
enable qubes-dvm.service
enable qubes-network.service
enable qubes-qrexec-agent.service
enable qubes-mount-dirs.service

View File

@ -2,10 +2,4 @@
# Save default applications for DispVM
su -c 'mkdir -p /home_volatile/user/.local/share/applications' user
su -c 'cp -a /usr/share/applications/defaults.list /home_volatile/user/.local/share/applications/' user
if [ -r '/home/user/.local/share/applications/defaults.list' ]; then
su -c 'cat /home/user/.local/share/applications/defaults.list >> /home_volatile/user/.local/share/applications/defaults.list' user
fi
exit 0

View File

@ -9,15 +9,9 @@ set -e
if [ -e /dev/xvdb ] ; then mount /rw ; fi
/usr/lib/qubes/init/setup-rw.sh
if qsvc qubes-dvm; then
/usr/lib/qubes/init/setup-dvm-home.sh
echo "Mounting /home_volatile onto /home" >&2
mount --bind /home_volatile /home
else
initialize_home "/rw/home" ifneeded
echo "Mounting /rw/home onto /home" >&2
mount /home
# https://github.com/QubesOS/qubes-issues/issues/1328#issuecomment-169483029
# Do none of the following in a DispVM.
/usr/lib/qubes/init/bind-dirs.sh
fi
initialize_home "/rw/home" ifneeded
echo "Mounting /rw/home onto /home" >&2
mount /home
# https://github.com/QubesOS/qubes-issues/issues/1328#issuecomment-169483029
# Do none of the following in a DispVM.
/usr/lib/qubes/init/bind-dirs.sh

View File

@ -1,30 +0,0 @@
#!/bin/bash
# Source Qubes library.
. /usr/lib/qubes/init/functions
set -e
echo "Waiting for user session to quiesce." >&2
echo user | /bin/sh /etc/qubes-rpc/qubes.WaitForSession || :
echo "Possibly running save script." >&2
possibly_run_save_script
echo "Unmounting /rw filesystem." >&2
umount_retry /rw || echo "Giving up and proceeding. Warning: this may not work." >&2
dmesg -C
qubesdb-watch /qubes-restore-complete &
watch_pid=$!
free | grep Mem: |
(read label total used free shared buffers cached; qubesdb-write /qubes-used-mem $(( $used + $cached )) )
# we're still running in DispVM template
echo "Waiting for restore signal." >&2
qubesdb-read /qubes-restore-complete >/dev/null || wait $watch_pid
echo "Restore complete." >&2
# Reload random seed
echo "Reloading random seed." >&2
reload_random_seed

View File

@ -1,14 +0,0 @@
[Unit]
Description=Prepare Qubes DispVM Template
ConditionPathExists=/var/run/qubes-service/qubes-dvm
After=systemd-readahead-replay.service qubes-gui-agent.service
Wants=qubes-gui-agent.service
Before=xendriverdomain.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/lib/qubes/init/prepare-dvm.sh
[Install]
WantedBy=multi-user.target

View File

@ -1,6 +1,6 @@
[Unit]
Description=Qubes misc post-boot actions
After=network-pre.target qubes-dvm.service qubes-mount-dirs.service qubes-network.service qubes-firewall.service qubes-netwatcher.service
After=network-pre.target qubes-mount-dirs.service qubes-network.service qubes-firewall.service qubes-netwatcher.service
[Service]
Type=oneshot

View File

@ -1,6 +1,6 @@
[Unit]
Description=Qubes remote exec agent
After=qubes-dvm.service xendriverdomain.service
After=xendriverdomain.service
[Service]
ExecStartPre=/bin/sh -c '[ -e /dev/xen/evtchn ] || modprobe xen_evtchn'