LukeShortCloud / rock64_fedora

Build scripts for creating CentOS and Fedora images for Rock64 devices.
GNU General Public License v3.0
1 stars 0 forks source link

Create a kernel update script #1

Open LukeShortCloud opened 4 years ago

LukeShortCloud commented 4 years ago

This should update the kernel from a Debian 10/Buster Rock64 image.

LukeShortCloud commented 4 years ago

The manual build and install script for the Rock64-forked Linux kernel is found here: https://github.com/ayufan-rock64/linux-kernel/blob/release-4.4.190/dev.mk

LukeShortCloud commented 4 years ago

I have a working kernel build process! This is a combination of the existing Rock64 Debian build process but it uses the CentOS 8 kernel configuration (to enable necessary components such as nftables since EL8 does not have tools with compatibility with iptables). I am using a slightly modified version of the dev.mk Makefile.

git clone --depth 1 --branch v5.4 https://github.com/torvalds/linux.git
cd linux
wget https://raw.githubusercontent.com/ayufan-rock64/linux-kernel/release-4.4.190/dev.mk
dnf install bison bc flex gcc make ncurses-devel rsync
wget https://git.centos.org/rpms/kernel/raw/c8/f/SOURCES/kernel-aarch64.config -O arch/arm64/configs/rockchip_linux_defconfig
make -f dev.mk kernel-menuconfig
# Build the kernel.
time make -f dev.mk kernel-image-and-modules
# Install the kernel to the local file system.
make -f dev.mk kernel-update-image
# Build the initramfs boot image.
dracut -f /boot/initramfs-5.4.0-rockchip-dev.img 5.4.0-rockchip-dev
# Disable U-Boot and switch to the legacy BIOS boot.
# From https://github.com/ayufan-rock64/linux-package/blame/master/root/usr/local/sbin/new_extlinux_boot.sh rootfs
parted -s "$DISK" set 7 legacy_boot on
parted -s "$DISK" set 6 legacy_boot off
# Add the boot entry to the top.
vi /boot/extlinux/extlinux.conf

My next step is to ideally convert this into an RPM spec.

LukeShortCloud commented 4 years ago

From my testing, it appears that the upstream CentOS 8 kernel config does not make a bootable kernel whereas the Rock64 does. I would like to compare the both and make a hybrid version of the config that adds features required for EL8.