containers / initoverlayfs

GNU General Public License v2.0
40 stars 8 forks source link

Document how initoverlayfs works under the hood #26

Closed jlebon closed 10 months ago

jlebon commented 1 year ago

The project name includes "overlayfs" but the README doesn't mention where overlayfs is actually used. Maybe a small section in the README that describes how each component is built and then goes through the boot flow step-by-step from the initramfs to the initoverlayfs?

ericcurtin commented 1 year ago

I'm in the middle of updating the readme, thanks for the feedback will add.

ericcurtin commented 1 year ago

It's an erofs + overlayfs, it's very similar to the rpm-ostree usroverlay feature... Technically the underlying filesystem doesn't have to be erofs, but it's the fs that makes the most sense early boot.

ericcurtin commented 1 year ago

Hence overlayfs is in the name and not erofs... And it's the overlay that creates the transient behaviour...

ericcurtin commented 12 months ago

@jlebon I updated the doc to describe the boot flow (I should have assigned you to that PR, but we can still make further changes):

https://github.com/containers/initoverlayfs#what-is-initoverlayfs

fw -> bootloader -> kernel -> mini-initramfs -> initoverlayfs -> rootfs

fw -> bootloader -> kernel -> storage-init   -> init ----------------->

init in the above boot flow is systemd, I just call it init, because this is open to other init processes being supported if a willing contributor really wanted to add support for another init system.

To build the mini-initramfs and initoverlayfs, we just use dracut, again though we are open to other initial filesystem building tools... Some of this is configurable already...

https://github.com/containers/initoverlayfs/blob/main/bin/initoverlayfs-install

In the initoverlayfs case it is basically converted to an erofs, and again we are open to other filesystems that support overlayfs if a willing contributor wants to step up and add support.

But erofs with compression is pretty darn fast.

ericcurtin commented 12 months ago

initoverlayfs-install is kinda like a dracut -f, it's a wrapper around other tools.

jlebon commented 10 months ago

Thanks! The new README looks good.