From: Daan De Meyer Date: Fri, 20 Dec 2024 14:12:06 +0000 (+0100) Subject: burn: Fail if no arguments are provided X-Git-Tag: v25~97 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=404760ac469b40e6575437e82f2f30e1134728b6;p=thirdparty%2Fmkosi.git burn: Fail if no arguments are provided 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. --- diff --git a/mkosi/burn.py b/mkosi/burn.py index 07aacdc79..24eee942f 100644 --- a/mkosi/burn.py +++ b/mkosi/burn.py @@ -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/disk/by-id/usb-foobar") + fname = config.output_dir_or_cwd() / config.output if len(args.cmdline) != 1: