3 # SPDX-License-Identifier: MIT
12 export CARGO_HOME
="$(pwd)/build/cargo"
13 export RUSTUP_HOME
="$(pwd)/build/rust"
14 source "$(pwd)/build/cargo/env"
22 test -d linux || git clone https
://github.com
/AsahiLinux
/linux
25 git
reset --hard asahi-6.4
-9;
26 cat ..
/..
/config.txt
> .config
27 make LLVM
=${CLANG_VERSION} rustavailable
28 make LLVM
=${CLANG_VERSION} olddefconfig
29 make -j `nproc` LLVM
=${CLANG_VERSION} V
=0 bindeb-pkg
> /dev
/null
36 test -d m1n1 || git clone
--recursive https
://github.com
/AsahiLinux
/m1n1
39 git
reset --hard v1.3
.3;
47 test -d u-boot || git clone https
://github.com
/AsahiLinux
/u-boot
50 git
reset --hard asahi-v2023.07
.02-2;
52 make apple_m1_defconfig
55 cat m1n
1/build
/m1n1.bin
`find linux/arch/arm64/boot/dts/apple/ -name \*.dtb` <(gzip -c u-boot
/u-boot-nodtb.bin
) > u-boot.bin
61 export M1N1_VERSION
=1.3.3
62 rm -rf m1n1_
${M1N1_VERSION}_arm64
63 mkdir
-p m1n1_
${M1N1_VERSION}_arm64
/DEBIAN m1n1_
${M1N1_VERSION}_arm64
/usr
/lib
/m1n
1/
64 cp u-boot.bin m1n1_
${M1N1_VERSION}_arm64
/usr
/lib
/m1n
1/boot.bin
65 cat <<EOF > m1n1_${M1N1_VERSION}_arm64/DEBIAN/control
67 Version: $M1N1_VERSION
71 Maintainer: Thomas Glanzmann <thomas@glanzmann.de>
72 Description: Apple silicon boot loader
73 Next to m1n1 this also contains the device trees and u-boot.
76 cat > m1n1_
${M1N1_VERSION}_arm64
/DEBIAN
/postinst
<<'EOF'
80 if [ -f /boot/efi/m1n1/boot.bin ]; then
81 cp /boot/efi/m1n1/boot.bin /boot/efi/m1n1/`date +%Y%m%d%H%M`.bin
83 mkdir -p /boot/efi/m1n1/
84 cp /usr/lib/m1n1/boot.bin /boot/efi/m1n1/
87 chmod 755 m1n1_
${M1N1_VERSION}_arm64
/DEBIAN
/postinst
88 dpkg-deb
--build m1n1_
${M1N1_VERSION}_arm64
92 if type clang-15
; then
93 export CLANG_VERSION
=-15
94 elif type clang-11
; then
95 export CLANG_VERSION
=-11