Modifications to get UniPi going.
authorBenjamin Braatz <bb@bbraatz.eu>
Tue, 21 Feb 2023 21:57:38 +0000 (22:57 +0100)
committerBenjamin Braatz <bb@bbraatz.eu>
Tue, 21 Feb 2023 21:57:38 +0000 (22:57 +0100)
doc/index.md
doc/maschinenplatzpi.md
doc/unipi.md
etc/systemd/network/eth0.network [new file with mode: 0644]
unipi/etc/systemd/system/multi-user.target.wants/rmmodunipi.service [new symlink]
unipi/etc/systemd/system/rmmodunipi.service [new file with mode: 0644]

index 277dfbf604bf1082dde4c0ac74fe24aa10f9c18a..e60ad3723008af54434ab6b15bf2105049bd22d0 100644 (file)
@@ -28,7 +28,7 @@ $ sudo tar xpf ArchLinuxARM-rpi-armv7-latest.tar.gz -C /mnt/
 
 In chroot wechseln und Paket-Schlüssel einrichten:
 ```console
-$ TERM=xterm sudo arch-chroot controlpi/
+$ TERM=xterm sudo arch-chroot /mnt/
 # pacman-key --init
 # pacman-key --populate archlinuxarm
 ```
@@ -38,6 +38,7 @@ Pakete entfernen und hinzufügen bis folgendes Minimalsystem erreicht ist:
 # pacman -Q --deps --unrequired --unrequired
 # pacman -Q --explicit
 base
+ethtool
 fakeroot
 gcc
 git
@@ -80,11 +81,11 @@ Bauen und Installieren des Paketes:
 $ git clone https://aur.archlinux.org/pigpio.git
 $ cd pigpio/
 $ makepkg -s
-$ mv pigpio-79-1-armv7h.pkg.tar.xz ~/
+$ mv pigpio-XX-Y-armv7h.pkg.tar.xz ~/
 $ cd ~/
 $ rm -r pigpio/
 $ exit
-# pacman -U /home/pi/pigpio-79-1-armv7h.pkg.tar.xz
+# pacman -U /home/pi/pigpio-XX-Y-armv7h.pkg.tar.xz
 ```
 
 Paket-Cache leeren:
@@ -135,6 +136,8 @@ etc/
 ├── sudoers.d
 │   └── wheel
 └── systemd
+    ├── network
+    │   └── eth0.network
     ├── resolved.conf.d
     │   └── NoNegCache.conf
     └── system
@@ -168,7 +171,8 @@ Von außerhalb des chroot:
 $ sudo umount /mnt/boot/
 $ sudo umount /mnt/
 $ sudo losetup --detach /dev/loop0
-$ sudo dd if=20YY-MM-DD-controlpi-generic.img of=/dev/sdx bs=1M oflag=sync status=progress
+$ xz 20YY-MM-DD-controlpi-generic.img
+$ xz --decompress --stdout 20YY-MM-DD-controlpi-generic.img.xz | sudo dd of=/dev/sdx bs=1M oflag=sync status=progress
 ```
 
 ## Spezialisierte Images
index dcef5b5ae98234d29831ffc4c3522f45af99ff13..c7a0ff2c9df06b345f81aeb9fe8103683099ca14 100644 (file)
@@ -91,11 +91,11 @@ können direkt aus den Arch-Linux-ARM-Repositories installiert werden:
 $ git clone https://github.com/Salamek/qiosk.git
 $ cd qiosk/archlinux/
 $ makepkg -sA
-$ mv qiosk-1.1.16-1-armv7h.pkg.tar.xz ~/
+$ mv qiosk-X.Y.ZZ-armv7h.pkg.tar.xz ~/
 $ cd ~/
 $ rm -r qiosk/
 $ exit
-# pacman -U /home/pi/qiosk-1.1.16-1-armv7h.pkg.tar.xz
+# pacman -U /home/pi/qiosk-X.Y.ZZ-armv7h.pkg.tar.xz
 ```
 
 Wie auch beim generischen Image wird der Paket-Cache nach allen
@@ -107,8 +107,8 @@ Installationen geleert, um möglichst Platz zu sparen:
 Die Konfigurations-Dateien werden – wie auch beim generischen Image – aus
 diesem git-Repository synchronisiert:
 ```console
-$ sudo rsync -rlp maschinenplatzpi/etc /tmp/controlpi/
-$ rsync -rlp maschinenplatzpi/home/pi /tmp/controlpi/home/
+$ sudo rsync -rlp maschinenplatzpi/etc /mnt/
+$ rsync -rlp maschinenplatzpi/home/pi /mnt/home/
 ```
 
 Im Einzelnen sind dies:
@@ -152,5 +152,6 @@ Das Schließen und Aufspielen des Images funktioniert dann genau wie für das
 $ sudo umount /mnt/boot/
 $ sudo umount /mnt/
 $ sudo losetup --detach /dev/loop0
-$ sudo dd if=20YY-MM-DD-controlpi-maschinenplatzpi.img of=/dev/sdx bs=1M oflag=sync status=progress
+$ xz 20YY-MM-DD-controlpi-maschinenplatzpi.img
+$ xz --decompress --stdout 20YY-MM-DD-controlpi-maschinenplatzpi.img.xz | sudo dd of=/dev/sdx bs=1M oflag=sync status=progress
 ```
