vsock: ConfigFeature
vsock_cid: int
tpm: ConfigFeature
- cdrom: bool
removable: bool
firmware: Firmware
firmware_variables: Optional[Path]
compat_names=("QemuSwtpm",),
scope=SettingScope.main,
),
- ConfigSetting(
- dest="cdrom",
- name="CDROM",
- metavar="BOOLEAN",
- section="Runtime",
- parse=config_parse_boolean,
- help="Attach the image as a CD-ROM to the virtual machine",
- compat_longs=("--qemu-cdrom",),
- compat_names=("QemuCdrom",),
- scope=SettingScope.main,
- ),
ConfigSetting(
dest="removable",
metavar="BOOLEAN",
VSock: {config.vsock}
VSock Connection ID: {VsockCID.format(config.vsock_cid)}
TPM: {config.tpm}
- CD-ROM: {yes_no(config.cdrom)}
Firmware: {config.firmware}
Firmware Variables: {none_to_none(config.firmware_variables)}
Linux: {none_to_none(config.linux)}
):
cmdline += [f"systemd.hostname={config.machine}"]
- if config.cdrom:
- # CD-ROMs are read-only so tell systemd to boot in volatile mode.
- cmdline += ["systemd.volatile=yes"]
-
if config.console != ConsoleMode.gui:
cmdline += [
f"systemd.tty.term.console={term}",
"-global", "driver=cfi.pflash01,property=secure,value=on",
] # fmt: skip
- if config.cdrom and config.output_format in (OutputFormat.disk, OutputFormat.esp):
- # CD-ROM devices have sector size 2048 so we transform disk images into ones with sector size
- # 2048.
- src = (config.output_dir_or_cwd() / config.output_with_compression).resolve()
- fname = src.parent / f"{src.name}-{uuid.uuid4().hex}"
- run(
- [
- "systemd-repart",
- "--definitions=/",
- "--no-pager",
- "--pretty=no",
- "--offline=yes",
- "--empty=create",
- "--size=auto",
- "--sector-size=2048",
- "--copy-from", workdir(src),
- workdir(fname),
- ], # fmt: skip
- sandbox=config.sandbox(
- options=[
- "--bind", fname.parent, workdir(fname.parent),
- "--ro-bind", src, workdir(src),
- ],
- ),
- ) # fmt: skip
- stack.callback(lambda: fname.unlink())
- else:
- fname = stack.enter_context(
- copy_ephemeral(config, config.output_dir_or_cwd() / config.output_with_compression)
- )
+ fname = stack.enter_context(
+ copy_ephemeral(config, config.output_dir_or_cwd() / config.output_with_compression)
+ )
apply_runtime_size(config, fname)
]
device_type = "virtio-blk-pci"
- if config.cdrom:
- device_type = "scsi-cd,device_id=mkosi"
- elif config.removable:
+ if config.removable:
device_type = "scsi-hd,device_id=mkosi,removable=on"
cmdline += [
: Configure whether to use a virtual TPM when booting a virtual machine.
Takes a boolean value or `auto`. Defaults to `auto`.
-`CDROM=`, `--cdrom=`
-: Configures whether to attach the image as a CD-ROM device when booting a
- virtual machine. Takes a boolean value. Defaults to `no`.
-
`Removable=`, `--removable=`
: Configures whether to attach the image as a removable device when booting
a virtual machine. Takes a boolean value. Defaults to `no`.
positive and negative globs. The new option is FirmwareFiles=.
- The `RuntimeScratch=` option has been dropped. Use `RuntimeSize=`
instead to grow the image before booting it.
+- The `CDROM=` option has been dropped.
## v25
if config.firmware == Firmware.bios:
die("systemd-vmspawn cannot boot BIOS firmware images")
- if config.cdrom:
- die("systemd-vmspawn does not support CD-ROM images")
-
if config.bind_user:
die("systemd-vmspawn does not support --bind-user=")
],
"BuildSourcesEphemeral": "yes",
"BuildSubdirectory": "abc/abc",
- "CDROM": false,
"CPUs": 2,
"CXL": false,
"CacheDirectory": "/is/this/the/cachedir",
cache_dir=Path("/is/this/the/cachedir"),
cache_key="qed",
cacheonly=Cacheonly.always,
- cdrom=False,
checksum=False,
clean_package_metadata=ConfigFeature.auto,
clean_scripts=[Path("/clean")],