# Maintainer: jc_gargma # Maintainer (Manjaro): Dan Johansen # Contributor (ArchArm): Kevin Mihelich # # I maintain this because: # Manjaro version patch script does not apply consistently # Arch version lacks ath9k regdom and raid6 algo patches # Manjaro version uses git # Manjaro version lacks cake modules pkgbase=linux-pinebookpro _pkgname=linux-pinebook-pro _exname=pinebookpro _supver=5 _majver=4 _minver=0 if [ "$_minver" == "0" ]; then pkgver=${_supver}.${_majver} else pkgver=${_supver}.${_majver}.${_minver} fi pkgrel=11 pkgdesc='Linux-PineBookPro' url='https://gitlab.manjaro.org/tsys/linux-pinebook-pro' arch=(aarch64) #arch=(x86_64) license=(GPL2) makedepends=( bc kmod libelf dtc uboot-tools vboot-utils ) provides=('linux') conflicts=('linux') options=('!strip') _srcname=linux-${pkgver} _commit=a48441783fc6f15bd076dc0d01ecc2913d79260a source=( https://www.kernel.org/pub/linux/kernel/v${_supver}.x/${_srcname}.tar.{xz,sign} pinebookpro-$_commit.patch 0001-net-smsc95xx-Allow-mac-address-to-be-set-as-a-parame.patch 0001-arm64-dts-rockchip-remove-capacity-dmips-rk3399.patch 0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-CLONE_NEWUSER.patch ath9k-regdom-hack.patch raid6-default-algo.patch config # the main kernel config file kernel.its kernel.keyblock kernel_data_key.vbprivk linux.preset 60-linux.hook 90-linux.hook ) validpgpkeys=( 'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds '647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman ) # https://www.kernel.org/pub/linux/kernel/v5.x/sha256sums.asc sha256sums=('bf338980b1670bca287f9994b7441c2361907635879169c64ae78364efc5f491' 'SKIP' '4b42263a879a282dd449897d9531dc007696e3a13cda3295aa49106007ecf94d' '5ed674a3a420c1a93b77cb9e243c202996d3783138182816fc37a17367a84474' '5e83715ae4d1ffe179091f88f2443cb068007c20b77b833eb2908e4d64217564' 'e862ecd2cb0b20e1859ec3e47616457a9a3acb111cd5a86094f9ed1dbd7f42ac' 'e7ebf050c22bcec0028c0b3c79fd6d3913b0370ecc6a23dfe78ce475630cf503' '0f81d6e4158b7beeb0eb514f1b9401f7e23699cb0f7b0d513e25dae1815daaeb' '8f9c5b6b6d9d84e24dcb63f3aad62cd86e0e04064cacc8da42ecfda20a08eaca' 'd074a28bd31972fbca42f9e91624a2f873350428a89d9a9af6d0ace32686475f' '4e708c9ec43ac4a5d718474c9431ba6b6da3e64a9dda6afd2853a9e9e3079ffb' 'bc9e707a86e55a93f423e7bcdae4a25fd470b868e53829b91bbe2ccfbc6da27b' '66644820faa950a5fc59181f5aefcbed6d7ed652b29aee69979a2be2a032025d' 'ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21' '71df1b18a3885b151a3b9d926a91936da2acc90d5e27f1ad326745779cd3759d') export KBUILD_BUILD_HOST=$_exname export KBUILD_BUILD_USER=$pkgbase export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})" prepare() { cd $_srcname # add upstream patch # if [ "$_minver" != "0" ]; then # msg2 "Applying upstream patch" # patch -Np1 < ../patch-${_supver}.${_majver}-${pkgver} # fi # Out of tree changes for pinebookpro to function msg2 "Applying pinebookpro patch" patch -p1 -i ../pinebookpro-$_commit.patch # ALARM patches patch -Np1 -i ..//0001-net-smsc95xx-Allow-mac-address-to-be-set-as-a-parame.patch # Manjaro ARM Patches patch -Np1 -i ../0001-arm64-dts-rockchip-remove-capacity-dmips-rk3399.patch # Hotfixes msg2 "Applying hotfixes" patch -p1 -i ../0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-CLONE_NEWUSER.patch # Ignore ath9k eeprom patch msg2 "Applying ath9k patch" patch -p1 -i ../ath9k-regdom-hack.patch # Set default raid6 algo patch msg2 " Applying raid6 patch" patch -p1 -i ../raid6-default-algo.patch msg2 "Setting version..." scripts/setlocalversion --save-scmversion echo "-$pkgrel" > localversion.10-pkgrel echo "${pkgbase#linux}" > localversion.20-pkgname msg2 "Setting config..." # we are in src/linux-x.yy.zz, looking for a config next to the pkgbuild # if [ -f ${SRCDEST}/config.previous ]; then # cp ${SRCDEST}/config.previous .config # else cp ../config .config # fi make olddefconfig # make menuconfig # Remove sublevel when no sublevel exists if [ "$_minver" == "0" ]; then sed -i '/SUBLEVEL = 0/d' Makefile fi make -s kernelrelease > version # workaround for make -s kernelrelease not applying # localversion to version when changed using menuconfig grep -Po '(?<=CONFIG_LOCALVERSION=").*(?=")' .config > ../localversion echo "$pkgver" > ../version.temp cat "localversion.10-pkgrel" >> ../version.temp cat "localversion.20-pkgname" >> ../version.temp cat ../localversion >> ../version.temp cat ../version.temp | tr -d "\n" > version # back up the config # msg2 "Backing up config..." # cp .config ${SRCDEST}/config.previous msg2 "Prepared %s version %s" "$pkgbase" "$(