index aa801dcc810fe7b2fdbec551bb20a80a15daefc6..456be948543b96f0aba2a8c76c85c2b5c861768d 100644 (file)
@@ -11,6 +11,11 @@ Dieses haben wir unter
 [https://git.graph-it.com/?p=graphit/unipi-kernel.git](https://git.graph-it.com/?p=graphit/unipi-kernel.git)
 so angepast, dass es auf aktuellen Kernel-Versionen kompiliert werden kann.
 
+Eine neuere Version der Kernel-Module wird unter
+[https://github.com/UniPiTechnology/unipi-kernel-modules](https://github.com/UniPiTechnology/unipi-kernel-modules)
+entwickelt, ist aber zu diesem Zeitpunkt noch nicht ausreichend komplett
+und dokumentiert.
+
 ## Konfiguration aus Hersteller-Image
 Außerdem stellt der Hersteller unter
 [https://kb.unipi.technology/en:hw:02-neuron:download-image:03-opensource](https://kb.unipi.technology/en:hw:02-neuron:download-image:03-opensource)
@@ -45,7 +50,7 @@ Kompilieren und installieren von Kernel und Device-Tree:
 # su - pi
 $ git clone git://git.graph-it.com/graphit/unipi-kernel.git
 $ cd unipi-kernel/
-$ export LINUX_DIR_PATH=/lib/modules/5.XX.YY-rpi-ARCH/build
+$ export LINUX_DIR_PATH=/lib/modules/X.YY.ZZ-rpi-ARCH/build
 $ make
 $ sudo -E make install
 $ cd device_tree/
@@ -74,6 +79,7 @@ Die Konfigurations-Dateien werden – wie auch beim generischen Image – aus
 diesem git-Repository synchronisiert:
 ```console
 $ sudo rsync -rlp unipi/boot /mnt/
+$ sudo rsync -rlp unipi/etc /mnt/
 $ rsync -rlp unipi/home/pi /mnt/home/
 ```
 
@@ -83,8 +89,13 @@ unipi/
 ├── boot
 │   └── config.txt
 ├── etc
-│   └── modules-load.d
-│       └── unipi.conf
+│   ├── modules-load.d
+│   │   └── unipi.conf
+│   └── systemd
+│       └── system
+│           ├── multi-user.target.wants
+│           │   └── rmmodunipi.service -> /etc/systemd/system/rmmodunipi.service
+│           └── rmmodunipi.service
 └── home
     └── pi
         └── conf.json
@@ -93,7 +104,7 @@ unipi/
 Der `pigpio`-Daemon, der im generischen Image eingeschaltet ist, wird für
 das UniPi-Image ausgeschaltet:
 ```console
-# rm /etc/systemd/sytem/multi-user.target.wants/pigpiod.service
+# rm /etc/systemd/system/multi-user.target.wants/pigpiod.service
 ```
 
 Das Schließen und Aufspielen des Images funktioniert dann genau wie für das
@@ -102,5 +113,6 @@ Das Schließen und Aufspielen des Images funktioniert dann genau wie für das
 $ sudo umount /mnt/boot/
 $ sudo umount /mnt/
 $ sudo losetup --detach /dev/loop0
-$ sudo dd if=20YY-MM-DD-controlpi-unipi.img of=/dev/sdx bs=1M oflag=sync status=progress
+$ xz 20YY-MM-DD-controlpi-unipi.img
+$ xz --decompress --stdout 20YY-MM-DD-controlpi-unipi.img.xz | sudo dd of=/dev/sdx bs=1M oflag=sync status=progress
 ```
diff --git a/etc/systemd/network/eth0.network b/etc/systemd/network/eth0.network
new file mode 100644 (file)
index 0000000..c8f093f
--- /dev/null
@@ -0,0 +1,6 @@
+[Match]
+Name=en*
+
+[Network]
+DHCP=yes
+DNSSEC=no
diff --git a/unipi/etc/systemd/system/multi-user.target.wants/rmmodunipi.service b/unipi/etc/systemd/system/multi-user.target.wants/rmmodunipi.service
new file mode 120000 (symlink)
index 0000000..edfd2a6
--- /dev/null
@@ -0,0 +1 @@
+/etc/systemd/system/rmmodunipi.service
\ No newline at end of file
diff --git a/unipi/etc/systemd/system/rmmodunipi.service b/unipi/etc/systemd/system/rmmodunipi.service
new file mode 100644 (file)
index 0000000..e3928e1
--- /dev/null
@@ -0,0 +1,10 @@
+[Unit]
+Description=rmmod unipi at shutdown/reboot
+
+[Service]
+Type=oneshot
+RemainAfterExit=true
+ExecStop=/usr/bin/rmmod unipi
+
+[Install]
+WantedBy=multi-user.target