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"
19 export M1N1_VERSION
=1.4.3
24 test -d linux || git clone https
://github.com
/AsahiLinux
/linux
27 git
reset --hard asahi-6.5
-15
28 git clean
-f -x -d > /dev
/null
29 cat ..
/..
/config.txt
> .config
30 make LLVM
=-15 rustavailable
31 make LLVM
=-15 olddefconfig
32 make -j `nproc` LLVM
=-15 V
=0 bindeb-pkg
> /dev
/null
39 test -d m1n1 || git clone
--recursive https
://github.com
/AsahiLinux
/m1n1
42 git
reset --hard v
${M1N1_VERSION};
43 git clean
-f -x -d > /dev
/null
51 test -d u-boot || git clone https
://github.com
/AsahiLinux
/u-boot
54 git
reset --hard asahi-v2023.07
.02-3
55 git clean
-f -x -d > /dev
/null
57 make apple_m1_defconfig
60 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
66 rm -rf m1n1_
${M1N1_VERSION}_arm64
67 mkdir
-p m1n1_
${M1N1_VERSION}_arm64
/DEBIAN m1n1_
${M1N1_VERSION}_arm64
/usr
/lib
/m1n
1/
68 cp u-boot.bin m1n1_
${M1N1_VERSION}_arm64
/usr
/lib
/m1n
1/boot.bin
69 cat <<EOF > m1n1_${M1N1_VERSION}_arm64/DEBIAN/control
71 Version: $M1N1_VERSION
75 Maintainer: Thomas Glanzmann <thomas@glanzmann.de>
76 Description: Apple silicon boot loader
77 Next to m1n1 this also contains the device trees and u-boot.
80 cat > m1n1_
${M1N1_VERSION}_arm64
/DEBIAN
/postinst
<<'EOF'
84 if [ -f /boot/efi/m1n1/boot.bin ]; then
85 cp /boot/efi/m1n1/boot.bin /boot/efi/m1n1/`date +%Y%m%d%H%M`.bin
87 mkdir -p /boot/efi/m1n1/
88 cp /usr/lib/m1n1/boot.bin /boot/efi/m1n1/
91 chmod 755 m1n1_
${M1N1_VERSION}_arm64
/DEBIAN
/postinst
92 dpkg-deb
--build m1n1_
${M1N1_VERSION}_arm64