From: Daan De Meyer Date: Thu, 8 Sep 2022 09:17:52 +0000 (+0200) Subject: Merge pull request #1176 from DaanDeMeyer/know-arg-stdout-devnull X-Git-Tag: v14~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=967dc6da1ab8144c570eead391e5d1d2d99c2175;p=thirdparty%2Fmkosi.git Merge pull request #1176 from DaanDeMeyer/know-arg-stdout-devnull Send stdout to devnull when checking nspawn known arg --- 967dc6da1ab8144c570eead391e5d1d2d99c2175 diff --cc mkosi/backend.py index 911d6620c,d5c31b347..4c5378213 --- a/mkosi/backend.py +++ b/mkosi/backend.py @@@ -657,8 -647,19 +657,13 @@@ def workspace(root: Path) -> Path return root.parent -def var_tmp(root: Path) -> Path: - p = workspace(root) / "var-tmp" - p.mkdir(exist_ok=True) - return p - - def nspawn_knows_arg(arg: str) -> bool: - return "unrecognized option" not in run([nspawn_executable(), arg], stderr=subprocess.PIPE, check=False, text=True).stderr + # Specify some extra incompatible options so nspawn doesn't try to boot a container in the current + # directory if it has a compatible layout. + return "unrecognized option" not in run([nspawn_executable(), arg, + "--directory", "/dev/null", "--image", "/dev/null"], + stdout=subprocess.DEVNULL, stderr=subprocess.PIPE, check=False, + text=True).stderr def format_rlimit(rlimit: int) -> str: