#!/bin/sh major=`grep "^VERSION = " Makefile | cut -f 2 -d '=' | sed 's/ //'` patchlevel=`grep "^PATCHLEVEL = " Makefile | cut -f 2 -d '=' | sed 's/ //'` sublevel=`grep "^SUBLEVEL = " Makefile | cut -f 2 -d '=' | sed 's/ //'` extraver=`grep "^EXTRAVERSION = " Makefile | cut -f 2 -d '=' | sed 's/ //'` #echo "linux-${major}" #echo "linux-${major}.${patchlevel}.${sublevel}" kernver="${major}.${patchlevel}.${sublevel}" echo $kernver if [ $extraver ] then kernver=${major}.${patchlevel}.${sublevel}${extraver} fi localver=`grep "^CONFIG_LOCALVERSION" .config | cut -f 2 -d '=' | sed 's/\"//g'` kver=$kernver${localver} echo $kver sudo apk add sed bc openssl1.1-compat-dev diffutils findutils dtc make -j8 Image modules dtbs pkgdir=".." mkdir -p "${pkgdir}"/lib/modules mkdir -p "${pkgdir}"/lib/firmware mkdir -p "${pkgdir}"/boot/dtbs-$kver KARCH=arm64 cp arch/$KARCH/boot/Image $pkgdir/boot/vmlinux-$kver cp .config $pkgdir/boot/config-$kver $cp arch/$KARCH/boot/dts/*.dtb "${pkgdir}/boot/dtbs-$kver" make INSTALL_MOD_PATH="${pkgdir}" modules_install make INSTALL_DTBS_PATH="${pkgdir}"/boot/dtbs-$kver dtbs_install cp .config ../config-$kver.conf cd .. tar -czf linux-${kver}.tar.gz boot lib rm -rf lib boot sudo apk del sed bc openssl1.1-compat-dev diffutils findutils dtc