From: Daan De Meyer Date: Sat, 2 Nov 2024 15:09:29 +0000 (+0100) Subject: Ignore crypto mount if it only contains empty directories X-Git-Tag: v25~188^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3df573ad6a61dd57d4b17c94d0794052d102e4ff;p=thirdparty%2Fmkosi.git Ignore crypto mount if it only contains empty directories Let's beef up the crypto mount check and check if there are only empty directories in the mount and ignore it if that's the case. This handles the case where e.g. on Arch installing pesign leads to /etc/pki containing only /etc/pki/pesign as an empty directory. --- diff --git a/mkosi/mounts.py b/mkosi/mounts.py index 966f0aa2f..e86c4463d 100644 --- a/mkosi/mounts.py +++ b/mkosi/mounts.py @@ -97,7 +97,7 @@ def finalize_crypto_mounts(config: Config) -> list[PathString]: Path("etc/ca-certificates"), Path("var/lib/ca-certificates"), ) - if (root / subdir).exists() + if (root / subdir).exists() and any(p for p in (root / subdir).rglob("*") if not p.is_dir()) ] # This contains the Arch Linux keyring, which isn't certificates so ToolsTreeCertificates= doesn't apply.