Compiling and Updating Linux Kernel
Perform the following steps to compile and update Linux kernel:
- Install dependencies to build
kernel:
apt-get install build-essential linux-source bc kmod cpio flex libncurses5-dev libelf-dev libssl-dev dwarves bison git
- Clone the kernel from StarFive
Github:
git clone https://github.com/starfive-tech/linux
- Checkout the desired Kernel
version:
git checkout <Tag Version>
- Build the kernel with
bindeb-pkg
:cd linux/ cp arch/riscv/configs/starfive_visionfive2_defconfig .config make ARCH=riscv olddefconfig make ARCH=riscv -j$(nproc) bindeb-pkg
-
Once the compile is finished, install the .deb Kernel packages.
dpkg -i *.deb
Note: Currently the dtbs are not synced once you installed a different version of kernel, you'll need to copy over the dtbs from /usr/lib/linux-image-<custom version>/starfive to /boot/dtbs/