From: Daan De Meyer Date: Wed, 18 Feb 2026 14:30:29 +0000 (+0100) Subject: Default Machine= to the current working directory name X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ce66d5a3244df8f5edfb89046d26f72a9d003b2;p=thirdparty%2Fmkosi.git Default Machine= to the current working directory name It makes a lot more sense for the systemd machine name to be systemd rather than main. --- diff --git a/mkosi/config.py b/mkosi/config.py index f0964b6f4..4ee51da32 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -4177,6 +4177,7 @@ SETTINGS: list[ConfigSetting[Any]] = [ metavar="NAME", section="Runtime", help="Set the machine name to use when booting the image", + default_factory=lambda ns: ns["directory"].name if ns["directory"] else None, scope=SettingScope.main, ), ConfigSetting( diff --git a/mkosi/resources/man/mkosi.1.md b/mkosi/resources/man/mkosi.1.md index e3f95170e..99f683b21 100644 --- a/mkosi/resources/man/mkosi.1.md +++ b/mkosi/resources/man/mkosi.1.md @@ -2066,6 +2066,8 @@ boolean argument: either `1`, `yes`, or `true` to enable, or `0`, `no`, Note that `Ephemeral=` has to be enabled to start multiple instances of the same image. + Defaults to the current working directory name. + `Register=`, `--register=` : Takes a boolean value or `auto`. Specifies whether to register the vm/container with systemd-machined. If enabled, mkosi will fail if