Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions hooks/095-preset-all.chroot
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

set -eux

systemctl preset-all
systemctl --global preset-all
31 changes: 28 additions & 3 deletions hooks/100-systemd-in-lib.chroot
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,32 @@
set -eux

echo "ensure the systemd target.wants are in /lib instead of /etc"
for d in multi-user.target.wants sysinit.target.wants timers.target.wants; do
mv etc/systemd/system/"$d"/* lib/systemd/system/"$d"
done

for path in /etc/systemd/system/*.wants /etc/systemd/system/*.requires; do
if ! [ -d "${path}" ]; then
continue
fi
want="$(basename "${path}")"
for link in "${path}"/*; do
if ! [ -L "${link}" ]; then
continue
fi
mkdir -p /lib/systemd/system/"${want}"
source="$(basename "${link}")"
unitpath="$(realpath "${link}")"
case "${unitpath}" in
/lib/systemd/system/*)
ln -rs "${unitpath}" "/lib/systemd/system/${want}/${source}"
;;
/usr/lib/systemd/system/*)
ln -rs "${unitpath}" "/usr/lib/systemd/system/${want}/${source}"
;;
*)
ln -s "${unitpath}" "/lib/systemd/system/${want}/${source}"
;;
esac
rm "${link}"
done

rmdir "${path}"
done
8 changes: 8 additions & 0 deletions static/usr/lib/systemd/system-preset/90-ubuntu-core.preset
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
enable core.start-snapd.service
enable keep-entangled-mounts.target
enable plymouth-show-install.service
enable remount-data.service
enable remount-seed.service
enable snapd.seeded.service
enable snapd.sshd-keygen.service
enable swapfile.service

This file was deleted.

3 changes: 3 additions & 0 deletions static/usr/lib/systemd/system/keep-entangled-mounts.target
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ Wants=run-mnt-data.mount
Wants=run-mnt-ubuntu\x2dseed.mount
Wants=usr-lib-modules.mount
Wants=run-mnt-kernel.mount

[Install]
WantedBy=shutdown.target

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 3 additions & 0 deletions static/usr/lib/systemd/system/remount-data.service
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ Before=shutdown.target
[Service]
Type=oneshot
ExecStart=/bin/mount -o remount,ro /run/mnt/data

[Install]
WantedBy=shutdown.target
3 changes: 3 additions & 0 deletions static/usr/lib/systemd/system/remount-seed.service
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ Before=shutdown.target
[Service]
Type=oneshot
ExecStart=/bin/mount -o remount,ro /run/mnt/ubuntu-seed

[Install]
WantedBy=shutdown.target

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 3 additions & 0 deletions static/usr/lib/systemd/system/snapd.sshd-keygen.service
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ Before=sshd.service
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/core-sshd-host-keygen

[Install]
WantedBy=multi-user.target
3 changes: 3 additions & 0 deletions static/usr/lib/systemd/system/var-lib-snapd-save.mount
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ What=/run/mnt/ubuntu-save
Where=/var/lib/snapd/save
Options=bind
Type=none

[Install]
WantedBy=local-fs.target