From c7041ca33c9cc52238ab379e339ce8218bfa82cb Mon Sep 17 00:00:00 2001 From: 0x416e746f6e Date: Tue, 26 May 2026 13:24:51 +0200 Subject: [PATCH] fix: use `systemd-repart` from nix (cherry picked from commit 526af72bf7199aff9fe3e104bab3f2de458d3ef2) --- mkosi.profiles/gcp/mkosi.postoutput | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mkosi.profiles/gcp/mkosi.postoutput b/mkosi.profiles/gcp/mkosi.postoutput index ac95f434..c59f38e6 100755 --- a/mkosi.profiles/gcp/mkosi.postoutput +++ b/mkosi.profiles/gcp/mkosi.postoutput @@ -21,7 +21,14 @@ cp mkosi.profiles/gcp/repart.d/00-uki.conf "${REPART_TMPDIR}/00-uki.conf" echo "SizeMinBytes=${ESP_BYTES}" >> "${REPART_TMPDIR}/00-uki.conf" echo "SizeMaxBytes=${ESP_BYTES}" >> "${REPART_TMPDIR}/00-uki.conf" -systemd-repart --empty=create \ +# +# - default systemd-repart (in /usr/bin) is "systemd 252 (252.39-1~deb12u2)" +# - the one from nix (/nix/store/*-systemd-*/bin) is newer ("systemd 258 (258.3)" a.t.m.) +# - to use "--copy-source" CLI option we need a newer one +# - this hack ensures systemd-repart resolves to the nix one +# +PATH="${PATH#/usr/bin:/usr/sbin:}" systemd-repart \ + --empty=create \ --size=${DISK_GIB}G \ --definitions="${REPART_TMPDIR}" \ --copy-source=${OUTPUTDIR} \