]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Default Machine= to the current working directory name
authorDaan De Meyer <daan@amutable.com>
Wed, 18 Feb 2026 14:30:29 +0000 (15:30 +0100)
committerJörg Behrmann <behrmann@physik.fu-berlin.de>
Wed, 18 Feb 2026 15:14:00 +0000 (16:14 +0100)
It makes a lot more sense for the systemd machine name to be systemd
rather than main.

mkosi/config.py
mkosi/resources/man/mkosi.1.md

index f0964b6f417bcc74db4a79437cc03d886e140f1c..4ee51da326a84cf2821ee1ad147e8c89ca6a72c7 100644 (file)
@@ -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(
index e3f95170e86e40fd0de34dea3ab59b0886d61fc6..99f683b211eefc6c3a0b67f31cee7823ad559866 100644 (file)
@@ -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