***WARNING*** linux-5.10.tar.bz2 is actually 5.10.9! So make sure you use this one, not some other 5.10 tarball. January 22, 2021 Kernel 5.10.9+ for Raspberry Pi4 Compiled on host board Pi4B, running EasyOS Dunfell-series 2.6 64-bit. Synopsis -------- The script 'compile-rpi4.sh' will patch the kernel with 'aufs' and 'cap_sys_mount' patches, then compile it, then create: linux_headers-5.10.9+.pet linux_kernel-5.10.9+-rpi4-dunfell64.pet kernel_5.10.9+-p1_src.sfs and kernel_5.10.9+-p1_src.specs The two PET packages can be used by woofQ to build EasyOS for the Pi4. How to download kernel source ----------------------------- This has already been done, but here is how... The 5.10.x kernel source for the raspberry pi was downloaded: git clone --depth=1 --branch rpi-5.10.y https://github.com/raspberrypi/linux Downloads as folder 'linux', I renamed it to 'linux-5.10' and ran: # dir2tgz linux-5.10 HOWEVER, this is actually "5.10.9+". The build script that I use, requires an actual 'linux-5.10.tar.bz2', and build-kernel/patches/patch-5.10.9+.bz2 would provide the .9 update. However, in this case, 'patch-5.10.9+.bz2' is empty, does nothing -- it is just there for the logical requirement of the 'compile-rpi4.sh' script. How to compile kernel --------------------- The host OS must be aarch64, preferably the same gcc version as the target system. The kernel was compiled on a Pi4 board, with 8GB RAM and 32GB swap partition on SSD. Of course, with EasyOS, the 'devx' SFS must be loaded. With any other Linux, gcc must be installed. Create a folder somewhere in an ext4 partition on a hard drive or SSD. Barry used a USB3 500GB SSD. Expand the tarball: # tar -xf build-kernel.tar.gz # cd build-kernel Link /usr/src to the 'build-kernel' folder: # pwd # ln -snf /usr/src # cd /usr/src An important little detail: Unfortunately, the kernel compile somewhere has hardcoded 'awk' to be at /usr/bin. In EasyOS it is at /bin, so create a symlink: # ln -s /bin/awk /usr/bin/awk You are now ready to compile: # ./compile-rpi4.sh Compile will then go to completion, and you will have two PETs and an SFS. All of the above can be attempted on some other aarch64 host Linux OS, but do read through the 'compile-rpi4.sh' script to make sure that everything is OK for your host system. There are some scripts used, such as 'dir2tgz' and 'tgz2pet' that are only in Puppy Linux and derivatives. Performance note: Build takes a long time. 'make' is run without "-j " and that would probably speed things up. Regards, Barry Kauler January 22, 2021 bkhome.org/news