]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Copy existing crypto policies from the host into package manager tree
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 6 Mar 2024 19:53:11 +0000 (20:53 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 6 Mar 2024 21:51:10 +0000 (22:51 +0100)
apt on Fedora uses gnutls which requires
/etc/crypto-policies/back-ends/gnutls.config to work properly. Let's
copy the default crypto policies from the tools tree into the package
manager tree to make sure things keep working.

mkosi/__init__.py

index 30f33a2124025422f9778cf2dec79e6303956a17..3c24921481cc86f62c3e7ee6dbfb7eb607449875 100644 (file)
@@ -1479,6 +1479,15 @@ def install_package_manager_trees(context: Context) -> None:
             passwd.write(f"{name}:x:{INVOKING_USER.uid}:{INVOKING_USER.gid}:{name}:{home}:/bin/sh\n")
         os.fchown(passwd.fileno(), INVOKING_USER.uid, INVOKING_USER.gid)
 
+    if (p := context.config.tools() / "etc/crypto-policies").exists():
+        copy_tree(
+            p, context.pkgmngr / "etc/crypto-policies",
+            preserve=False,
+            dereference=True,
+            tools=context.config.tools(),
+            sandbox=context.config.sandbox,
+        )
+
     if not context.config.package_manager_trees:
         return