SignageWithAlpineLinux: Unterschied zwischen den Versionen

Aus bytewerk-Wiki
Zur Navigation springen Zur Suche springen
(2nd draft)
 
K (zwischenstand)
Zeile 1: Zeile 1:
Signage with Alpine linux on the raspberry pi
Signage with Alpine linux on the raspberry pi
=== setup image ===

Steps:

* Format SD-Card as FAT32 with a MSDOS partition table
* Format SD-Card as FAT32 with a MSDOS partition table
* Grab the base file system from the alpine linux [https://www.alpinelinux.org/downloads/ website] (pick aarch64)
* Grab the base file system from the alpine linux [https://www.alpinelinux.org/downloads/ website] (pick aarch64)
* Mount new partition and unzip archive directly to SDcard
* Mount new partition and unzip archive directly to SDcard
* umount and plug SDcard into raspberry pi
* umount and plug SDcard into raspberry pi
* boot and log in as "root" without entering a password
* boot and log in as "root" without entering a password
* Make sure the raspberry-pi is connected to the internet
* Make sure the raspberry-pi is connected to the internet

=== prepare base system ===
* start "setup-alpine"
* start "setup-alpine"
* Agree to install on /dev/mmcblk0p1
* Agree to install on /dev/mmcblk0p1
* install as "sys
* install as "sys"
* add user e.g. "sign"
* add user e.g. "sign"
* reboot the system
* (optional) continue via SSH
* apk update
* apk add nano
* nano /etc/apk/repositories and uncomment the community repository
* nano /etc/apk/repositories and uncomment the community repository
* apk update
* apk update

* apk add nano screen
=== setup base system ===
* add file boot/usercfg.txt
* apk add screen
* add file boot/usercfg.txt with the following content
disable_overscan=1
disable_overscan=1
dtoverlay=vc4-kms-v3d
dtoverlay=vc4-kms-v3d
Zeile 22: Zeile 28:
* (optional) switch to udev
* (optional) switch to udev
setup-devd
setup-devd

=== setup viewer ===
* install window manager
* install window manager
apk add seatd wlr-randr mesa-dri-gallium sway
apk add seatd wlr-randr mesa-dri-gallium sway
apk add wlr-randr chromium wtype
* start seatd on boot and add "sign" to its group
* start seatd on boot and add "sign" to its group
rc-service seatd start
rc-service seatd start
rc-update add seatd default
rc-update add seatd default
adduser spn seat
adduser sign seat # grant sign access to seatd
* setup autostart of of sway as user "sign"
* copy and edit sway config for user "sign"
* copy and edit sway config for user "sign"
mkdir -p /home/sign/.config/sway
mkdir -p /home/sign/.config/sway
cp /etc/sway/config /home/sign/.config/sway
cp /etc/sway/config /home/sign/.config/sway
echo "
echo "seat seat0 hide_cursor 8000 # hide cursor
# hide cursor
exec /home/sign/run.sh" >> ~/.config/sway
seat seat0 hide_cursor 8000
# force fullhd
output HDMI-A-1 mode 1920x1080
exec /home/sign/swaystart.sh &" >> ~/.config/sway/config
* setup autostart for user "sign"
echo "#!/bin/sh
su -c /home/sign/autostart.sh - sign &" > /etc/local.d/user-sign.start
rc-update add local default
* configure XDG_RUNTIME_DIR
echo "if test -z "${XDG_RUNTIME_DIR}"; then
export XDG_RUNTIME_DIR=/tmp/$(id -u)-runtime-dir
if ! test -d "${XDG_RUNTIME_DIR}"; then
mkdir "${XDG_RUNTIME_DIR}"
chmod 0700 "${XDG_RUNTIME_DIR}"
fi
fi" > /home/sign/.profile
* autostart chromium inside sway on boot
echo "#!/bin/sh
sway" > /home/sign/autostart.sh
echo "#!/bin/sh
chromium-browser --kiosk -incognito \
--enable-features=UseOzonePlatform --ozone-platform=wayland \
--start-fullscreen --noerrdialogs --disable-infobars --disk-cache-dir=/dev/null \
--disk-cache-size=1 'https://example.com' &
while true; do
# after a while all browsers begin to stutter. Here is a crude fix
sleep 600
WAYLAND_DISPLAY=wayland-1 wtype -P F5
done" > /home/sign/swaystart.sh
* fix file permissions
chmod +x /home/sign/autostart.sh
chmod +x /home/sign/swaystart.sh

=== setup SPN viewer ===
apk add font-noto-emoji # for snake emojis

Version vom 10. April 2023, 03:32 Uhr

Signage with Alpine linux on the raspberry pi

setup image

  • Format SD-Card as FAT32 with a MSDOS partition table
  • Grab the base file system from the alpine linux website (pick aarch64)
  • Mount new partition and unzip archive directly to SDcard
  • umount and plug SDcard into raspberry pi
  • boot and log in as "root" without entering a password
  • Make sure the raspberry-pi is connected to the internet

prepare base system

  • start "setup-alpine"
  • Agree to install on /dev/mmcblk0p1
  • install as "sys"
  • add user e.g. "sign"
  • reboot the system
  • (optional) continue via SSH
  • apk update
  • apk add nano
  • nano /etc/apk/repositories and uncomment the community repository
  • apk update

setup base system

  • apk add screen
  • add file boot/usercfg.txt with the following content
disable_overscan=1
dtoverlay=vc4-kms-v3d
gpu_mem=128
  • (optional) switch to udev
setup-devd

setup viewer

  • install window manager
apk add seatd wlr-randr mesa-dri-gallium sway
apk add wlr-randr chromium wtype
  • start seatd on boot and add "sign" to its group
rc-service seatd start
rc-update add seatd default
adduser sign seat # grant sign access to seatd
  • copy and edit sway config for user "sign"
mkdir -p /home/sign/.config/sway
cp /etc/sway/config /home/sign/.config/sway
echo "
# hide cursor
seat seat0 hide_cursor 8000
# force fullhd
output HDMI-A-1 mode 1920x1080
exec /home/sign/swaystart.sh &" >> ~/.config/sway/config
  • setup autostart for user "sign"
echo "#!/bin/sh
su -c /home/sign/autostart.sh - sign &" > /etc/local.d/user-sign.start
rc-update add local default
  • configure XDG_RUNTIME_DIR
echo "if test -z "${XDG_RUNTIME_DIR}"; then
  export XDG_RUNTIME_DIR=/tmp/$(id -u)-runtime-dir
  if ! test -d "${XDG_RUNTIME_DIR}"; then
    mkdir "${XDG_RUNTIME_DIR}"
    chmod 0700 "${XDG_RUNTIME_DIR}"
  fi
fi" > /home/sign/.profile
  • autostart chromium inside sway on boot
echo "#!/bin/sh
sway" > /home/sign/autostart.sh

echo "#!/bin/sh
chromium-browser --kiosk -incognito \
--enable-features=UseOzonePlatform --ozone-platform=wayland \
--start-fullscreen --noerrdialogs --disable-infobars --disk-cache-dir=/dev/null \
--disk-cache-size=1 'https://example.com' &
while true; do
  # after a while all browsers begin to stutter. Here is a crude fix
  sleep 600
  WAYLAND_DISPLAY=wayland-1 wtype -P F5
done" > /home/sign/swaystart.sh
  • fix file permissions
chmod +x /home/sign/autostart.sh
chmod +x /home/sign/swaystart.sh

setup SPN viewer

apk add font-noto-emoji # for snake emojis