fix: preserve /var/tmp for akmods builds #47
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes a problem I noticed when I switched my "custom kmod image" to be based on this nvidia image rather than the stock silverblue image.
Problem
akmods fail to build with message
Unable to open temp file: Permission denied"
if theFROM
image is one of these ublue-os nvidia images.Explanation
The original silverblue image includes
/var/tmp
with normal sticky bit perms, while this image removes/var
as part of build cleanup.The lack of
/var/tmp
causes rpmbuilds (eg, akmod builds) to fail on any container builds which useublue-os/nvidia
images as their base because the akmod build will create /var/tmp using the default umask (0022)./var/tmp
then lacks proper permissions, and akmods fail to create a tmp dir for builds, since/var/tmp
gets created by root, butakmods
builds run as a user.Solution
Preserve
/var/tmp
with correct permissions.The interesting thing is, I had assumed that the
rm -rf /var/*
was the cause of the problem, but,ostree container commit
actually removes/var
from the image even when it still contains files.See the code blocks for contrast of
/var/tmp
filesystem state on the respective images andostree container commit
behavior.stock silverblue /var/tmp state
ublue-os/nvidia silverblue /var/tmp state
stock silverblue ostree container commit behavior