From 865b8eb73e27e8a46cf839d9f08854cf7fb5cf77 Mon Sep 17 00:00:00 2001 From: Benjamin Braatz Date: Wed, 4 Jan 2023 10:14:58 +0100 Subject: [PATCH] Fix maschinenplatzpi. --- doc/index.md | 6 ++-- doc/maschinenplatzpi.md | 11 ++++--- maschinenplatzpi/etc/pam.d/cage | 4 --- .../etc/systemd/system/cage@.service | 29 ------------------- .../etc/systemd/system/default.target | 1 - .../getty.target.wants/getty@tty1.service | 1 + .../getty@tty1.service.d/autologin.conf | 3 ++ .../graphical.target.wants/cage@tty1.service | 1 - maschinenplatzpi/home/pi/.bash_profile | 12 ++++++++ 9 files changed, 24 insertions(+), 44 deletions(-) delete mode 100644 maschinenplatzpi/etc/pam.d/cage delete mode 100644 maschinenplatzpi/etc/systemd/system/cage@.service delete mode 120000 maschinenplatzpi/etc/systemd/system/default.target create mode 120000 maschinenplatzpi/etc/systemd/system/getty.target.wants/getty@tty1.service create mode 100644 maschinenplatzpi/etc/systemd/system/getty@tty1.service.d/autologin.conf delete mode 120000 maschinenplatzpi/etc/systemd/system/graphical.target.wants/cage@tty1.service create mode 100644 maschinenplatzpi/home/pi/.bash_profile diff --git a/doc/index.md b/doc/index.md index 016b43b..e0991f7 100644 --- a/doc/index.md +++ b/doc/index.md @@ -11,7 +11,7 @@ $ cd /tmp $ wget http://archlinuxarm.org/os/ArchLinuxARM-rpi-armv7-latest.tar.gz $ sudo mkdir controlpi $ sudo mount -t tmpfs none controlpi/ -$ sudo tar -xpf ArchLinuxARM-rpi-armv7-latest.tar.gz -C controlpi/ +$ sudo tar xpf ArchLinuxARM-rpi-armv7-latest.tar.gz -C controlpi/ ``` In chroot wechseln und erstes Upgrade: @@ -122,7 +122,7 @@ Konfiguration das Einloggen mit Passwort komplett unterbindet. ## Image erstellen und aufspielen Von außerhalb des chroot: ```console -$ sudo tar -czf controlpi.tar.gz -C controlpi/ . +$ sudo tar czf controlpi.tar.gz -C controlpi/ . $ fallocate -l 4G 20YY-MM-DD-controlpi-arch.img $ sudo losetup --find --show 20YY-MM-DD-controlpi-arch.img $ sudo parted --script /dev/loop0 mklabel msdos @@ -133,7 +133,7 @@ $ sudo mkfs.ext4 -F /dev/loop0p2 $ sudo mount /dev/loop0p2 /mnt $ sudo mkdir /mnt/boot $ sudo mount /dev/loop0p1 /mnt/boot -$ sudo tar -xpf controlpi.tar.gz -C /mnt/ +$ sudo tar xpf controlpi.tar.gz -C /mnt/ $ sudo umount /mnt/boot $ sudo umount /mnt $ sudo losetup --detach /dev/loop0 diff --git a/doc/maschinenplatzpi.md b/doc/maschinenplatzpi.md index 3c89548..2f23df2 100644 --- a/doc/maschinenplatzpi.md +++ b/doc/maschinenplatzpi.md @@ -112,8 +112,6 @@ maschinenplatzpi/ │   ├── chrony.conf │   ├── iptables │   │   └── iptables.rules -│   ├── pam.d -│   │   └── cage │   ├── sysctl.d │   │   └── 60-router.conf │   └── systemd @@ -124,14 +122,15 @@ maschinenplatzpi/ │   │   ├── 20-extern.network │   │   └── 20-intern.network │   └── system -│   ├── cage@.service -│   ├── default.target -> /usr/lib/systemd/system/graphical.target -│   ├── graphical.target.wants -│   │   └── cage@tty1.service -> /etc/systemd/system/cage@.service +│   ├── getty.target.wants +│   │   └── getty@tty1.service -> /usr/lib/systemd/system/getty@.service +│   ├── getty@tty1.service.d +│   │   └── autologin.conf │   └── multi-user.target.wants │   └── chronyd.service -> /usr/lib/systemd/system/chronyd.service └── home └── pi + ├── .bash_profile └── index.html ``` diff --git a/maschinenplatzpi/etc/pam.d/cage b/maschinenplatzpi/etc/pam.d/cage deleted file mode 100644 index 4523a93..0000000 --- a/maschinenplatzpi/etc/pam.d/cage +++ /dev/null @@ -1,4 +0,0 @@ -auth required pam_unix.so nullok -account required pam_unix.so -session required pam_unix.so -session required pam_systemd.so diff --git a/maschinenplatzpi/etc/systemd/system/cage@.service b/maschinenplatzpi/etc/systemd/system/cage@.service deleted file mode 100644 index 27f7c4c..0000000 --- a/maschinenplatzpi/etc/systemd/system/cage@.service +++ /dev/null @@ -1,29 +0,0 @@ -[Unit] -Description=Cage Wayland compositor on %I -After=systemd-user-sessions.service plymouth-quit-wait.service -Before=graphical.target -ConditionPathExists=/dev/tty0 -Wants=dbus.socket systemd-logind.service -After=dbus.socket systemd-logind.service -Conflicts=getty@%i.service -After=getty@%i.service - -[Service] -Type=simple -Environment="XKB_DEFAULT_OPTIONS=numpad:mac" -ExecStart=/usr/bin/cage /usr/bin/qiosk file:///home/pi/index.html -Restart=always -User=pi -UtmpIdentifier=%I -UtmpMode=user -TTYPath=/dev/%I -TTYReset=yes -TTYVHangup=yes -TTYVTDisallocate=yes -StandardInput=tty-fail -PAMName=cage - -[Install] -WantedBy=graphical.target -Alias=display-manager.service -DefaultInstance=tty7 diff --git a/maschinenplatzpi/etc/systemd/system/default.target b/maschinenplatzpi/etc/systemd/system/default.target deleted file mode 120000 index cf9fa51..0000000 --- a/maschinenplatzpi/etc/systemd/system/default.target +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/systemd/system/graphical.target \ No newline at end of file diff --git a/maschinenplatzpi/etc/systemd/system/getty.target.wants/getty@tty1.service b/maschinenplatzpi/etc/systemd/system/getty.target.wants/getty@tty1.service new file mode 120000 index 0000000..7bfe080 --- /dev/null +++ b/maschinenplatzpi/etc/systemd/system/getty.target.wants/getty@tty1.service @@ -0,0 +1 @@ +/usr/lib/systemd/system/getty@.service \ No newline at end of file diff --git a/maschinenplatzpi/etc/systemd/system/getty@tty1.service.d/autologin.conf b/maschinenplatzpi/etc/systemd/system/getty@tty1.service.d/autologin.conf new file mode 100644 index 0000000..87dd2db --- /dev/null +++ b/maschinenplatzpi/etc/systemd/system/getty@tty1.service.d/autologin.conf @@ -0,0 +1,3 @@ +[Service] +ExecStart= +ExecStart=-/usr/bin/agetty --autologin pi --noclear %I $TERM diff --git a/maschinenplatzpi/etc/systemd/system/graphical.target.wants/cage@tty1.service b/maschinenplatzpi/etc/systemd/system/graphical.target.wants/cage@tty1.service deleted file mode 120000 index 396bbad..0000000 --- a/maschinenplatzpi/etc/systemd/system/graphical.target.wants/cage@tty1.service +++ /dev/null @@ -1 +0,0 @@ -/etc/systemd/system/cage@.service \ No newline at end of file diff --git a/maschinenplatzpi/home/pi/.bash_profile b/maschinenplatzpi/home/pi/.bash_profile new file mode 100644 index 0000000..eaa9338 --- /dev/null +++ b/maschinenplatzpi/home/pi/.bash_profile @@ -0,0 +1,12 @@ +# +# ~/.bash_profile +# + +[[ -f ~/.bashrc ]] && . ~/.bashrc + +# On first virtual console, try to start sway: +if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ] +then + export XKB_DEFAULT_OPTIONS="numpad:mac" + exec cage qiosk file:///home/pi/index.html +fi -- 2.34.1