]> git.zerfleddert.de Git - m1-debian/blame - gpu.sh
use the right compiler and prepare for crosscompiling
[m1-debian] / gpu.sh
CommitLineData
9ac5deac
TG
1#!/usr/bin/env bash
2
3# SPDX-License-Identifier: MIT
4
5set -o errexit
6set -o nounset
7set -o pipefail
8set -o xtrace
9
10cd "$(dirname "$0")"
11
12unset LC_CTYPE
13unset LANG
14
377069b9
TG
15handle_crosscompile()
16{
17 if [ "`uname -m`" != 'aarch64' ]; then
18 export ARCH=arm64
19 export CROSS_COMPILE=aarch64-linux-gnu-
20 export DEBOOTSTRAP=qemu-debootstrap
21 sudo apt install -y libc6-dev-arm64-cross
22 fi
23}
24
9ac5deac
TG
25build_linux()
26{
27(
28 test -d linux || git clone https://github.com/AsahiLinux/linux
29 cd linux
30 git fetch -a -t
22c32429 31 git reset --hard asahi-6.1-rc8-3;
9ac5deac 32 source "$HOME/.cargo/env"
22c32429 33 cat ../../config-gpu.txt > .config
9ac5deac 34 make LLVM=-14 olddefconfig
377069b9 35 make -j `nproc` LLVM=-14 V=0 bindeb-pkg > /dev/null
9ac5deac
TG
36)
37}
38
39build_m1n1()
40{
41(
42 test -d m1n1 || git clone --recursive https://github.com/AsahiLinux/m1n1
43 cd m1n1
44 git fetch -a -t
22c32429 45 git reset --hard v1.2.2;
9ac5deac
TG
46 make -j `nproc`
47)
48}
49
50build_uboot()
51{
52(
53 test -d u-boot || git clone https://github.com/AsahiLinux/u-boot
54 cd u-boot
55 git fetch -a -t
56 git reset --hard asahi-v2022.10-1;
57
58 make apple_m1_defconfig
59 make -j `nproc`
60)
61 cat m1n1/build/m1n1.bin `find linux/arch/arm64/boot/dts/apple/ -name \*.dtb` <(gzip -c u-boot/u-boot-nodtb.bin) > u-boot.bin
9ac5deac
TG
62}
63
64mkdir -p build
65cd build
66
377069b9 67handle_crosscompile
5a6d8c66 68build_linux
9ac5deac
TG
69build_m1n1
70build_uboot
Impressum, Datenschutz