From 3b3fffb36b109bc51ed6e0ca5e034dfe2fe5ea35 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 21 Sep 2021 08:13:06 -0400 Subject: [PATCH] Note workaround for 'No data available' In a diskless boot, sometimes the build system might not label the scratch contents correctly. setfiles can be used to fix it. Notably, this seems to cause the overlay+squashfs to return 'no data available' on select calls even with selinux disabled, so it may be another gap with overlay and/or limitation of squashfs when queried about modification without a label. --- imgutil/imgutil | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/imgutil/imgutil b/imgutil/imgutil index d0389cd2..5b503603 100644 --- a/imgutil/imgutil +++ b/imgutil/imgutil @@ -525,6 +525,10 @@ class ElHandler(OsHandler): cmd.extend(glob.glob(os.path.join(targdir, '*'))) subprocess.check_call(cmd) subprocess.check_call(['yum'] + self.yumargs) + # note that in some cases, may need to fix labels for function even without selinux + # for now a TODO, but note the command to repair a scratch directery if needed + # can be done by unpack, setfiles, then pack again too + #setfiles -r buildscratch /etc/selinux/targeted/contexts/files/file_contexts buildscratch def versionize_string(key):