Closed ajherchenroder closed 1 month ago
Opened PR 450 to fix this issue.
What's the usecase for the /dev
nodes in chroot?
chroot-like modes, such as bubblewrap, where ${CHROOT} = True
, cannot use mknod
.
This came up after the bootstrap completed. I tried to mount a usb stick to the completed bootstrap to move some files onto the system. I was unable to so because there were no dev nodes to mount to. I didn’t have any issues with mknod. It worked just fine in a chroot and I was able to mount the usb stick after making the required changes.
In general, I don't think we want to have device nodes created in the chroot - rather, /dev
should be mounted into the chroot if someone wanted to have a full set of device nodes in the chroot. (Even in the QEMU/bare metal bootstrap, we use devtmpfs in the final system). @Googulator @stikonas thoughts on this?
Side note:
mknod
does work fine in a chroot, as you said. However, we have multiple chroot-like ways of running the bootstrap, eg --chroot
and --bwrap
. All of those set ${CHROOT} = True
. With --bwrap
, mknod cannot be used. See your CI run on your PR as an example, https://github.com/fosslinux/live-bootstrap/actions/runs/8310544927/job/22743172074?pr=450.
I would lean towards manually creating device nodes after bootstrap. I've done this recently too on a UEFI only system (without kernel bootstrap as this is not supported yet) and for various reasons I had to set CHROOT = True
in this mode (mainly to turn off non-working kernel bootstrap). If I remember correctly, after bootstrap I manually created device nodes.
Also as you say bwrap
mode does not even support mknod
and bwrap
is preferred mode for testing on existing Linux as it is rootless.
Based on the consensus I will close this issue and take care of it in an “after” script
I was testing a chroot build when I noticed that the majority of the /dev nodes were missing. I realized that the host’s nodes aren’t passed through and the bootstrap deliberately doesn’t add them during the bootstrap. I made a quick patch that ungates adding the remaining /dev nodes that I can add as a PR if you want. The question is if this is the correct approach? The other alternative is to mount the host OS’s /dev nodes during a chroot. What’s the team’s thoughts on the best way to go?