From 1aa708882ee638fa91299b6a7f5f4eb4a696c74b Mon Sep 17 00:00:00 2001 From: Benjamin Braatz Date: Tue, 21 Feb 2023 22:57:38 +0100 Subject: [PATCH] Modifications to get UniPi going. --- doc/index.md | 12 ++++++---- doc/maschinenplatzpi.md | 11 +++++----- doc/unipi.md | 22 ++++++++++++++----- etc/systemd/network/eth0.network | 6 +++++ .../rmmodunipi.service | 1 + unipi/etc/systemd/system/rmmodunipi.service | 10 +++++++++ 6 files changed, 48 insertions(+), 14 deletions(-) create mode 100644 etc/systemd/network/eth0.network create mode 120000 unipi/etc/systemd/system/multi-user.target.wants/rmmodunipi.service create mode 100644 unipi/etc/systemd/system/rmmodunipi.service diff --git a/doc/index.md b/doc/index.md index 277dfbf..e60ad37 100644 --- a/doc/index.md +++ b/doc/index.md @@ -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 diff --git a/doc/maschinenplatzpi.md b/doc/maschinenplatzpi.md index dcef5b5..c7a0ff2 100644 --- a/doc/maschinenplatzpi.md +++ b/doc/maschinenplatzpi.md @@ -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 ``` diff --git a/doc/unipi.md b/doc/unipi.md index aa801dc..456be94 100644 --- a/doc/unipi.md +++ b/doc/unipi.md @@ -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 index 0000000..c8f093f --- /dev/null +++ b/etc/systemd/network/eth0.network @@ -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 index 0000000..edfd2a6 --- /dev/null +++ b/unipi/etc/systemd/system/multi-user.target.wants/rmmodunipi.service @@ -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 index 0000000..e3928e1 --- /dev/null +++ b/unipi/etc/systemd/system/rmmodunipi.service @@ -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 -- 2.34.1