From 2efdbe02776f2ca5b239298ecc67c957257bcffe Mon Sep 17 00:00:00 2001 From: Achilleas Koutsou Date: Mon, 2 Jan 2023 19:50:47 +0100 Subject: [PATCH] stages/rhsm.facts: create facts file in /etc Instead of creating the file in /usr/share and symlinking to /etc, create it directly in /etc. This fixes an issue with SELinux labeling. The file in /usr/share does not get labelled correctly because it doesn't match the policy and causes issues with some tools (rhc). See rhbz#2147450. --- stages/org.osbuild.rhsm.facts | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/stages/org.osbuild.rhsm.facts b/stages/org.osbuild.rhsm.facts index 75f1e249..848082cd 100755 --- a/stages/org.osbuild.rhsm.facts +++ b/stages/org.osbuild.rhsm.facts @@ -22,21 +22,14 @@ SCHEMA = r""" def main(tree, options): - path = os.path.join(tree, "usr/share/osbuild/self") - file = os.path.join(path, "rhsm.facts") + path = os.path.join(tree, "etc/rhsm/facts") + file = os.path.join(path, "osbuild.facts") os.makedirs(path, exist_ok=True) with open(file, "x", encoding="utf8") as f: json.dump(options["facts"], f) - os.makedirs(os.path.join(tree, "etc/rhsm/facts"), exist_ok=True) - - os.symlink( - "/usr/share/osbuild/self/rhsm.facts", - os.path.join(tree, "etc/rhsm/facts/osbuild.facts"), - ) - return 0