#!/bin/bash # SPDX-License-Identifier: MIT set -x set -e unset LC_CTYPE unset LANG export DEBOOTSTRAP=debootstrap handle_crosscompile() { if [ "`uname -m`" != 'aarch64' ]; then export ARCH=arm64 export CROSS_COMPILE=aarch64-linux-gnu- export DEBOOTSTRAP=qemu-debootstrap fi } build_linux() { ( handle_crosscompile test -d linux || git clone --depth 1 https://github.com/AsahiLinux/linux -b asahi cd linux git fetch git reset --hard origin/asahi; git clean -f -x -d &> /dev/null curl -s https://tg.st/u/40c9642c7569c52189f84621316fc9149979ee65.patch | git am - curl -s https://tg.st/u/0001-4k-iommu-patch-2022-03-11.patch | git am - curl -s https://tg.st/u/0001-try-to-reproduce-svens-regression.patch | git am - curl -s https://tg.st/u/0001-13-37-sven-Glanzmann-can-you-try-what-happens-when-y.patch | git am - curl -s https://tg.st/u/config-2022-03-15-4k > .config make olddefconfig make -j `nproc` V=0 bindeb-pkg > /dev/null ) } mkdir -p build cd build build_linux