Today I had an eureka moment. I installed a full install of Slacko Puppy Linux to an f2fs formatted flash stick, booted and surfed the net. Has anyone done that yet?
The kernel is k3.4.52 patched with f2fs patches from Now Computing. I had to hack them a bit because the developer is only supporting k’s 3.0, 3.2, 3.5 and 3.8. I also patched the kernel for AUFS as we do in Puppy.
The unique problem here is that no bootloader supports f2fs at the time of writing. The work around is to first create a small boot partition in a recognised format such as vFAT, ext2, 3 or 4. Then you can boot the stick with grub (I used grub4dos). You could probably use syslinux, grub2 or even lilo.
In the boot partition you create a /boot directory that contains the kernel image (vmlinuz) and an initrd (in my case initrd,gz). Now in my kernel configuration I have all the relevant drivers that I need as builtins however using an initrd it would work just the same to have hid, usbhid, ehci-hcd, uhci-hcd and f2fs as modules and just load them. In fact, in my init script I have those loading anyway with the error sent to /dev/null. Of course you need a tree with the appropriate modules in the appropriate places, busybox, the necessary mount points and so on.
The real trick was to find the root partition which was on /dev/sdb2, however that would not work, nor would sda2, which probably should have since I wasn’t loading any other filesystems and the only builtin is ext2 (I was using FAT32 on my boot partition). My hard drive is formatted NTFS and ext4. I achieved this by using the UUID in the init script itself. You could just as easy have a config file that init reads. Once the root filesystem is mounted you then switch root in to the running systems as with any other initrd.
Thanks have to go out to Barry Kauler for integrating f2fs into Puppy Linux infrastructure and for some of the code from his init script. My init script uses some of that but uses a directory structure based on Slackware’s initrd and some of the code from Pat Volkerding’s init script too.
I’ll post the code and documentation at a later date.
Any questions, ask in the comments.