From be2ac4beb5298978ca5f6b63f2e48a5f1d660079 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Sun, 29 Mar 2026 21:11:52 +0000 Subject: [PATCH] repart: allow --el-torito= with any --empty= value The restriction requiring --empty= to be require, force, or create when using --el-torito= is unnecessary. context_verify_eltorito_overlap() already validates that the ISO 9660 blocks don't collide with GPT partition entries or the first usable LBA, which is sufficient to guarantee safety regardless of the empty mode. This is needed for two-stage image builds where the first stage creates the usr and verity partitions, and the second stage adds --el-torito= to produce a bootable ISO with a UKI containing usrhash= derived from the verity hash of the first stage. In the second stage, repart runs with --empty=allow since the image already exists. Co-developed-by: Claude Opus 4.6 --- man/systemd-repart.xml | 4 ---- src/repart/repart.c | 4 ---- 2 files changed, 8 deletions(-) diff --git a/man/systemd-repart.xml b/man/systemd-repart.xml index 0cb14b6991..271366e5ef 100644 --- a/man/systemd-repart.xml +++ b/man/systemd-repart.xml @@ -731,10 +731,6 @@ The disk requires at least one partition with Type=esp. The first one will be the one referenced in the boot catalog. - This option is available only when creating a new partition table, that is when - has value require, force or - create. - diff --git a/src/repart/repart.c b/src/repart/repart.c index 5c36bad075..d672db6d26 100644 --- a/src/repart/repart.c +++ b/src/repart/repart.c @@ -10280,10 +10280,6 @@ static int parse_argv(int argc, char *argv[]) { arg_pager_flags |= PAGER_DISABLE; } - if (arg_eltorito && !IN_SET(arg_empty, EMPTY_REQUIRE, EMPTY_FORCE, EMPTY_CREATE)) - return log_error_errno(SYNTHETIC_ERRNO(EINVAL), - "--el-torito=yes requires --empty= to be either require, force or create."); - return 1; }