Add a service to enable swap early - before fsck of the root filesystem
fsck may require significant amount of RAM, enable swap earlier to avoid out of memory condition. Implement this as a separate service unit, not a swap unit, because the latter requires udev running (implicit dependency on dev-xvdc1.device) which is not the case before remounting root filesystem read-write. QubesOS/qubes-issues#6174
This commit is contained in:
parent
aa50b2fedc
commit
7f15690e43
2
Makefile
2
Makefile
@ -101,7 +101,7 @@ install-init:
|
||||
install -m 0644 init/functions $(DESTDIR)$(LIBDIR)/qubes/init/
|
||||
|
||||
# Systemd service files
|
||||
SYSTEMD_ALL_SERVICES := $(wildcard vm-systemd/qubes-*.service)
|
||||
SYSTEMD_ALL_SERVICES := $(wildcard vm-systemd/qubes-*.service) vm-systemd/dev-xvdc1-swap.service
|
||||
SYSTEMD_NETWORK_SERVICES := vm-systemd/qubes-firewall.service vm-systemd/qubes-iptables.service vm-systemd/qubes-updates-proxy.service
|
||||
SYSTEMD_CORE_SERVICES := $(filter-out $(SYSTEMD_NETWORK_SERVICES), $(SYSTEMD_ALL_SERVICES))
|
||||
|
||||
|
1
debian/qubes-core-agent.install
vendored
1
debian/qubes-core-agent.install
vendored
@ -83,6 +83,7 @@ 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/dev-xvdc1-swap.service
|
||||
lib/systemd/system/qubes-early-vm-config.service
|
||||
lib/systemd/system/qubes-misc-post.service
|
||||
lib/systemd/system/qubes-mount-dirs.service
|
||||
|
@ -908,6 +908,7 @@ The Qubes core startup configuration for SystemD init.
|
||||
%files systemd
|
||||
%defattr(-,root,root,-)
|
||||
/etc/systemd/system/xendriverdomain.service
|
||||
/lib/systemd/system/dev-xvdc1-swap.service
|
||||
/lib/systemd/system/qubes-misc-post.service
|
||||
/lib/systemd/system/qubes-mount-dirs.service
|
||||
/lib/systemd/system/qubes-rootfs-resize.service
|
||||
|
@ -107,6 +107,7 @@ enable qubes-sync-time.timer
|
||||
enable module-load-dummy-psu.service
|
||||
enable module-load-dummy-backlight.service
|
||||
enable qubes-psu-client@.service default sys-usb
|
||||
enable dev-xvdc1-swap.service
|
||||
|
||||
# Disable useless Xen services in Qubes VM
|
||||
disable xenstored.service
|
||||
|
13
vm-systemd/dev-xvdc1-swap.service
Normal file
13
vm-systemd/dev-xvdc1-swap.service
Normal file
@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
# have it as .service, not .swap, because .swap has implicit dependency on
|
||||
# .device which needs udev running already
|
||||
Description=Enable swap on /dev/xvdc1 early
|
||||
DefaultDependencies=no
|
||||
Before=systemd-fsck-root.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=-/usr/sbin/swapon /dev/xvdc1
|
||||
|
||||
[Install]
|
||||
WantedBy=sysinit.target
|
2
vm-systemd/systemd-fsck-root.service.d/30_qubes.conf
Normal file
2
vm-systemd/systemd-fsck-root.service.d/30_qubes.conf
Normal file
@ -0,0 +1,2 @@
|
||||
[Unit]
|
||||
After=swap.target
|
Loading…
Reference in New Issue
Block a user