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