From 3edcd5ea98267e3fd834d4a135a53f7875cace40 Mon Sep 17 00:00:00 2001 From: Luca Di Maio Date: Wed, 22 Jan 2025 11:58:37 +0100 Subject: [PATCH 01/12] feat(services): add service auto-enable in multiuser target Signed-off-by: Luca Di Maio --- docker.yaml | 3 +++ openssh.yaml | 5 ++++- systemd.yaml | 8 +++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/docker.yaml b/docker.yaml index 43ed5d9754d..9858e084459 100644 --- a/docker.yaml +++ b/docker.yaml @@ -191,6 +191,9 @@ subpackages: install -Dm644 contrib/init/systemd/docker.socket "${{targets.subpkgdir}}"/usr/lib/systemd/system/ install -Dm644 contrib/init/systemd/docker.service "${{targets.subpkgdir}}"/usr/lib/systemd/system/ sed -i "s|\[Service\]|[Service]\nEnvironment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"|g" "${{targets.subpkgdir}}"/usr/lib/systemd/system/docker.service + mkdir -p "${{targets.subpkgdir}}/usr/lib/systemd/system/multi-user.target.wants/" + ln -sf ../docker.service "${{targets.subpkgdir}}/usr/lib/systemd/system/multi-user.target.wants/sshddocker.service" + ln -sf ../docker.socket "${{targets.subpkgdir}}/usr/lib/systemd/system/multi-user.target.wants/sshddocker.socket" update: enabled: true diff --git a/openssh.yaml b/openssh.yaml index be97073c908..d50c8acee50 100644 --- a/openssh.yaml +++ b/openssh.yaml @@ -1,7 +1,7 @@ package: name: openssh version: 9.9_p1 - epoch: 3 + epoch: 4 description: "the OpenBSD SSH implementation" copyright: - license: ISC @@ -151,7 +151,10 @@ subpackages: pipeline: - runs: | mkdir -p "${{targets.subpkgdir}}"/usr/lib/systemd/system + mkdir -p "${{targets.subpkgdir}}/usr/lib/systemd/system/multi-user.target.wants/" install -Dm644 sshd.service "${{targets.subpkgdir}}"/usr/lib/systemd/system + ln -sf ../sshd.service "${{targets.subpkgdir}}/usr/lib/systemd/system/multi-user.target.wants/sshd.service" + dependencies: runtime: - systemd diff --git a/systemd.yaml b/systemd.yaml index 1c973200a86..01674635319 100644 --- a/systemd.yaml +++ b/systemd.yaml @@ -370,11 +370,17 @@ subpackages: - ${{package.name}} - tzdata - mount + - kbd pipeline: - runs: | mkdir -p ${{targets.subpkgdir}}/etc ${{targets.subpkgdir}}/sbin - ln -s ../usr/lib/systemd/systemd ${{targets.subpkgdir}}/sbin/init + mkdir -p "${{targets.subpkgdir}}/usr/lib/systemd/system/multi-user.target.wants/" + ln -sf ../usr/lib/systemd/systemd ${{targets.subpkgdir}}/sbin/init ln -sf ../usr/share/zoneinfo/UTC ${{targets.subpkgdir}}/etc/localtime + ln -sf ../run/systemd/resolve/stub-resolv.conf "${{targets.subpkgdir}}/etc/resolv.conf" + ln -sf ../systemd-networkd.service "${{targets.subpkgdir}}/usr/lib/systemd/system/multi-user.target.wants/systemd-networkd.service" + ln -sf ../systemd-resolved.service "${{targets.subpkgdir}}/usr/lib/systemd/system/multi-user.target.wants/systemd-resolved.service" + touch "${{targets.subpkgdir}}/etc/machine-id" test: pipeline: - runs: | From fe06c86c6d48bb8bf18bd604d61afc0db73ed625 Mon Sep 17 00:00:00 2001 From: Luca Di Maio Date: Wed, 22 Jan 2025 12:03:48 +0100 Subject: [PATCH 02/12] fix linting Signed-off-by: Luca Di Maio --- openssh.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/openssh.yaml b/openssh.yaml index d50c8acee50..0b75ad952db 100644 --- a/openssh.yaml +++ b/openssh.yaml @@ -154,7 +154,6 @@ subpackages: mkdir -p "${{targets.subpkgdir}}/usr/lib/systemd/system/multi-user.target.wants/" install -Dm644 sshd.service "${{targets.subpkgdir}}"/usr/lib/systemd/system ln -sf ../sshd.service "${{targets.subpkgdir}}/usr/lib/systemd/system/multi-user.target.wants/sshd.service" - dependencies: runtime: - systemd From f66df861d6e17e188c8d19b096a8f088f27d248a Mon Sep 17 00:00:00 2001 From: Luca Di Maio Date: Wed, 22 Jan 2025 13:36:01 +0100 Subject: [PATCH 03/12] fix typo Signed-off-by: Luca Di Maio --- docker.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker.yaml b/docker.yaml index 9858e084459..ba5df425803 100644 --- a/docker.yaml +++ b/docker.yaml @@ -192,8 +192,8 @@ subpackages: install -Dm644 contrib/init/systemd/docker.service "${{targets.subpkgdir}}"/usr/lib/systemd/system/ sed -i "s|\[Service\]|[Service]\nEnvironment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"|g" "${{targets.subpkgdir}}"/usr/lib/systemd/system/docker.service mkdir -p "${{targets.subpkgdir}}/usr/lib/systemd/system/multi-user.target.wants/" - ln -sf ../docker.service "${{targets.subpkgdir}}/usr/lib/systemd/system/multi-user.target.wants/sshddocker.service" - ln -sf ../docker.socket "${{targets.subpkgdir}}/usr/lib/systemd/system/multi-user.target.wants/sshddocker.socket" + ln -sf ../docker.service "${{targets.subpkgdir}}/usr/lib/systemd/system/multi-user.target.wants/docker.service" + ln -sf ../docker.socket "${{targets.subpkgdir}}/usr/lib/systemd/system/multi-user.target.wants/docker.socket" update: enabled: true From f0b290d73d45d34b49ecf8ad50c105f218c5704d Mon Sep 17 00:00:00 2001 From: Luca Di Maio Date: Wed, 22 Jan 2025 13:36:27 +0100 Subject: [PATCH 04/12] bump docker epoch Signed-off-by: Luca Di Maio --- docker.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker.yaml b/docker.yaml index ba5df425803..dff642af412 100644 --- a/docker.yaml +++ b/docker.yaml @@ -1,7 +1,7 @@ package: name: docker version: "27.5.1" - epoch: 0 + epoch: 1 description: A meta package for Docker Engine and Docker CLI copyright: - license: Apache-2.0 From b55583ba1ad0610cd2544410ac8bafc2cc62e73e Mon Sep 17 00:00:00 2001 From: Luca Di Maio Date: Thu, 23 Jan 2025 09:19:51 +0100 Subject: [PATCH 05/12] bump systemd epoch Signed-off-by: Luca Di Maio --- systemd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systemd.yaml b/systemd.yaml index 01674635319..39bf4cf7ecb 100644 --- a/systemd.yaml +++ b/systemd.yaml @@ -1,7 +1,7 @@ package: name: systemd version: "257.2" - epoch: 7 + epoch: 8 description: The systemd System and Service Manager copyright: - license: LGPL-2.1-or-later AND GPL-2.0-or-later From 0cfb0e9c10f6266fc0579bed2b93d80047d89f89 Mon Sep 17 00:00:00 2001 From: Luca Di Maio Date: Thu, 23 Jan 2025 09:22:50 +0100 Subject: [PATCH 06/12] remove targets, move to presets Signed-off-by: Luca Di Maio --- docker.yaml | 5 ++--- openssh.yaml | 4 ++-- systemd.yaml | 8 ++------ 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/docker.yaml b/docker.yaml index dff642af412..bee0ea6ce5b 100644 --- a/docker.yaml +++ b/docker.yaml @@ -191,9 +191,8 @@ subpackages: install -Dm644 contrib/init/systemd/docker.socket "${{targets.subpkgdir}}"/usr/lib/systemd/system/ install -Dm644 contrib/init/systemd/docker.service "${{targets.subpkgdir}}"/usr/lib/systemd/system/ sed -i "s|\[Service\]|[Service]\nEnvironment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"|g" "${{targets.subpkgdir}}"/usr/lib/systemd/system/docker.service - mkdir -p "${{targets.subpkgdir}}/usr/lib/systemd/system/multi-user.target.wants/" - ln -sf ../docker.service "${{targets.subpkgdir}}/usr/lib/systemd/system/multi-user.target.wants/docker.service" - ln -sf ../docker.socket "${{targets.subpkgdir}}/usr/lib/systemd/system/multi-user.target.wants/docker.socket" + echo "enable docker.service" > "${{targets.subpkgdir}}/usr/lib/systemd/system-preset/81-docker.preset" + echo "enable docker.socket" >> "${{targets.subpkgdir}}/usr/lib/systemd/system-preset/81-docker.preset" update: enabled: true diff --git a/openssh.yaml b/openssh.yaml index 0b75ad952db..8264e773d53 100644 --- a/openssh.yaml +++ b/openssh.yaml @@ -151,9 +151,9 @@ subpackages: pipeline: - runs: | mkdir -p "${{targets.subpkgdir}}"/usr/lib/systemd/system - mkdir -p "${{targets.subpkgdir}}/usr/lib/systemd/system/multi-user.target.wants/" install -Dm644 sshd.service "${{targets.subpkgdir}}"/usr/lib/systemd/system - ln -sf ../sshd.service "${{targets.subpkgdir}}/usr/lib/systemd/system/multi-user.target.wants/sshd.service" + echo "enable sshd.service" > "${{targets.subpkgdir}}/usr/lib/systemd/system-preset/80-sshd.preset" + dependencies: runtime: - systemd diff --git a/systemd.yaml b/systemd.yaml index 39bf4cf7ecb..b7f11486bcd 100644 --- a/systemd.yaml +++ b/systemd.yaml @@ -374,12 +374,8 @@ subpackages: pipeline: - runs: | mkdir -p ${{targets.subpkgdir}}/etc ${{targets.subpkgdir}}/sbin - mkdir -p "${{targets.subpkgdir}}/usr/lib/systemd/system/multi-user.target.wants/" - ln -sf ../usr/lib/systemd/systemd ${{targets.subpkgdir}}/sbin/init - ln -sf ../usr/share/zoneinfo/UTC ${{targets.subpkgdir}}/etc/localtime - ln -sf ../run/systemd/resolve/stub-resolv.conf "${{targets.subpkgdir}}/etc/resolv.conf" - ln -sf ../systemd-networkd.service "${{targets.subpkgdir}}/usr/lib/systemd/system/multi-user.target.wants/systemd-networkd.service" - ln -sf ../systemd-resolved.service "${{targets.subpkgdir}}/usr/lib/systemd/system/multi-user.target.wants/systemd-resolved.service" + ln -s ../usr/lib/systemd/systemd ${{targets.subpkgdir}}/sbin/init + ln -s ../run/systemd/resolve/stub-resolv.conf "${{targets.subpkgdir}}/etc/resolv.conf" touch "${{targets.subpkgdir}}/etc/machine-id" test: pipeline: From d66e174a8308e5604e06908e521b50a8a9e27869 Mon Sep 17 00:00:00 2001 From: Luca Di Maio Date: Thu, 23 Jan 2025 09:23:30 +0100 Subject: [PATCH 07/12] ensure preset dir is present Signed-off-by: Luca Di Maio --- docker.yaml | 1 + openssh.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/docker.yaml b/docker.yaml index bee0ea6ce5b..052ab925805 100644 --- a/docker.yaml +++ b/docker.yaml @@ -188,6 +188,7 @@ subpackages: pipeline: - runs: | mkdir -p "${{targets.subpkgdir}}"/usr/lib/systemd/system/ + mkdir -p ${{targets.subpkgdir}}/usr/lib/systemd/system-preset/ install -Dm644 contrib/init/systemd/docker.socket "${{targets.subpkgdir}}"/usr/lib/systemd/system/ install -Dm644 contrib/init/systemd/docker.service "${{targets.subpkgdir}}"/usr/lib/systemd/system/ sed -i "s|\[Service\]|[Service]\nEnvironment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"|g" "${{targets.subpkgdir}}"/usr/lib/systemd/system/docker.service diff --git a/openssh.yaml b/openssh.yaml index 8264e773d53..bcc89d11c90 100644 --- a/openssh.yaml +++ b/openssh.yaml @@ -151,6 +151,7 @@ subpackages: pipeline: - runs: | mkdir -p "${{targets.subpkgdir}}"/usr/lib/systemd/system + mkdir -p ${{targets.subpkgdir}}/usr/lib/systemd/system-preset/ install -Dm644 sshd.service "${{targets.subpkgdir}}"/usr/lib/systemd/system echo "enable sshd.service" > "${{targets.subpkgdir}}/usr/lib/systemd/system-preset/80-sshd.preset" From 4dee48406531ed333dbaaed939abdebc07d77f0e Mon Sep 17 00:00:00 2001 From: Luca Di Maio Date: Thu, 23 Jan 2025 09:26:13 +0100 Subject: [PATCH 08/12] fix linting Signed-off-by: Luca Di Maio --- openssh.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/openssh.yaml b/openssh.yaml index bcc89d11c90..df27ad7ea9c 100644 --- a/openssh.yaml +++ b/openssh.yaml @@ -154,7 +154,6 @@ subpackages: mkdir -p ${{targets.subpkgdir}}/usr/lib/systemd/system-preset/ install -Dm644 sshd.service "${{targets.subpkgdir}}"/usr/lib/systemd/system echo "enable sshd.service" > "${{targets.subpkgdir}}/usr/lib/systemd/system-preset/80-sshd.preset" - dependencies: runtime: - systemd From bc4a0fbc7a24b4517a4a32239aeaddd3cc97223d Mon Sep 17 00:00:00 2001 From: Luca Di Maio Date: Thu, 23 Jan 2025 15:48:08 +0100 Subject: [PATCH 09/12] correctly uninitialize machine-id Signed-off-by: Luca Di Maio --- systemd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systemd.yaml b/systemd.yaml index b7f11486bcd..df73cf8dabb 100644 --- a/systemd.yaml +++ b/systemd.yaml @@ -376,7 +376,7 @@ subpackages: mkdir -p ${{targets.subpkgdir}}/etc ${{targets.subpkgdir}}/sbin ln -s ../usr/lib/systemd/systemd ${{targets.subpkgdir}}/sbin/init ln -s ../run/systemd/resolve/stub-resolv.conf "${{targets.subpkgdir}}/etc/resolv.conf" - touch "${{targets.subpkgdir}}/etc/machine-id" + echo "uninitialized" > "${{targets.subpkgdir}}/etc/machine-id" test: pipeline: - runs: | From e1578d6f375249fceb8797a115a355b9a12a8c33 Mon Sep 17 00:00:00 2001 From: Luca Di Maio Date: Thu, 23 Jan 2025 16:02:03 +0100 Subject: [PATCH 10/12] systemd-init: add agetty dependency Signed-off-by: Luca Di Maio --- systemd.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/systemd.yaml b/systemd.yaml index df73cf8dabb..5c50ecbedb5 100644 --- a/systemd.yaml +++ b/systemd.yaml @@ -371,6 +371,7 @@ subpackages: - tzdata - mount - kbd + - agetty pipeline: - runs: | mkdir -p ${{targets.subpkgdir}}/etc ${{targets.subpkgdir}}/sbin From 0da07da2bcfff9a70bd8c6eaeb3bc7334b5159db Mon Sep 17 00:00:00 2001 From: Luca Di Maio Date: Thu, 23 Jan 2025 16:30:54 +0100 Subject: [PATCH 11/12] systemd: fix standalone binary test Signed-off-by: Luca Di Maio --- systemd.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/systemd.yaml b/systemd.yaml index 5c50ecbedb5..e51f4a2fe52 100644 --- a/systemd.yaml +++ b/systemd.yaml @@ -369,6 +369,7 @@ subpackages: runtime: - ${{package.name}} - tzdata + - agetty - mount - kbd - agetty @@ -534,5 +535,5 @@ test: rm test.c test_systemd - name: "Verify stanalone binaries removed" runs: | - STANDALONE_BINARIES=$(find / -name '*.standalone') + STANDALONE_BINARIES=$(find /usr -name '*.standalone' ) test -z "${STANDALONE_BINARIES}" From c5b9f33aac8f283be88e80969e70536beeb1365a Mon Sep 17 00:00:00 2001 From: Luca Di Maio Date: Thu, 23 Jan 2025 16:53:06 +0100 Subject: [PATCH 12/12] systemd: fix systemd-init test Signed-off-by: Luca Di Maio --- systemd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systemd.yaml b/systemd.yaml index e51f4a2fe52..f1a8d572741 100644 --- a/systemd.yaml +++ b/systemd.yaml @@ -383,7 +383,7 @@ subpackages: pipeline: - runs: | [ -f /sbin/init -a -x /sbin/init ] - [ -f /etc/localtime ] + grep "uninitialized" /etc/machine-id - name: "systemd-default-network" description: "Configure network to DHCP on default interfaces"