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