# Maintainer: Donald Carr #set -x pkgname=linux-spudd provides=("linux") # The firmware the kernel produces blows: don't falsify this lightly # "linux-firmware=20170309.695f2d6-1" pkgrel=1 pkgver=4.18.rc2.r40.gcbe12ebc3410 pkgdesc="Kernel build from head" arch=("x86_64" "aarch64") license=("GPL2.1") _kernel_src_dir=/opt/dev/src/OSS/linux if [ -z "${LOCAL_PI_VER}" ]; then install=spudd.install fi _make_cmd="make ${_xcompile_args}" pkgver() { cd $_kernel_src_dir git describe --tags | cut -c2- | sed 's/\([^-]*-g\)/r\1/;s/-/./g' } build() { cd $_kernel_src_dir && git clean -xdf cp ${_config_file} ${_kernel_src_dir}/.config ${_make_cmd} if [ -n "${LOCAL_PI_VER}" ]; then ${_make_cmd} dtbs fi } package() { boot_dir="${pkgdir}/boot" dtb_dir="${boot_dir}/dtbs/broadcom" usr_dir="${pkgdir}/usr" firmware_dir="${usr_dir}/lib/firmware" preset_dir=${pkgdir}/etc/mkinitcpio.d cd $_kernel_src_dir INSTALL_MOD_PATH=${usr_dir} ${_make_cmd} modules_install mkdir -p ${boot_dir} if [ "${LOCAL_PI_VER}" = "3" ]; then mkdir -p ${dtb_dir} cp arch/arm64/boot/Image ${boot_dir} cp ./arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dtb ${dtb_dir} cp ./arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b-plus.dtb ${dtb_dir} else cp arch/x86/boot/bzImage ${boot_dir}/vmlinuz-spudd mkdir -p ${preset_dir} cp ${startdir}/spudd.preset ${preset_dir} fi rm -Rf ${startdir}/firmware if [[ -d ${firmware_dir} ]]; then mv ${firmware_dir} ${startdir} fi } if [ -n "${LOCAL_PI_VER}" ]; then case ${LOCAL_PI_VER} in 3) echo "Compiling for the RPi 3 aarch64" _config_file="${_kernel_src_dir}/configs/rpi3" _xcompile_args="ARCH=arm64 CROSS_COMPILE=/opt/x-tools/aarch64-rpi3-linux-gnu/bin/aarch64-rpi3-linux-gnu-" ;; *) echo "Only supports the rpi3 at this point in time" exit 1 ;; esac else echo "Compiling for desktop" _config_file="${_kernel_src_dir}/configs/desktop" fi _make_cmd="make ${_xcompile_args}"