]> cvs.zerfleddert.de Git - m1-debian/blame - files/quickstart.txt
use the branch recommended from jannau
[m1-debian] / files / quickstart.txt
CommitLineData
49e0d4d9
TG
1Set root password
2=================
3passwd
4pwconv
5
6Configure wifi
7==============
8vi /etc/wpa/wpa_supplicant.conf
9ifup wlp1s0f0
10# remove the '#' before allow-hotplug to let wifi come up after boot
11vi /etc/network/interfaces
7c94d3fa 12
49e0d4d9
TG
13Install openssh
14===============
15# Login for root is disabled by default. So you need another user
16sudo apt update
17sudo apt install -y openssh-server
cd51dc6c 18
49e0d4d9
TG
19Configure timezone
20==================
21dpkg-reconfigure tzdata
708a0d2b 22
49e0d4d9
TG
23Create a user
24=============
25useradd -m -c 'firstname lastname' -s /bin/bash username
26passwd username
7a54df2e 27
49e0d4d9
TG
28Lightweight desktop
29===================
7fd4b59a 30apt-get install lightdm blackbox xterm firefox-esr big-cursor
49e0d4d9 31/etc/init.d/lightdm start
5e01b9d1 32
49e0d4d9
TG
33Install gnome
34=============
35apt-get install gnome
36/etc/init.d/gdm3 start
60b74f9d 37
49e0d4d9
TG
38Disable sleep, hibernate and suspend targets
39============================================
40# asahi does not handle sleep well at the moment
41sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
7a54df2e 42
49e0d4d9
TG
43Xorg
44====
c45f72fa
TG
45
46# Keyboard use capslock as additional ctrl
1c4cc0fc 47cat > /etc/X11/xorg.conf.d/00-keyboard.conf <<'EOF'
7a54df2e
TG
48Section "InputClass"
49 Identifier "system-keyboard"
50 MatchIsKeyboard "on"
51 Option "XkbLayout" "us"
52 Option "XkbModel" "pc105"
53 Option "XkbVariant" "de_se_fi"
54 Option "XkbOptions" "ctrl:nocaps"
55EndSection
1c4cc0fc
TG
56EOF
57
c45f72fa 58# Swap command and option (windows and alt like on a pc keyboard)
34ce98d9 59echo 1 > /sys/module/hid_apple/parameters/swap_opt_cmd
c45f72fa
TG
60
61# Configure the touchpad
1c4cc0fc 62cat > /etc/X11/xorg.conf.d/30-input.conf <<'EOF'
7a54df2e
TG
63Section "InputClass"
64 Identifier "libinput touchpad catchall"
65 MatchIsTouchpad "on"
66 MatchDevicePath "/dev/input/event*"
67 Option "Tapping" "False"
68 Option "TappingDrag" "False"
69 Option "DisableWhileTyping" "True"
70 Option "AccelProfile" "adaptive"
71 Option "AccelSpeed" "0.3"
72 Option "AccelerationNumerator" "2"
73 Option "AccelerationDenominator" "1"
74 Option "AccelerationThreshold" "4"
75 Option "AdaptiveDeceleration" "2"
76 Option "NaturalScrolling" "0"
77 Option "TappingButtonMap" "lmr"
78 Option "ClickMethod" "clickfinger"
79 Driver "libinput"
80EndSection
1c4cc0fc 81EOF
cd51dc6c 82
49e0d4d9
TG
83Install latest kernel and m1n1 stage 2 (m1n1, dtbs, u-boot)
84===========================================================
85curl -sL tg.st/u/ksh | sudo bash
cd51dc6c 86
49e0d4d9
TG
87Use the live system to install debian
88=====================================
cd51dc6c 89
49e0d4d9
TG
90parted -a optimal /dev/nvme0n1 print free
91parted -a optimal /dev/nvme0n1 mkpart primary ext4 <begin of free> <end of free>
92tune2fs -O extents,uninit_bg,dir_index -m 0 -c 0 -i 0 /dev/nvme0n1p5
cd51dc6c 93
49e0d4d9 94mount /dev/nvme0n1p5 /mnt
5fe4d912 95
7d9a6771 96debootstrap --arch=arm64 testing /mnt http://deb.debian.org/debian
cd51dc6c 97
49e0d4d9
TG
98mount -t sysfs none /mnt/sys
99mount -t efivarfs none /mnt/sys/firmware/efi/efivars
100mount -t proc none /mnt/proc
101mount -o bind /dev /mnt/dev
102mount -o bind /dev/pts /mnt/dev/pts
cd51dc6c 103
49e0d4d9
TG
104mkdir -p /mnt/boot/efi
105mount /dev/nvme0n1p4 /mnt/boot/efi
cd51dc6c 106
49e0d4d9
TG
107cd /mnt
108chroot . bin/bash
cd51dc6c 109
49e0d4d9
TG
110cat <<EOF > /etc/fstab
111/dev/nvme0n1p5 / ext4 defaults 0 0
112/dev/nvme0n1p4 /boot/efi vfat defaults 0 0
113EOF
7c94d3fa 114
49e0d4d9 115cat <<EOF > /etc/apt/sources.list
9a969f42
TG
116deb http://den.debian.org/debian testing main contrib non-free
117deb-src http://den.debian.org/debian testing main contrib non-free
49e0d4d9
TG
118EOF
119
120apt update
121apt-get -y install 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
122
123apt-get install -y grub-efi-arm64-signed-
124echo 'grub-efi-arm64 grub2/update_nvram boolean false' | debconf-set-selections
125echo 'grub-efi-arm64 grub2/force_efi_extra_removable boolean true' | debconf-set-selections
126dpkg-reconfigure -fnoninteractive grub-efi-arm64
127update-grub
128grub-install --removable /boot/efi
129
130echo 'nameserver 8.8.8.8' > /etc/resolv.conf
131
132export HOSTNAME=debian
133echo $HOSTNAME > /etc/hostname
134cat <<EOF > /etc/hosts
135127.0.0.1 localhost $HOSTNAME
136EOF
137
138cat <<EOF > /etc/wpa_supplicant/wpa_supplicant.conf
139network={
140 ssid="ssid"
141 scan_ssid=1
142 key_mgmt=WPA-PSK
143 psk="password"
144}
145EOF
146
147tar -C /lib/firmware/ -xf /boot/efi/vendorfw/firmware.tar
cd51dc6c 148
49e0d4d9
TG
149cat <<EOF > /etc/network/interfaces
150# interfaces(5) file used by ifup(8) and ifdown(8)
151# Include files from /etc/network/interfaces.d:
152source /etc/network/interfaces.d/*
153
154allow-hotplug enp3s0
155iface enp3s0 inet dhcp
156
157# allow-hotplug wlp1s0f0
158iface wlp1s0f0 inet dhcp
159 wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
160EOF
161
162curl -sLo /tmp/k.deb tg.st/u/k.deb
163curl -sLo /boot/efi/m1n1/boot.bin tg.st/u/u-boot.bin
164dpkg -i /tmp/k.deb
165
166exit
167
168cd /
169umount /mnt/boot/efi
170umount /mnt/sys
171umount /mnt/proc
172umount /mnt/dev/pts
173umount /mnt/dev
174umount /mnt
175reboot
83966e16
TG
176
177Repack live
178===========
179You might want to save the state of your live system to the usb stick. In order
180to do so, run the following commands:
181
182apt update
183apt-get install -y cpio pigz
184rm /etc/rc.local
185# remove '#' before allow-hotplug
186vi /etc/network/interfaces
187mount /dev/sda1 /mnt
188mv /mnt/initrd.gz /mnt/initrd.old
189cd /
190find . -xdev | cpio --quiet -H newc -o | pigz -9 > /mnt/initrd.gz
191umount /mnt
77431dc9
TG
192
193iwd
194===
195With iwd you can force to use 5ghz. The following needs to be done to get iwd
196running.
197
198sudo apt-get install iwd
199
200cat <<EOF > /etc/iwd/main.conf
201[Rank]
202 BandModifier5Ghz=10
203EOF
204
205# Remove or comment out the following interfaces from /etc/network/interfaces
206# allow-hotplug wlp1s0f0
207# iface wlp1s0f0 inet dhcp
208# wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
209
210# Add the following interfaces to /etc/network/interfaces
211allow-hotplug wlan0
212iface wlan0 inet dhcp
213
214# Reboot
215reboot
216
217# Configure iwd:
218sudo iwctl
219device list
220station wlan0 scan
221station wlan0 get-networks
222station wlan0 connect SSID
ab29a9ca
TG
223
224Deinstall Linux
225===============
226# Lets assume you have the following partioning
227
228(mini) [~] sudo parted /dev/nvme0n1 print
229Model: APPLE SSD AP0256Q (nvme)
230Disk /dev/nvme0n1: 251GB
231Sector size (logical/physical): 4096B/4096B
232Partition Table: gpt
233Disk Flags:
234
235Number Start End Size File system Name Flags
236 1 24.6kB 524MB 524MB iBootSystemContainer
237 2 524MB 101GB 100GB
238 3 101GB 103GB 2500MB
239 4 103GB 104GB 513MB fat32 boot, esp
240 5 104GB 246GB 142GB ext4
241 6 246GB 251GB 5369MB RecoveryOSContainer
242
243# Never delete the first, the second and the last partition because that either
244# renders your mac unbootable (first two) or unupgradable (last one). However
245# you can recover the system by using a second system if you screw up.
246
247# In the above example we need to delete the partition number 3 (stub partition
248# you can identify it by the size 2500 MB). The partition 4 (you can identtify
249# it by the fact that it is fat32 and the flags boot, esp). And the partition
250# number 5 (you can identify it by the fact that it is ext4).
251
252You delete the partitions by doing:
253
254# n is the partition number
255sudo parted /dev/nvme0n1 rm <n>
256
257# If you're asked if you want to proceed, say 'y'. If your asked if you want to
258# ignore, say, ignore.
Impressum, Datenschutz