compressed f2fs for rootfs on microsd on chromebooks

This is for ARMv8 based devices

compressed f2fs for rootfs on microsd on chromebooks

Postby pierro78 » Fri Jul 19, 2024 9:14 am

TESTED ON ASUS C101 chromebook but I think it should work on most archlinuxarm supported chromebooks !!
(see resolution in notes below ... I can write a "guide" if somebody is interested ;) ,,,)

---


hello dear archlinuxarm experts and folks,
got archlinuxarm with mainline kernel installed on a microsd card in my asus c101 chromebook ... working great but a bit slow when starting/using big programs like chromium.
now I would like to use f2fs [b]with [/b]recommended compression [b]options[/b] for better performance and less wear ( compress_algorithm=zstd:6,compress_chksum,atgc,gc_merge,lazytime as per archlinux wiki)
... but I am looking for help on how to do that :
Could it work if, from my current ext4 installation, I create another installation on a f2fs partition on another microsd as per themake_clickable_callback(MAGIC_URL_FULL, ' ', 'https://archlinuxarm.org/platforms/armv8/rockchip/asus-chromebook-flip-c101pa', '', ' class="postlink"') installation guide but maybe I d need to chroot to the new rootfs and install linux-aarch64 linux-aarch64-chromebook f2fs-tools and "flash" the kernel to the kernel partition ... but then [b]how would I pass [/b]the compress_algorithm=zstd:6,compress_chksum,atgc,gc_merge,lazytime [b]f2fs rootfs options to the kernel [/b]? can the fstab be used to configure the boot system ?
(for info here is my current /proc/cmdline :
[i]pierro78@alarm ~]$ cat /proc/cmdline
cros_secure console=tty0 console=ttyS2,115200n8 earlyprintk=ttyS2,115200n8 console=ttyMSM0,115200n8 init=/sbin/init root=PARTUUID=4e48e75a-b9bd-3f47-bd6d-001e06aec593/PARTNROFF=1 rootwait rw noinitrd
[pierro78@alarm ~]$ [/i]
so it looks like the kernel is given the info on where the rootfs is but I don't know how it's done ... )
Thanks for any help !
Pierre
Last edited by pierro78 on Sun Jul 21, 2024 11:01 pm, edited 2 times in total.
pierro78
 
Posts: 9
Joined: Sun Nov 06, 2016 9:24 pm

Re: f2fs for rootfs on microsd in asus c101 chromebook ? hel

Postby pierro78 » Fri Jul 19, 2024 8:54 pm

as per make_clickable_callback(MAGIC_URL_LOCAL, ' ', 'https://archlinuxarm.org/forum', 'viewtopic.php?f=60&t=9373', ' class="postlink-local"')
I can use vbutil_kernel --verbose --verify vmlinux.kpart (vboot-utils package) to find
my kernel Config:
console=ttyS2,115200n8 earlyprintk=ttyS2,115200n8 console=tty1 init=/sbin/init root=PARTUUID=%U/PARTNROFF=1 rootwait rw noinitrd

so maybe if I knew how to repack vmlinux.kpart with rootflags=compress_algorithm=zstd:6,compress_chksum,atgc,gc_merge,lazytime
in the Config that would do the trick ...
Last edited by pierro78 on Fri Jul 19, 2024 10:40 pm, edited 1 time in total.
pierro78
 
Posts: 9
Joined: Sun Nov 06, 2016 9:24 pm

Re: f2fs for rootfs on microsd in asus c101 chromebook ? hel

Postby pierro78 » Fri Jul 19, 2024 9:08 pm

there is apparently a
vbutil_kernel --repack newvmlinux.kpart --signprivate kernel_data_key.vbprivk --oldblob vmlinux.kpart --config newconfig
option ? ... just need to find what key.vbprivk might be ?

PS : found a key here :make_clickable_callback(MAGIC_URL_FULL, ' ', 'https://github.com/ARM-software/u-boot/blob/master/doc/chromium/devkeys/kernel_data_key.vbprivk', '', ' class="postlink"')
Last edited by pierro78 on Fri Jul 19, 2024 10:17 pm, edited 1 time in total.
pierro78
 
Posts: 9
Joined: Sun Nov 06, 2016 9:24 pm

Re: f2fs for rootfs on microsd in asus c101 chromebook ? hel

Postby pierro78 » Fri Jul 19, 2024 9:59 pm

