]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Always create /init symlink if systemd is installed
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 30 Apr 2023 14:38:36 +0000 (16:38 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 30 Apr 2023 20:53:55 +0000 (22:53 +0200)
Let's always create the /init symlink if systemd is installed so that
the kernel picks it up at /init when we try to use this output as the
initramfs.

mkosi/__init__.py

index 086ebeef60304924ed92dbbfdee7e264948938e2..f32813e8f680ac8806ba01b043f3401d5169d427 100644 (file)
@@ -1281,12 +1281,12 @@ def configure_ssh(state: MkosiState) -> None:
 
 
 def configure_initrd(state: MkosiState) -> None:
+    if not state.root.joinpath("init").exists() and state.root.joinpath("usr/lib/systemd/systemd").exists():
+        state.root.joinpath("init").symlink_to("/usr/lib/systemd/systemd")
+
     if not state.config.make_initrd:
         return
 
-    if not state.root.joinpath("init").exists():
-        state.root.joinpath("init").symlink_to("/usr/lib/systemd/systemd")
-
     if not state.root.joinpath("etc/initrd-release").exists():
         state.root.joinpath("etc/initrd-release").symlink_to("/etc/os-release")