]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
import-generator: fix sysext/confext ordering in initrd
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Mon, 2 Feb 2026 14:09:40 +0000 (15:09 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 2 Feb 2026 23:18:41 +0000 (08:18 +0900)
In the initrd, order the generated `systemd-import@.service` units before the
initrd-specific sysext/confext units.

src/import/import-generator.c

index cdb1914604c89344ec48be637422b3a14615a2c6..f5c39774050db4ceb72bfae433dd422fd9da4d48 100644 (file)
@@ -357,9 +357,11 @@ static int transfer_generate(const Transfer *t) {
                         arg_failure_action);
 
         if (t->class == IMAGE_SYSEXT)
-                fputs("Before=systemd-sysext.service\n", f);
+                fprintf(f, "Before=systemd-sysext%s.service\n",
+                        in_initrd() ? "-initrd" : "");
         else if (t->class == IMAGE_CONFEXT)
-                fputs("Before=systemd-confext.service\n", f);
+                fprintf(f, "Before=systemd-confext%s.service\n",
+                        in_initrd() ? "-initrd" : "");
 
         /* Assume network resource unless URL is file:// */
         if (!file_url_is_valid(t->remote))