3 # SPDX-License-Identifier: MIT
15 export DEBOOTSTRAP
=debootstrap
22 sudo eatmydata
${DEBOOTSTRAP} --cache-dir=`pwd`/cache
--arch=arm64
--include initramfs-tools
,pciutils
,wpasupplicant
,tcpdump
,vim
,tmux
,vlan
,ntpdate
,parted
,curl
,wget
,grub-efi-arm64
,mtr-tiny
,dbus
,ca-certificates
,sudo
,openssh-client
,mtools
,gdisk
,cryptsetup
,wireless-regdb testing testing http
://deb.debian.org
/debian
26 sudo mkdir
-p boot
/efi
/m1n1 etc
/X11
/xorg.conf.d
28 sudo bash
-c 'echo debian > etc/hostname'
30 sudo bash
-c 'echo > etc/motd'
32 sudo
cp ..
/..
/files
/sources.list etc
/apt
/sources.list
33 sudo
cp ..
/..
/files
/glanzmann.list etc
/apt
/sources.list.d
/
34 sudo
cp ..
/..
/files
/thomas-glanzmann.gpg etc
/apt
/trusted.gpg.d
/
35 sudo
cp ..
/..
/files
/hosts etc
/hosts
36 sudo
cp ..
/..
/files
/resolv.conf etc
/resolv.conf
37 sudo
cp ..
/..
/files
/quickstart.txt root
/
38 sudo
cp ..
/..
/files
/interfaces etc
/network
/interfaces
39 sudo
cp ..
/..
/files
/wpa.conf etc
/wpa_supplicant
/wpa_supplicant.conf
40 sudo
cp ..
/..
/files
/rc.
local etc
/rc.
local
41 sudo
cp ..
/..
/files
/30-modeset.conf etc
/X11
/xorg.conf.d
/30-modeset.conf
42 sudo
cp ..
/..
/files
/blacklist.conf etc
/modprobe.d
/
44 sudo perl
-p -i -e 's/"quiet"/"net.ifnames=0"/ if /^GRUB_CMDLINE_LINUX_DEFAULT=/' etc
/default
/grub
46 sudo bash
-c 'chroot . apt update'
47 sudo bash
-c 'chroot . apt install -y firmware-linux'
49 sudo
-- perl
-p -i -e 's/root:x:/root::/' etc
/passwd
51 sudo
-- ln -s lib
/systemd
/systemd init
53 sudo chroot . apt update
54 sudo chroot . apt
install -y m1n1 linux-image-asahi
55 sudo chroot . apt clean
56 sudo
rm var
/lib
/apt
/lists
/* || true
64 mkdir
-p live-stick
/efi
/boot live-stick
/efi
/debian
/
65 sudo
cp ..
/files
/wifi.pl testing
/etc
/rc.
local
66 sudo bash
-c 'cd testing; find . | cpio --quiet -H newc -o | zstd -T0 -16 > ../live-stick/initrd.zstd'
67 cp testing
/usr
/lib
/grub
/arm64-efi
/monolithic
/grubaa64.efi live-stick
/efi
/boot
/bootaa64.efi
68 cp testing
/boot
/vmlinuz
* live-stick
/vmlinuz
69 cp ..
/files
/grub.cfg live-stick
/efi
/debian
/grub.cfg
70 (cd live-stick
; tar cf ..
/asahi-debian-live.
tar .
)
78 dd if=/dev
/zero of
=media bs
=1 count
=0 seek
=2G
81 tune2fs
-O extents
,uninit_bg
,dir_index
-m 0 -c 0 -i 0 media
82 sudo mount
-o loop media mnt
83 sudo
cp -a testing
/* mnt
/
84 sudo
rm -rf mnt
/init mnt
/boot
/efi
/m1n1
86 tar cf
- media | pigz
-9 > m1.tgz
94 mkdir
-p EFI
/boot EFI
/debian
95 cp testing
/usr
/lib
/grub
/arm64-efi
/monolithic
/grubaa64.efi EFI
/boot
/bootaa64.efi
97 export INITRD
=`ls -1 testing/boot/ | grep initrd`
98 export VMLINUZ
=`ls -1 testing/boot/ | grep vmlinuz`
99 export UUID
=`blkid -s UUID -o value media`
100 cat > EFI
/debian
/grub.cfg
<<EOF
101 search.fs_uuid ${UUID} root
102 linux (\$root)/boot/${VMLINUZ} root=UUID=${UUID} rw net.ifnames=0
103 initrd (\$root)/boot/${INITRD}
109 build_asahi_installer_image
()
113 mkdir
-p aii
/esp
/m1n1
115 cp testing
/usr
/lib
/m1n
1/boot.bin aii
/esp
/m1n
1/boot.bin
118 zip -r9 ..
/debian-base.
zip esp media
124 echo upload build
/asahi-debian-live.
tar build
/debian-base.
zip
130 sudo apt-get
install -y build-essential bash git locales gcc-aarch64-linux-gnu libc6-dev device-tree-compiler imagemagick ccache eatmydata debootstrap pigz libncurses-dev qemu-user-static binfmt-support rsync git flex bison
bc kmod
cpio libncurses5-dev libelf-dev
:native libssl-dev dwarves zstd
135 build_asahi_installer_image