]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bootctl: Fix prepend when installing systemd-boot for the first time
authorElliot Berman <eberman@anduril.com>
Tue, 7 Jul 2026 23:28:10 +0000 (16:28 -0700)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 8 Jul 2026 10:06:42 +0000 (11:06 +0100)
In commit 38433a6d06ef ("bootctl: rework bootctl-install.c in preparation of varlinkification"),
the `first` argument of install_boot_option() was reworked to use the
new InstallContext struct/InstallOperation. `first` was intended to
indicate if we were on the install path, so the check should be
== INSTALL_NEW, not != INSTALL_NEW.

Fixes: 38433a6d06ef ("bootctl: rework bootctl-install.c in preparation of varlinkification")
src/bootctl/bootctl-install.c

index 381ee95223a4821ab6efa8f82ff3f8630eaadba0..3d8b0e65315caa772fa5a0c6aa8e9d3c1a4e2140 100644 (file)
@@ -1339,7 +1339,7 @@ static int insert_into_order(InstallContext *c, uint16_t slot, uint16_t after_sl
         order = t;
 
         /* add us to the top or end of the list */
-        if (c->operation != INSTALL_NEW) {
+        if (c->operation == INSTALL_NEW) {
                 memmove(order + 1, order, n * sizeof(uint16_t));
                 order[0] = slot;
         } else