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