]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Pass firstboot settings to generated initrd as well
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 15 May 2023 13:55:32 +0000 (15:55 +0200)
committerJörg Behrmann <behrmann@physik.fu-berlin.de>
Mon, 15 May 2023 14:35:49 +0000 (16:35 +0200)
It generally doesn't make sense to have these differ between the
initrd and the rootfs, so let's pass these settings through to the
initrd as well.

The only setting we don't pass through is the root shell as configuring
a different root shell might mean installing extra packages which might
be undesireable in the initrd.

mkosi/__init__.py

index bf6da8328ba6834fe5c4eb383b936d0d191bad73..d1eb25bdb5c2aa97ae20351ba5c090cae5779566 100644 (file)
@@ -777,6 +777,14 @@ def install_unified_kernel(state: MkosiState, roothash: Optional[str]) -> None:
                 "--make-initrd", "yes",
                 "--bootable", "no",
                 "--manifest-format", "",
+                *(["--locale", state.config.locale] if state.config.locale else []),
+                *(["--locale-messages", state.config.locale_messages] if state.config.locale_messages else []),
+                *(["--keymap", state.config.keymap] if state.config.keymap else []),
+                *(["--timezone", state.config.timezone] if state.config.timezone else []),
+                *(["--hostname", state.config.hostname] if state.config.hostname else []),
+                *(["--root-password", state.config.root_password] if state.config.root_password else []),
+                *(["--root-password-hashed", state.config.root_password_hashed] if state.config.root_password_hashed else []),
+                *(["--root-password-file", os.fspath(state.config.root_password_file)] if state.config.root_password_file else []),
                 *(["-f"] * state.args.force),
                 "build",
             ])