OK I can apparently modify the kernel parameters in newvmlinux.kpart and apparently f2fs support is built into the delivered kernel so it looks like I might be good to go (?) ...

[root@alarm pierro78]# mkfs.f2fs -l rootfs -O extra_attr,inode_checksum,sb_checksum,compression /dev/sda2

F2FS-tools: mkfs.f2fs Ver: 1.16.0 (2023-04-11)

Info: Disable heap-based policy
Info: Debug level = 0
Info: Label = rootfs
Info: Trim is enabled
Info: Enable Compression
Info: [/dev/sda2] Disk Model: STORAGE DEVICE
Info: Segments per section = 1
Info: Sections per zone = 1
Info: sector size = 512
Info: total sectors = 312396991 (152537 MB)
Info: zone aligned segment0 blkaddr: 512
Info: format version with
"Linux version 6.9.9-1-aarch64-ARCH (builduser@leming) (aarch64-unknown-linux-gnu-gcc (GCC) 14.1.1 20240507, GNU ld (GNU Binutils) 2.42.0) #1 SMP PREEMPT_DYNAMIC Sat Jul 13 08:01:37 MDT 2024"
Info: [/dev/sda2] Discarding device
Info: This device doesn't support BLKSECDISCARD
Info: This device doesn't support BLKDISCARD
Info: Overprovision ratio = 0.370%
Info: Overprovision segments = 282 (GC reserved = 277)
Info: format successful
[root@alarm pierro78]#

[root@alarm tmp]# mount -o compress_algorithm=zstd:6,compress_chksum,atgc,gc_merge,lazytime /dev/sda2 root

[root@alarm tmp]# tar -xf ArchLinuxARM-gru-latest.tar.gz -C root

[root@alarm boot]# dd if=newvmlinux.kpart of=/dev/sda1

[root@alarm tmp]# pacman -S arch-install-scripts

[root@alarm tmp]# arch-chroot root
[root@alarm /]# pacman-key --init
[root@alarm /]# pacman-key --populate archlinuxarm
[root@alarm /]# pacman -Syu linux-aarch64 linux-aarch64-chromebook
(press N when asked if you want to flash the kernel)
pacman -S linux-firmware-marvell
pacman -S libmd
pacman -S f2fs-tools vboot-utils alsa-utils
Last edited by pierro78 on Sun Jul 21, 2024 8:37 pm, edited 2 times in total.
pierro78
 
Posts: 9
Joined: Sun Nov 06, 2016 9:24 pm

Re: f2fs for rootfs on microsd in asus c101 chromebook ? hel

Postby pierro78 » Sat Jul 20, 2024 7:15 pm

not working ... it looks like it doesnt find the rootfs ... I am going to try to put the PARTUUID directly in newvmlinux.kpart instead of root=PARTUUID=%U/PARTNROFF=1 ... still not working ... too bad it does not display anything : I have no idea what s wrong ...

maybe I should have put -l Root instead of rootfs :
mkfs.f2fs -l rootfs -O extra_attr,inode_checksum,sb_checksum,compression /dev/sda2
pierro78
 
Posts: 9
Joined: Sun Nov 06, 2016 9:24 pm

Re: f2fs for rootfs on microsd in asus c101 chromebook ? hel

Postby pierro78 » Sat Jul 20, 2024 9:29 pm

in the meantime I am trying cadmium ... it's using f2fs but it doesn't look like it's compressed ...
pierro78
 
Posts: 9
Joined: Sun Nov 06, 2016 9:24 pm

Re: f2fs for rootfs on microsd in asus c101 chromebook ? hel

Postby pierro78 » Sun Jul 21, 2024 4:09 pm

tried to modify and flash vmlinux.kpart with an ext4 rootfs : it s working ... working with an uncompressed f2fs rootfs too ...
pierro78
 
Posts: 9
Joined: Sun Nov 06, 2016 9:24 pm

Re: f2fs for rootfs on microsd in asus c101 chromebook ? hel

Postby pierro78 » Sun Jul 21, 2024 6:09 pm

oh it's working actually !!

looks like the mistake I made was I took a newvmlinux.kpart I built with linux 6.9.9 a day ago and now up to date archlinuxarm linux is 6.9.10 ...
pierro78
 
Posts: 9
Joined: Sun Nov 06, 2016 9:24 pm


Return to ARMv8 Devices

Who is online

Users browsing this forum: No registered users and 8 guests

cron