I built custom kernel, but I’m having trouble loading it.
Booting hangs on:
[ 1.052175] Freeing unused kernel image (initmem) memory: 2168K
[ 1.068868] Run /init as init process
Did I forget something or do something wrong?
Here are the steps I repeated when building the kernel:
generate vmlinuz
make INSTALL_PATH=~/linux zinstall
copy dtb, and vmlinuz to boot
cp ~/linux/vmlinuz-5.15.0-starfive-custom /boot/boot/
cp ~/.local/projects/linux/arch/riscv/boot/dts/starfive/jh7110-visionfive-v2.dtb /boot/boot/dtbs/
edit extlinux config in /boot/boot/extlinux/extlinux.conf
label l2
menu label Custom linux SD-root
linux /boot/vmlinuz-5.15.0-starfive-custom
initrd /boot/initrd.img-5.15.0-starfive
I downloaded the zip archive for the JH7110_VisionFive2_devel branch, ran: make starfive_visionfive2_defconfig && make menuconfig && make and now I can boot from a custom kernel. thanks.
If you are using newer GNU binutils, you will need to patch the arch/riscv/Makefile. Here’s the patch.
Following is what I did…
git clone <repo>
cd <repo>
patch <the patchfile that I linked to>
make clean
make mrproper
make starfive_visionfive2_defconfig
ARCH=riscv CFLAGS="-march=rv64imafdc_zicsr_zba_zbb -mcpu=sifive-u74 -mtune=sifive-7-series -O2 -pipe" make deb-pkg
# install compiled kernel
dpkg -i ../*.deb