containers / composefs

a file system for mounting container images

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ostree integration: erofs mount missing?

ldts opened this issue · comments

I recently integrated composefs with OStree in our meta-lmp releases at Foundries.io; this is still work in progress in a private repository until we do more verifications but very likely to be released to all the platforms that we support in a couple of months

root@intel-corei7-64:/# findmnt /
TARGET SOURCE  FSTYPE  OPTIONS
/      overlay overlay ro,relatime,lowerdir=/run/ostree/.private/cfsroot-lower::/sysroot/ostree/repo/objects,redirect_dir=on,metacopy=on

root@intel-corei7-64:/# cat /proc/cmdline 
initrd=\ostree\lmp-8c283ddf8b305aa9ebff637f21d57d5cef8887bd99a37f986741c978121ea6bf\initramfs-6.6.21-lmp-standard.img console=ttyS0,115200 root=LABEL=otaroot rootfstype=ext4 ostree=/ostree/boot.1/lmp/8c283ddf8b305aa9ebff637f21d57d5cef8887bd99a37f986741c978121ea6bf/0

root@intel-corei7-64:/# mount | grep overlay  
overlay on / type overlay (ro,relatime,lowerdir=/run/ostree/.private/cfsroot-lower::/sysroot/ostree/repo/objects,redirect_dir=on,metacopy=on)

root@intel-corei7-64:/# mount | grep ero 

One thing I am missing is where the erofs mount is happening. Is this not visible as a mounted partition somewhere?

The mount is happening as part of ostree-prepare-root.service from ostree, which just calls into the composefs libraries to do the mount.

The answer to your question (btw, this seems better as a discussion e.g.) is that the erofs mount is unmounted from the global namespace here:

umount2(imagemount, MNT_DETACH);

because it's an implementation detail. The overlayfs mounted on top holds a reference.

ahh, thanks a lot for the information @cgwalters

That said at least for debugging/introspection I could see it being useful to have an option to not unmount the erofs and leave it mounted somewhere. Or maybe it's even possible to somehow get access to the hidden mount from userspace, but AFAIK it's not currently.