Closed drakes00 closed 3 years ago
@drakes00, thanks for your detailed bug report!
Right, you discovered an issue with our approach to identify the kernel-headers in Debian distro. Basically, we are relying on the "find" instruction that you pasted above, to identify the outermost kernel-component folder referenced within the kernel-headers directories, so that we can mount all the headers into the Sysbox build-container. Unfortunately, Debian in your machine is making use of this ../../
pattern to refer to some components of its tool-chain (scripts & tools), which is one-level higher than expected in the file-system hierarchy. This is the reason we are attempting to mount /usr/src/..
as you pointed out.
For some reason I don't see this ../..
path pattern in my local Debian Buster machine, and that explains why this issue was not caught by our integration-tests suites. Anyhow, I clearly see room for the behavior you described above, so we need to fix this issue.
Will get back to you shortly with a quick workaround.
@drakes00 , please apply this change to Sysbox's Makefile to fix the issue. I'm simply skipping softlinks that refer to elements outside "/usr/src" path.
$ sed -i 's/cut -d\"\/\" -f2/cut -d\"\/\" -f2 | egrep -v "^\\.\\."/' Makefile
Will send fix for review in a few mins.
@drakes00, fix just went in, hope that fully fixes this one for you.
Problem fixed. Closing issue now.
Sorry for late reply. Thanks a lot for the quick fix! :-)
Hi,
I'm trying to install sysbox for Debian buster. It doesn't seem possible to use Ubuntu release packages (not really surprising):
However, when I'm trying to compile from source, Makefile relies first builds sysbox-test image (all good here). Then it tries to launch it through docker and it seems that computing the KERNEL_HEADERS_BASE variable fails somehow, leading it to be "..". That causes the whole
docker run
command to mount/usr/src/..
in the build container, overriding everything copied by the Dockerfile into/usr/bin
:Some info:
I don't mind helping with PR but I'm not sure how this path resolution is supposed to end. Should it mount /usr/src ? /usr/src/linux-headers-$(whatever-version) ?
Thanks for the help, Kind regards, Maxime