Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

image should not contain folders /run /sys /proc /dev #276

Open
adrelanos opened this issue Apr 25, 2024 · 3 comments
Open

image should not contain folders /run /sys /proc /dev #276

adrelanos opened this issue Apr 25, 2024 · 3 comments

Comments

@adrelanos
Copy link
Contributor

Image should not contain folders /run /sys /proc /dev. These should be deleted at the end of the build process.

Rationale:

  • These don't belong there. Serve no purpose. Are instantiated during the boot process.
  • Are confusing dracut. Relevant code excerpt:

https://github.com/dracutdevs/dracut/blob/master/modules.d/90dmsquash-live/dmsquash-live-root.sh

    elif [ -d /run/initramfs/squashfs/proc ]; then
        FSIMG=$SQUASHED
        if [ -z "$overlayfs" ] && [ -n "$DRACUT_SYSTEMD" ]; then
            reloadsysrootmountunit=":>/xor_overlayfs;"
        fi
        overlayfs="required"

(Some dracut internals: Folder /run/initramfs/squashfs/proc is inside the LiveOS/squashfs.img, which can be based on grml-debootstrap (and created by mksquashfs). An image containing an already existing /proc folder can be useful for I don't know what. But either the /proc folder should be complete. This is probably for a complex use case we don't know about. Absent of this, best if the /proc folder doesn't exist. There should not be an empty folder /proc inside the image.)

Would a PR deleting these folders be welcome?

@mika
Copy link
Member

mika commented Apr 25, 2024

Hm interesting. Long time ago™ /proc, /sys, /dev etc were all necessary because they weren't necessarily created during initrd phase automatically, but AFAICS at least since ~2006 those are all created at least in initramfs-tools based initramfs automatically during bootup, and for sure dracut (which showed up only after i-t) also will handle those automatically.

But, chroot-ing to such a system without having /proc, /sys + /dev available for mount --bind, mount -t proc none /proc could be annoying?

@adrelanos
Copy link
Contributor Author

Interesting. I was thinking, for chrooting you'll need scripting to some tool anyhow.

Actually, I might have been wrong about dracut or it's a dracut bug. Let's see what they reply.

So while my argument might be be correct, it might also currently break dracut based live ISOs.

I am not so sure about this now anymore. Is there a standard or convention how other/most distributions / images handle this?

@mika
Copy link
Member

mika commented Apr 26, 2024

I'm not aware of systems that don't provide /proc, /sys + /dev on their filesystem, might be done for some images where you don't directly chroot into and don't care about it therefore. But IMO tools failing because /proc, /sys + /dev as directories exist as such (instead of actually checking for their mount points or content) is wrong, so I'd tend to not change anything in grml-debootstrap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants