-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
dkms does not appear to be chroot safe #145
Comments
Here is an example diff for a workaround we used:
This gets status working in a chroot w/o /dev/, /sys/, and so forth. A better solution might be to use local variables (e.g. no temp file), but hopefully this can help to get started. |
@gts-cray can you make that a MR + ideally some tests? Glancing at the latest code - we have a So as-is the diff pasted is very incomplete. I'm more concerned that that w/o any tests, we'll end up breaking it all the time. |
It looks like recently in commit 5111f9c additional checks were put in that definitely don't solve this but give a warning instead. @evelikov, the most obvious automated test for this would need to start a container or a chroot environment, requiring some degree of privilege when running the tests (or at least a software stack supporting user namespaces). An alternative if the bash process substitution ( |
@dmjacobsen thanks for pointing that commit - I already had a look at it while it was proposed. Our test suite is based on Github Actions, which uses docker + containers under the hood. Seems like you have some ideas already, so if you can put those in terms of PR that would be great. |
Please check the latest version, the code has been refactored many times since this bug was opened. In the unlikely event the issue is still there, please open another bug. Thanks. |
It appears that
dkms
does not work correctly in a chroot environment. You can see an example of this by simply doing:smw:/image_roots # chroot my_image_root/
smw:/ # dkms status
/usr/sbin/dkms: line 1980: /dev/fd/62: No such file or directory
/usr/sbin/dkms: line 1912: /dev/fd/62: No such file or directory
smw:/ #
The reason this is important is many HPC cluster management systems build images off-line in a chroot prior to deployment. And we have been encountering packages that use dkms in the rpm post install scriptlets and these packages fail to install in these contexts.
A lot of these systems use
zypper
under the covers, like:smw:/ # zypper --root /image_roots/my_image_root install rocm-dkms
It seems the issue is that some of the functions in dkms rely on on the shell mechanism described here:
https://unix.stackexchange.com/questions/156084/why-does-process-substitution-result-in-a-file-called-dev-fd-63-which-is-a-pipe#:~:text=So%20%2Fdev%2Ffd%2F63,output%20of%20your%20ls%20call.
If those functions could be refactored not to use that mechanism, it seems like dkms should work in the
zypper --root
context, and if that worked, it should work for this whole class of cluster management systems.The text was updated successfully, but these errors were encountered: