Skip to content

Commit

Permalink
burn: Fail if no arguments are provided
Browse files Browse the repository at this point in the history
If no arguments are provided systemd-repart will operate on the
device backing the rootfs which in the case of burn we definitely
don't want to do most of the time so let's fail unless a device is
explicitly provided.
  • Loading branch information
DaanDeMeyer committed Dec 20, 2024
1 parent ba07d53 commit 668048b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mkosi/burn.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ def run_burn(args: Args, config: Config) -> None:
if config.output_format not in (OutputFormat.disk, OutputFormat.esp):
die(f"{config.output_format} images cannot be burned to disk")

if not args.cmdline:
die("Please specify a device to burn the image to", hint="For example /dev/sdb")

fname = config.output_dir_or_cwd() / config.output

if len(args.cmdline) != 1:
Expand Down

0 comments on commit 668048b

Please sign in to comment.