Note
Mainline Linux is not fully compatible with EM-RV1 servers yet.
EM-RV1 servers do not support standard UEFI or BIOS boot, therefore the boot
process might slightly differ from other servers. At boot, the bootloader
expects the eMMC to be partitioned as GPT, and will look for a boot.itb
file
in the first or second partition. The partition that contains this boot file
must be formatted as FAT32.
This boot.itb
file is in fact a FIT
Image
that must contain the following sections:
usr_bootargs
: Command-line arguments to pass to the kernel.usr_has_ramdisk
: Set to 1
if we should load the ramdisk from the FIT
image.The following section will explain in details how to create your own boot FIT image.
In this section, you will build a boot image based off a close-to-mainline Linux kernel.
Mainline Linux is not fully compatible with EM-RV1 servers yet.
To complete the actions presented below, you must have:
sudo apt updatesudo apt install -y \autoconf bc bison dwarves flex gawk git make \libelf-dev libssl-dev \u-boot-tools device-tree-compiler
git clone --depth=1 https://github.com/revyos/th1520-linux-kernel.git linuxgit clone https://github.com/revyos/thead-opensbi.git opensbigit clone https://github.com/scaleway/em-rv1.git
cd linux/make revyos_defconfig# This can take several hours.make -jsudo make modules_installcd ..
cd opensbi/make PLATFORM=generic -jcd ..
cd em-rv1/fit/# Build the device treecpp \-nostdinc \-I ../linux/arch/riscv/boot/dts/thead/ \-I ../linux/include/ \-undef \-x assembler-with-cpp \em-rv1-c4m16s128-a.dts \| dtc -o em-rv1-c4m16s128-a.dtb# Build the FIT imagesudo mv /boot/boot.itb /boot/boot.itb.baksudo mkimage -f em-rv1-c4m16s128-a-boot.its /boot/boot.itbcd -