]> git.zerfleddert.de Git - m1-debian/blame - doc/asahi.txt
Merge branch 'master' of a.gmvl.de:/git/m1-debian
[m1-debian] / doc / asahi.txt
CommitLineData
e93e30bc
TG
1# This is a developer quickstart guide for a tethered boot. If you're looking
2# for an enduser guide see: https://github.com/AsahiLinux/docs/wiki/Debian
3# If you find errors or I should have elaborated more to get to going faster,
4# please let me know in IRC. My nick is Glanzmann or drop me an email at
5# thomas@glanzmann.de
6
5e01b9d1
TG
7# Boot into macos
8
2ea97406
TG
9# Extract the firmware and save it somewhere you have access to.
10# This firmware needs to be extracted later in /lib/firmware
2c6bad26
TG
11curl -sL tg.st/u/fwx.sh | sh
12
5e01b9d1
TG
13# Make space the last number is the size that MacOS instatllation should consume
14diskutil apfs resizeContainer disk0s2 200GB
15
16# Run the installer, select as stub OS 12.1, in the boot picker you supposed to
17# click Restart than return to the shell and wait until the installer is
18# finished and press Return to shutdown your system.
19curl -L https://mrcn.st/alxsh | sh
20
21# 1. Press and hold down the power button to power on the system.
22# * It is important that the system be fully powered off before this step,
23# and that you press and hold down the button once, not multiple times.
24# This is required to put the machine into the right mode.
25# 2. Release it once 'Entering startup options' is displayed.
26# 3. Choose Options.
27# 4. You will briefly see a 'macOS Recovery' dialog.
28# * If you are asked to 'Select a volume to recover',
29# then choose your normal macOS volume and click Next.
30# 5. Click on the Utilities menu and select Terminal.
31# 6. Type the following command and follow the prompts:
32
33# Create an EFI parition because the final layout will have that
34diskutil list
35diskutil addPartition <identifier before free space> %EFI% LB 512MB
36
37# Create partition to hold a rootfs (minimum 1GB if you want to use the rootfs below)
38diskutil list
39diskutil addPartition <identifier before free space> %Linux% %noformat% <size>
40
41# dd a Debian Testing rootfs on it (minimum size 1 GB)
42# Find the scripts to create that rootfs here: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/m1-debian
43curl -L https://tg.st/u/m1.tgz | tar -xOz | dd of=/dev/<identifier of Linux Filesystem>
44
45# Relax the boot policy for the stub os and uplaod install m1n1
46/Volumes/Linux/step2.sh
47
6c82b384
TG
48# Build dependencies
49sudo apt install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross device-tree-compiler imagemagick build-essential bc kmod flex cpio libncurses5-dev libelf-dev:native bison libssl-dev
50
5e01b9d1
TG
51# Compile the kernel
52git clone --depth 1 https://github.com/AsahiLinux/linux
53cd linux
54curl -s https://tg.st/u/9ce9060dea91951a330feeeda3ad636bc88c642c.patch | git am -
55curl -s https://tg.st/u/5nly | git am -
56curl -s https://tg.st/u/m1-config-2022-01-27 > .config
57
58# Crosscompile the kernel
59make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- olddefconfig
60make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j32 Image.gz dtbs
61
62cd ..
63
64# build m1n1
65git clone --recursive https://github.com/AsahiLinux/m1n1.git
66cd m1n1
67make
68
69# Export the control device for the proxyclient and friends
70export M1N1DEVICE=/dev/ttyACM0
71
72# chainload m1n1 so that you have the latest features available
73./proxyclient/tools/chainload.py build/m1n1.macho
74
75# Enable PCIe for wifi
76python3 ./proxyclient/experiments/pcie_enable_devices.py
77
78# Pick the dtb for your device: https://github.com/AsahiLinux/docs/wiki/Devices
79proxyclient/tools/linux.py --bootargs="net.ifnames=0 rw root=/dev/nvme0n1p5 rootwait rootfstype=ext4" ../linux/arch/arm64/boot/Image.gz ../linux/arch/arm64/boot/dts/apple/t8103-j293.dtb
80
81# Set timezone
82dpkg-reconfigure tzdata
Impressum, Datenschutz