Skip to content

Commit

Permalink
slices/systemd: rely on initialization services upon first boot of sy…
Browse files Browse the repository at this point in the history
…stemd
  • Loading branch information
Meulengracht committed Jul 5, 2024
1 parent 92fe571 commit 4228943
Showing 1 changed file with 9 additions and 61 deletions.
70 changes: 9 additions & 61 deletions slices/systemd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ slices:
- mount_bins
- systemd_libs
- systemd_config
- systemd_generated-config
contents:
/usr/bin/busctl:
/usr/bin/hostnamectl:
Expand Down Expand Up @@ -534,73 +535,20 @@ slices:
/etc/systemd/user.conf:
/etc/xdg/systemd/user:

# generated config slice is to emulate symlinks or initial state
# config generated by systemd upon install
# Generated config slice is to emulate symlinks or initial state
# config generated by systemd upon install.
# Systemd performs a lot of initialization upon install, however since systemd
# does actually not rely on these install actions (since all of these are run as
# a part of the first install / early setup upon first boot), a lot of this is
# left out. It's done like that because systemd needs to be usable after install
# on a running system, but this is not the case here.
# These are the few that seems to be not emulated
generated-config:
contents:
/etc/systemd/system/getty.target.wants/[email protected]: {symlink: /usr/lib/systemd/system/[email protected]}

Check failure on line 548 in slices/systemd.yaml

View workflow job for this annotation

GitHub Actions / Lint / Lint

548:101 [line-length] line too long (114 > 100 characters)
/etc/systemd/system/multi-user.target.wants/remote-fs.target: {symlink: /usr/lib/systemd/system/remote-fs.target}

Check failure on line 549 in slices/systemd.yaml

View workflow job for this annotation

GitHub Actions / Lint / Lint

549:101 [line-length] line too long (119 > 100 characters)
/etc/systemd/system/sysinit.target.wants/systemd-pstore.service: {symlink: /usr/lib/systemd/system/systemd-pstore.service}

Check failure on line 550 in slices/systemd.yaml

View workflow job for this annotation

GitHub Actions / Lint / Lint

550:101 [line-length] line too long (128 > 100 characters)
/etc/systemd/system/sysinit.target.wants/systemd-pcrlock-machine-id.service: {symlink: /usr/lib/systemd/system/systemd-pcrlock-machine-id.service}
/etc/systemd/system/timers.target.wants/systemd-sysupdate-reboot.timer: {symlink: /usr/lib/systemd/system/systemd-sysupdate-reboot.timer}
/etc/systemd/system/sysinit.target.wants/systemd-confext.service: {symlink: /usr/lib/systemd/system/systemd-confext.service}
/etc/systemd/system/sysinit.target.wants/systemd-sysext.service: {symlink: /usr/lib/systemd/system/systemd-sysext.service}
/etc/systemd/system/multi-user.target.wants/remote-veritysetup.target: {symlink: /usr/lib/systemd/system/remote-veritysetup.target}
/etc/systemd/system/dbus-org.freedesktop.network1.service: {symlink: /usr/lib/systemd/system/systemd-networkd.service}
/etc/systemd/system/multi-user.target.wants/systemd-networkd.service: {symlink: /usr/lib/systemd/system/systemd-networkd.service}
/etc/systemd/system/sockets.target.wants/systemd-networkd.socket: {symlink: /usr/lib/systemd/system/systemd-networkd.socket}
/etc/systemd/system/sysinit.target.wants/systemd-network-generator.service: {symlink: /usr/lib/systemd/system/systemd-network-generator.service}
/etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service: {symlink: /usr/lib/systemd/system/systemd-networkd-wait-online.service}
/etc/systemd/system/sockets.target.wants/systemd-journald-audit.socket: {symlink: /usr/lib/systemd/system/systemd-journald-audit.socket}
/etc/systemd/system/systemd-journald.service.wants/systemd-journald-audit.socket: {symlink: /usr/lib/systemd/system/systemd-journald-audit.socket}
/etc/systemd/system/sysinit.target.wants/systemd-pcrlock-firmware-code.service: {symlink: /usr/lib/systemd/system/systemd-pcrlock-firmware-code.service}
/etc/systemd/system/sysinit.target.wants/systemd-pcrlock-firmware-config.service: {symlink: /usr/lib/systemd/system/systemd-pcrlock-firmware-config.service}
/etc/systemd/system/sockets.target.wants/systemd-pcrextend.socket: {symlink: /usr/lib/systemd/system/systemd-pcrextend.socket}
/etc/systemd/system/multi-user.target.wants/remote-cryptsetup.target: {symlink: /usr/lib/systemd/system/remote-cryptsetup.target}
/etc/systemd/system/timers.target.wants/systemd-sysupdate.timer: {symlink: /usr/lib/systemd/system/systemd-sysupdate.timer}
/etc/systemd/system/ctrl-alt-del.target: {symlink: /usr/lib/systemd/system/reboot.target}
/etc/systemd/system/sockets.target.wants/systemd-sysext.socket: {symlink: /usr/lib/systemd/system/systemd-sysext.socket}
/etc/systemd/system/sysinit.target.wants/systemd-pcrlock-secureboot-policy.service: {symlink: /usr/lib/systemd/system/systemd-pcrlock-secureboot-policy.service}
/etc/systemd/system/sysinit.target.wants/systemd-pcrlock-make-policy.service: {symlink: /usr/lib/systemd/system/systemd-pcrlock-make-policy.service}
/etc/systemd/system/sysinit.target.wants/systemd-pcrlock-file-system.service: {symlink: /usr/lib/systemd/system/systemd-pcrlock-file-system.service}
/etc/systemd/system/sysinit.target.wants/systemd-pcrlock-secureboot-authority.service: {symlink: /usr/lib/systemd/system/systemd-pcrlock-secureboot-authority.service}
/var/log/journal/: {make: true}
/var/lib/systemd/catalog/database: {mutable: true}
mutate: |
catalog_files = content.list("/usr/lib/systemd/catalog/")
catalog_map = {}
for cf in catalog_files:
# determine language from the file name
nt = cf.split(".")
lang = ""
if len(nt) > 2:
lang = nt[1]
# now read the contents and start to parse for language
catalog = content.read(cf)
lines = catalog.splitlines()
payload = ""
found_id = False
for li in lines:
if li.startswith("#"):
continue
if li.startswith("-- ") and len(li) >= 35:
nli = cf.split()
id = nli[1]
if found_id:
catalog_map[id+lang] = payload
payload = ""
if len(nli) == 3 and lang == "":
lang = nli[2]
found_id = True
continue
if not found_id:
continue
payload += li + "\n"

dbus-config:
contents:
Expand Down

0 comments on commit 4228943

Please sign in to comment.