Re: Fresh Trixie install on VisionFive 2
Hello all,
Thank you for the helpful pointers and words of encouragement!
Ultimately I succeeded and now have a fresh Trixie install on my VF2
booting directly from NVMe. I wanted to provide some of my findings and
suggestions below, in the hope that it can help others.
A key realisation was that the SiFive images all boot the kernel from
u-boot, not through GRUB via EFI. I had to give up completely on GRUB to
move forward.
This presents a challenge when attempting to run the Trixie installer
since it assumes GRUB works. My workaround for this was the following:
1) I put the SiFive provided image on an SD card but removed both kernel
and initrd and replaced that with the Trixie installer kernel and
initrd.
2) I put the Trixie installer on a USB stick that I also attached to the
board.
Now booting up, the Trixie installer would load via u-boot from the
sdcard (basically piggybacking on the sifive image boot setup). Once the
installer needs to load the installer components it auto-detects that
they are available on the USB stick and seamlessly loads them from there
(well done installer developers! that's nicely done!).
Suggestion: If the Trixie installer would offer a simple u-boot based
boot method as well rather than insisting on EFI, it would be straight
forward to just boot the Trixie installer from the u-boot prompt. Or of
course GRUB could maybe be fixed(?)
I ran through the whole install process using just the serial console
and I'm thoroughly impressed at the whole experience. It just worked. I
used guided partitioning with LVM and it did everything very well. So
great to see that a truly 'lo-fi' (serial console) experience is still
supported, appears fully featured and Just Works (TM).
Now, upon completion of the install, the installer shows me a message
saying "No boot loader installed" and helpfully tells me which boot
parameter I should provide to the kernel in order to properly mount the
root filesystem (which is under LVM). At first slightly disappointing,
but when I realised what this meant it is of course exactly how it
should be. The board loads its boot loader (u-boot) from flash so the
installer naturally shouldn't install one.
Upon rebooting after install, I had to fiddle about with the on-board
u-boot boot loader configuration. Basically the 'load_distro_uenv' and
'bootcmd_distro' commands as defined by default in the environment
needed adjustment. I ended up making the following three adjustments to
my on-board u-boot boot loader environment configuration:
env set bootpart 1
env set load_distro_uenv 'ext4load nvme 0:1 ${loadaddr} /uEnv.txt; env import -t ${loadaddr} ${filesize}'
env set bootcmd_distro 'run load_distro_uenv; sysboot ${bootdev} ${devnum}:${bootpart} ext2 ${scriptaddr} /${boot_syslinux_conf};'
(Remember to save the environment changes to flash when they work so the
next boot works out of the box)
And then finally, I needed to copy over 'uEnv.txt', 'extlinux/' and
'dtbs/' from the SiFive image SD card to my NVMe boot partition. The
extlinux configuration was adjusted to load the Trixie kernel and
initrd.
Suggestion: If the Trixie installer would write these few last files to
the boot filesystem, the on-board u-boot boot loader could boot Trixie
up with only trivial configuration changes to the u-boot
configuration. It's inconvenient to have to manually copy over extlinux,
dtbs and the uEnv configuration.
And that's basically it!
The end result is I now have a VF2 board running Trixie, including the
Trixie provided kernel (which was really the driver for me to go through
this), booting directly from NVMe with no SD or USB or manual
tinkering.
Very few changes would be needed to make this a very smooth experience;
basically just uEnv/extlinux/dtbs on both installer image and final
installed system.
Cheers,
--
/ jakob
Reply to: