From: Daan De Meyer Date: Tue, 2 Jul 2024 19:58:02 +0000 (+0200) Subject: Fix disk image check X-Git-Tag: v24~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b317cb4b9cc3a6acdbe45866eba4cf5bdc8760e;p=thirdparty%2Fmkosi.git Fix disk image check --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index fdfaa99be..95997ea3e 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -2787,7 +2787,7 @@ def check_inputs(config: Config) -> None: if not base.exists(): die(f"Base tree {base} not found") - if base.suffix == ".raw" and os.getuid() != 0: + if base.is_file() and base.suffix == ".raw" and os.getuid() != 0: die("Must run as root to use disk images in base trees") if config.tools_tree and not config.tools_tree.exists(): @@ -2800,7 +2800,7 @@ def check_inputs(config: Config) -> None: if not tree.source.exists(): die(f"{name.capitalize()} tree {tree.source} not found") - if tree.source.suffix == ".raw" and os.getuid() != 0: + if tree.source.is_file() and tree.source.suffix == ".raw" and not tree.target and os.getuid() != 0: die(f"Must run as root to use disk images in {name} trees") if config.bootable != ConfigFeature.disabled: