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