]>
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 | =================== | |
56d14923 | 30 | apt-get update |
7fd4b59a | 31 | apt-get install lightdm blackbox xterm firefox-esr big-cursor |
49e0d4d9 | 32 | /etc/init.d/lightdm start |
5e01b9d1 | 33 | |
49e0d4d9 TG |
34 | Install gnome |
35 | ============= | |
56d14923 | 36 | apt-get update |
49e0d4d9 TG |
37 | apt-get install gnome |
38 | /etc/init.d/gdm3 start | |
60b74f9d | 39 | |
49e0d4d9 TG |
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 | |
7a54df2e | 44 | |
49e0d4d9 TG |
45 | Xorg |
46 | ==== | |
c45f72fa TG |
47 | |
48 | # Keyboard use capslock as additional ctrl | |
1c4cc0fc | 49 | cat > /etc/X11/xorg.conf.d/00-keyboard.conf <<'EOF' |
7a54df2e TG |
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 | |
1c4cc0fc TG |
58 | EOF |
59 | ||
c45f72fa | 60 | # Swap command and option (windows and alt like on a pc keyboard) |
34ce98d9 | 61 | echo 1 > /sys/module/hid_apple/parameters/swap_opt_cmd |
c45f72fa TG |
62 | |
63 | # Configure the touchpad | |
1c4cc0fc | 64 | cat > /etc/X11/xorg.conf.d/30-input.conf <<'EOF' |
7a54df2e TG |
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 | |
1c4cc0fc | 83 | EOF |
cd51dc6c | 84 | |
49e0d4d9 TG |
85 | Install latest kernel and m1n1 stage 2 (m1n1, dtbs, u-boot) |
86 | =========================================================== | |
87 | curl -sL tg.st/u/ksh | sudo bash | |
cd51dc6c | 88 | |
49e0d4d9 TG |
89 | Use the live system to install debian |
90 | ===================================== | |
cd51dc6c | 91 | |
49e0d4d9 TG |
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 | |
cd51dc6c | 95 | |
49e0d4d9 | 96 | mount /dev/nvme0n1p5 /mnt |
5fe4d912 | 97 | |
7d9a6771 | 98 | debootstrap --arch=arm64 testing /mnt http://deb.debian.org/debian |
cd51dc6c | 99 | |
49e0d4d9 TG |
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 | |
cd51dc6c | 105 | |
49e0d4d9 TG |
106 | mkdir -p /mnt/boot/efi |
107 | mount /dev/nvme0n1p4 /mnt/boot/efi | |
cd51dc6c | 108 | |
49e0d4d9 TG |
109 | cd /mnt |
110 | chroot . bin/bash | |
cd51dc6c | 111 | |
49e0d4d9 TG |
112 | cat <<EOF > /etc/fstab |
113 | /dev/nvme0n1p5 / ext4 defaults 0 0 | |
114 | /dev/nvme0n1p4 /boot/efi vfat defaults 0 0 | |
115 | EOF | |
7c94d3fa | 116 | |
49e0d4d9 | 117 | cat <<EOF > /etc/apt/sources.list |
8b2a692f TG |
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 | |
49e0d4d9 TG |
120 | EOF |
121 | ||
122 | apt update | |
8b2a692f | 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 |
49e0d4d9 TG |
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 | ||
dad9242c TG |
149 | passwd |
150 | ||
49e0d4d9 | 151 | tar -C /lib/firmware/ -xf /boot/efi/vendorfw/firmware.tar |
cd51dc6c | 152 | |
49e0d4d9 TG |
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 enp3s0 | |
159 | iface enp3s0 inet dhcp | |
160 | ||
161 | # allow-hotplug wlp1s0f0 | |
162 | iface wlp1s0f0 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 | |
5874ab90 | 174 | umount /mnt/sys/firmware/efi/efivars |
49e0d4d9 TG |
175 | umount /mnt/sys |
176 | umount /mnt/proc | |
177 | umount /mnt/dev/pts | |
178 | umount /mnt/dev | |
179 | umount /mnt | |
180 | reboot | |
83966e16 TG |
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 | |
77431dc9 TG |
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 | ||
56d14923 | 203 | sudo apt-get update |
77431dc9 TG |
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 | |
ab29a9ca TG |
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. | |
38fde6be TG |
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 | |
5896bbfd TG |
276 | |
277 | # Find out which device tree you're using | |
278 | cat /proc/device-tree/compatible | |
f7d011bf TG |
279 | |
280 | # Bluetooth | |
281 | https://g3la.de/hedgedoc/s/MIaCyVv1A#Bluetooth | |
a515fd59 TG |
282 | |
283 | # Set Firefox as default browser | |
284 | xdg-mime default firefox-esr.desktop x-scheme-handler/https x-scheme-handler/http | |
a7b2b797 TG |
285 | |
286 | Get it running with debian and crypto file system | |
287 | ================================================= | |
420e5bd7 | 288 | https://g3la.de/hedgedoc/buDIXGBuRzKMwUnYOpStuw# |