I recently needed a 2.6.23 kernel running with a read-only root fs, so I applied the corresponding unionfs patch from their official homepage, and ran genkernel with UNIONFS="no" in /etc/genkernel.conf. On this course I found out that later unionfs versions don't support unionctl any more to administer the stacking, only the "mount -oremount" method is supported. In order to get unionfs working again, generic/initrd.scripts:union_insert_dir() needs to be modified. Removing the lines with "BRANCH_0" and "/sbin/unionctl", putting this line in their place did the trick for me: mount -t unionfs -oremount,add=:$2=ro none $1 As a nice side effect, unionctl will be no longer needed in the initrd :) PS: Don't know if this already works with the unionfs version that genkernel uses today. Reproducible: Always
In 3.4.10_pre, unionfs support has been removed completely, since the only current versions require kernel patching and the tools no longer work.
I see. About the tools, that was exactly what I was trying to help fix. The unionfs support in genkernel was useful for read-only root situations. As far as I understand, the LiveCD also has to solve this somehow. So, is there a new way in gentoo to handle a read-only root? The "old method" from http://gentoo-wiki.com/HOWTO_Read-only_root_filesystem doesn't look very attractive to me...
Ok, I did RTFS. The volatile stuff is copied to newroot and the rest is symlinked in. But it's only done if CDROOT=1, couldn't this be made more generic? Like with an extra boot parameter RO or such? The real root would need to be mounted into something like /newroot/rw-root though since in the general case there is no loop device involved...
I've reimplemented unionfs support in genkernel with unionfs-fuse. There's currently no control mechanism (unionfs_insert_dir() is gone), since unionfs-fuse doesn't currently support it. However, the remount method *might* work. I don't currently see a need for it, though. You can test the new implementation by emerging genkernel-9999 enabling support for FUSE (built-in or module) in your kernel, and running genkernel with --unionfs or setting UNIONFS=1 in your genkernel.conf.
The experimental fuse unionfs support didn't work properly (none of the implementations support unionfs as / properly). We'll revisit this once there's proper unionfs/aufs/etc. support in the upstream kernel (or at least gentoo-sources)