#!/bin/bash set -e basedir=`pwd` mkdir -p "${basedir}" cd "${basedir}" # Pull in the wifi and bluetooth firmware from manjaro's git repository. rm -rf ap6256-firmware git clone https://gitlab.manjaro.org/manjaro-arm/packages/community/ap6256-firmware.git cd ap6256-firmware rm PKGBUILD 2>/dev/null mkdir brcm cp BCM4345C5.hcd brcm/BCM.hcd cp BCM4345C5.hcd brcm/BCM4345C5.hcd cp nvram_ap6256.txt brcm/brcmfmac43456-sdio.pine64,pinebook-pro.txt cp fw_bcm43456c5_ag.bin brcm/brcmfmac43456-sdio.bin cp brcmfmac43456-sdio.clm_blob brcm/brcmfmac43456-sdio.clm_blob mkdir -p /lib/firmware/brcm/ 2>/dev/null cp -a brcm/* /lib/firmware/brcm/ cd /usr/src # Time to build the kernel # Let's clone git, and use the usual name... rm -rf linux git clone https://gitlab.manjaro.org/tsys/linux-pinebook-pro --depth 1 -b v5.5-rc7-panfrost-fixes linux cd linux touch .scmversion patch -p1 --no-backup-if-mismatch < "${basedir}"/patches/pinebook-pro/0001-allow-performance-Kconfig-options.patch patch -p1 --no-backup-if-mismatch < "${basedir}"/patches/pinebook-pro/0001-net-smsc95xx-Allow-mac-address-to-be-set-as-a-parame.patch patch -p1 --no-backup-if-mismatch < "${basedir}"/patches/pinebook-pro/0001-raid6-add-Kconfig-option-to-skip-raid6-benchmarking.patch patch -p1 --no-backup-if-mismatch < "${basedir}"/patches/pinebook-pro/kali-wifi-injection.patch cp "${basedir}"/kernel-configs/pinebook-pro-5.5.config .config make oldconfig make -j$(nproc) make modules_install if [ ! -f /boot/Image.org ] then cp /boot/Image /boot/Image.org 2>/dev/null echo "Done" fi cp arch/arm64/boot/Image /boot/Image.kali # Manjaro is my base system already #cp arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dtb /boot # clean up because otherwise we leave stuff around that causes external modules # to fail to build. make mrproper # And copy the config back in again (and copy it to /usr/src to keep a backup # around) cp "${basedir}"/kernel-configs/pinebook-pro-5.5.config .config cp "${basedir}"/kernel-configs/pinebook-pro-5.5.config ./default-config cd "${basedir}" # Nick the u-boot from Manjaro ARM to see if my compilation was somehow # screwing things up. # commeted out, already using a manjaro image #cp "${basedir}"/misc/pbp/idbloader.img "${basedir}"/misc/pbp/u-boot.itb /boot/ #dd if="${basedir}"/misc/pbp/idbloader.img of=${loopdevice} seek=64 conv=notrunc #dd if="${basedir}"/misc/pbp/u-boot.itb of=${loopdevice} seek=16384 conv=notrunc