Skip to content

relathyme/armbian-sunxi64-kernel-patches

Repository files navigation

Build kernels

general notes

  • you can download prebuilt kernel releases from actions
  • kernel configs from here are made to boot with u-boot EFI, you can use some efi bootmanager like systemd-boot for them as well
  • preferable to have storage gpt-partitioned with ESP FAT32 /boot/efi partition and (must?) to have u-boot on SPI to use EFI boot
  • if you don't use u-boot EFI you have to disable CONFIG_EFI kernel config, or use release prefixed with non-efi
  • my config additions are listed in config_diff_from_official.txt
  • armbian u-boot should work, refer to u-boot directory to build it manually
  • toolchain used: https://mirrors.edge.kernel.org/pub/tools/llvm/files
  • some auxiliary tools you can find in misc directory

get source

  • clone this repo to ~/kernel-patches
$ cd ~/

$ ARMBIAN_VERSION=0fbc9e4c6b5cb817eb42530c084debb4493a3e2b # or other commit

$ KERNEL_FAMILY=sunxi-6.12 # or other version

$ wget https://github.com/armbian/build/archive/$ARMBIAN_VERSION.tar.gz

$ tar xvf $ARMBIAN_VERSION.tar.gz 

convert armbian patches series to patch our kernel

  • cd to kernel directory first
$ cat ~/build-$ARMBIAN_VERSION/patch/kernel/archive/$KERNEL_FAMILY/series.conf | sed "/^[#-]/d; /^$/d; s#\t#$HOME/build-$ARMBIAN_VERSION/patch/kernel/archive/$KERNEL_FAMILY/#g" > series.conf

apply patches

$ for patch in ~/kernel-patches/uwe5622-$KERNEL_FAMILY/*.patch; do patch -sNp1 < "$patch"; done

$ for patch in ~/kernel-patches/generic/*.patch; do patch -sNp1 < "$patch"; done

$ for patch in $(cat series.conf); do patch -sp1 < "$patch"; done

build debian kernel package

$ mkdir out

$ cp ~/kernel-patches/config_$KERNEL_FAMILY out/.config

$ make \
    O=out \
    ARCH=arm64 \
    LLVM=1 \
    LLVM_IAS=1 \
    KCFLAGS="-march=armv8-a+crc+crypto -mtune=cortex-a53 -Wno-incompatible-pointer-types-discards-qualifiers -I$PWD/drivers/net/wireless/uwe5622/unisocwcn/include" \
    LOCALVERSION="-${ARMBIAN_VERSION:0:7}" \
    KBUILD_BUILD_USER="nobody" \
    KBUILD_BUILD_HOST="localhost" \
    KBUILD_BUILD_TIMESTAMP="$(date -Ru)" \
    bindeb-pkg -j$(nproc) 2>&1 | tee -a out/build.log

credits

About

notes on building custom armbian kernel without using the framework

Topics

Resources

License

Stars

Watchers

Forks

Languages