]> git.zerfleddert.de Git - m1-debian/blame_incremental - gpu.sh
does not work
[m1-debian] / gpu.sh
... / ...
CommitLineData
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
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
25build_linux()
26{
27(
28 test -d linux || git clone https://github.com/AsahiLinux/linux
29 cd linux
30 git fetch -a -t
31 git reset --hard asahi-6.1-rc8-3;
32 source "$HOME/.cargo/env"
33 cat ../../config-gpu.txt > .config
34 make LLVM=-14 olddefconfig
35 make -j `nproc` LLVM=-14 V=0 bindeb-pkg > /dev/null
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
45 git reset --hard v1.2.2;
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
62}
63
64mkdir -p build
65cd build
66
67handle_crosscompile
68build_linux
69build_m1n1
70build_uboot
Impressum, Datenschutz