Arch Linux ARM (ALARM) with F2FS root

Post Reply
CarlGauss
Posts: 13
Joined: Sun Mar 13, 2016 2:25 am
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Arch Linux ARM (ALARM) with F2FS root

Unread post by CarlGauss » Sun Mar 13, 2016 3:53 am

I wanted to use F2FS as my rootfs with my Arch installation. The installation guide is set up to use ext4. https://archlinuxarm.org/platforms/armv ... stallation Also, unlike the official Ubuntu image, the ALARM guide says to use only 1 partition. To my knowledge UBoot can't read F2FS so there needs to be a separate /boot partition like what is on the official image to hold the kernel, bootloader, and uboot config. This is where the problem arises. The version of Uboot that ALARM is shipped with seems to be hardcoded to look for the file "/boot/boot.ini" on the first partition. Since I'm using a separate partition for '/boot/' I want to it look at '/boot.ini' on the first partition. The fix was to make a /boot folder on my first partition and put all the files in there. It boots fine but then had to use mount bind to properly mount it to /boot in the root filesystem. I mounted /dev/mmcblk0p1 to /media/part1 then used mount bind to bind /media/part1/boot with /boot. I used FAT for my first partition but I believe any U-boot supported FS would work.

Here's my /etc/fstab generated for genfstab:

Code: Select all

/dev/mmcblk0p2      	/         	f2fs      	rw,relatime,background_gc=on,active_logs=6	0 0
/dev/mmcblk0p1      	/media/part1	vfat      	rw,relatime,errors=remount-ro	0 2
/media/part1/boot    	/boot     	none      	rw,relatime,errors=remount-ro,bind	0 0
Also the 'boot.ini' needs to be updated to tell the kernel the rootfs is F2FS and that is it on the second partition. Change root and add rootfstype in bootargs.

Code: Select all

setenv bootargs "root=/dev/mmcblk0p2 rootwait rw ${condev} no_console_suspend hdmimode=${m} m_bpp=${m_bpp} vout=${vout} fsck.fix=yes rootfstype=f2fs"
This is how I got ALARM working with F2FS. I don't know if there a easier way to deal with U-Boot.

rpcameron
Posts: 278
Joined: Sat Apr 30, 2016 7:24 am
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Arch Linux ARM (ALARM) with F2FS root

Unread post by rpcameron » Sun May 01, 2016 5:06 am

I just received my C2 yesterday, and got Arch set up on it this afternoon. I was looking for something similar to this, as I've got it installed on an eMMC and wanted the improvements that F2FS would bring.

I simplified this process a little bit by creating my boot partition (mmcblk0p1) as ext2, and then creating a link at the root of the partition named 'boot' that redirects to '.'. That way I don't have to deal with bind mounts. (I was hoping that U-Boot needing the files in /boot would have been fixed, but I think this is easier than having a bind mount.)

rpcameron
Posts: 278
Joined: Sat Apr 30, 2016 7:24 am
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Arch Linux ARM (ALARM) with F2FS root

Unread post by rpcameron » Wed May 04, 2016 5:32 am

It's interesting. I've also modified my boot.ini so the `mmc load` statements look like:

Code: Select all

load mmc 0:1 ${loadaddr} /Image
load mmc 0:1 ${dtb_loadaddr} /dtbs/meson64_odroidec2.dtb
load mmc 0:1 ${initrd_loadaddr} /initramfs-linux.img
(editing out the `/boot` that each file was prefixed with), and the C2 still failed to boot if it could not find the files in `/boot` of the referenced partition. So, I am back to having a link in the root of my boot partition named `boot` that redirects to `.`.

CarlGauss
Posts: 13
Joined: Sun Mar 13, 2016 2:25 am
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Arch Linux ARM (ALARM) with F2FS root

Unread post by CarlGauss » Wed May 25, 2016 4:26 am

I thought the problem was hard coded and I was right. Here it is (https://github.com/archlinuxarm/PKGBUIL ... ions.patch) This is PKGBUILD for the uboot-odroid-c2. You see that on line 19 ALARM patches the uboot source so that uboot looks for the boot.ini at '/boot/boot.ini' of the first partition. That changes it from looking for boot.ini in '/boot.ini' on the first partition. That's because uboot supports booting from Ext4. ALARM uses only one Ext4 parition However F2FS needs its a separate /boot partition so uboot can boot the kernel, then the kernel reads the F2FS root. The ODROID's official Ubuntu image uses the same model of having a separate boot partition (even though it could use just one partition. I believe ext4 support for uboot is fairly new).

The solution is to use the somewhat dirty hack I used above or recompile uboot. I might find time to create a 'uboot-odroid-c2-f2fs' PKGBUILD or package. That patch needs to be removed and the boot.ini needs to be changed then it would support booting from the first parition without that fix.

rpcameron
Posts: 278
Joined: Sat Apr 30, 2016 7:24 am
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Arch Linux ARM (ALARM) with F2FS root

Unread post by rpcameron » Sun May 29, 2016 4:38 am

Thanks for the link to the PKGBUILD. I can see exactly what the problem is. However, I've noticed incredible lag at times for anything that requires writing to the filesystem. I think this is because of the kernel version used, and the state of the F2FS code in that particular version. So, I'm switching back to a single EXT4 partition, and hopefully the eMMC interface will help make up for the speed differences.

Post Reply

Return to “Other OS”

Who is online

Users browsing this forum: No registered users and 2 guests