]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
repart: allow --el-torito= with any --empty= value
authorDaan De Meyer <daan@amutable.com>
Sun, 29 Mar 2026 21:11:52 +0000 (21:11 +0000)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 29 Mar 2026 21:58:07 +0000 (23:58 +0200)
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 <noreply@anthropic.com>
man/systemd-repart.xml
src/repart/repart.c

index 0cb14b6991392d3c453ec8e4e916d4711c0bcf83..271366e5efdb002b31f1f902afe03daf8ed79c19 100644 (file)
         <para>The disk requires at least one partition with <varname>Type=esp</varname>. The first one will
         be the one referenced in the boot catalog.</para>
 
-        <para>This option is available only when creating a new partition table, that is when
-        <option>--empty=</option> has value <literal>require</literal>, <literal>force</literal> or
-        <literal>create</literal>.</para>
-
         <xi:include href="version-info.xml" xpointer="v261"/></listitem>
       </varlistentry>
 
index 5c36bad0758f2d6e2ba76f6e05569464f03c8eae..d672db6d266b4b55df94c4e3a74814ce61d7ea7b 100644 (file)
@@ -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;
 }