mirror of
https://github.com/karl0ss/AnotterKiosk.git
synced 2025-07-28 03:00:16 +01:00
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
d755794ecf | |||
deebd533ce | |||
ab39f114a8 | |||
cd48e6e86a | |||
e37514fac3 | |||
63e614985a | |||
968a171c6f |
7
.github/workflows/main.yml
vendored
7
.github/workflows/main.yml
vendored
@ -24,9 +24,12 @@ jobs:
|
||||
sudo apt update -qq
|
||||
sudo apt install -yqq libguestfs-tools qemu-utils qemu-system-arm qemu-efi-aarch64 qemu-block-extra qemu-user-static binfmt-support rsync sudo wget xz-utils pigz mount dosfstools libarchive-tools
|
||||
|
||||
- name: Make build script executable
|
||||
run: chmod +x build.sh
|
||||
|
||||
- name: Build firmware
|
||||
run: |
|
||||
sudo ./build_raspberry_pi.sh
|
||||
sudo ./build.sh
|
||||
|
||||
- name: Release build artifacts
|
||||
uses: softprops/action-gh-release@v1
|
||||
@ -34,6 +37,6 @@ jobs:
|
||||
append_body: true
|
||||
body_path: ./version-info
|
||||
files: |
|
||||
./anotterkiosk-*
|
||||
./n-anotterkiosk-*
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
@ -21,7 +21,6 @@ This project aims to solve a lot of those (at least for the author), it might al
|
||||
- [Images built via CI](https://github.com/Manawyrm/AnotterKiosk/blob/main/.github/workflows/main.yml)
|
||||
- WiFi connection support
|
||||
- Raspberry Pi (Arm64) compatibility
|
||||
- PC (x86) compatibility
|
||||
- [USB flash drive, USB SSD, etc. compatible](#how-to-use)
|
||||
- aarch64 mode for Raspberry Pis (_significant_ performance improvements over armv7/32bit ARM)
|
||||
- Read-only filesystem handling (no more broken SD cards)
|
||||
|
16
build_raspberry_pi.sh → build.sh
Executable file → Normal file
16
build_raspberry_pi.sh → build.sh
Executable file → Normal file
@ -42,16 +42,15 @@ sudo losetup -P /dev/loop0 raspikiosk.img
|
||||
sudo mount /dev/loop0p2 "${BUILD_DIR}"
|
||||
sudo mount /dev/loop0p1 "${BUILD_DIR}/boot"
|
||||
|
||||
# Copy the (raspberry pi-specific) skeleton files
|
||||
sudo rsync -a "${SCRIPT_DIR}/raspberry_pi_skeleton/." "${BUILD_DIR}"
|
||||
sudo rsync -a "${SCRIPT_DIR}/kiosk_skeleton/." "${BUILD_DIR}/kiosk_skeleton"
|
||||
# Copy the skeleton files
|
||||
sudo rsync -a "${SCRIPT_DIR}/kiosk_skeleton/." "${BUILD_DIR}"
|
||||
|
||||
# Make fstab read-only
|
||||
sed -i 's/vfat defaults/vfat ro,defaults/g' "${BUILD_DIR}/etc/fstab"
|
||||
sed -i 's/ext4 defaults/ext4 ro,defaults/g' "${BUILD_DIR}/etc/fstab"
|
||||
|
||||
# Include git repo version info
|
||||
echo -n "AnotterKiosk Raspberry Pi version: " > "${BUILD_DIR}/version-info"
|
||||
echo -n "N-AnotterKiosk Raspberry Pi version: " > "${BUILD_DIR}/version-info"
|
||||
git describe --abbrev=4 --dirty --always --tags >> "${BUILD_DIR}/version-info"
|
||||
|
||||
# Mount system partitions (from the build host)
|
||||
@ -63,9 +62,10 @@ sudo mount devpts -t devtmpfs -o mode=0755,nosuid "${BUILD_DIR}/dev/"
|
||||
sudo chroot "${BUILD_DIR}" /raspberry_pi_bullseye.sh
|
||||
|
||||
# and then actually install everything.
|
||||
sudo chroot "${BUILD_DIR}" /kiosk_skeleton/build.sh
|
||||
sudo chroot "${BUILD_DIR}" /build.sh
|
||||
|
||||
sudo rm -r "${BUILD_DIR}/kiosk_skeleton"
|
||||
# remove the build scripts
|
||||
sudo rm "${BUILD_DIR}/build.sh"
|
||||
sudo rm "${BUILD_DIR}/raspberry_pi_bullseye.sh"
|
||||
|
||||
cp "${BUILD_DIR}/version-info" version-info
|
||||
@ -84,5 +84,5 @@ sudo umount "${BUILD_DIR}"
|
||||
sudo losetup -D /dev/loop0
|
||||
|
||||
tag=$(git describe --abbrev=4 --dirty --always --tags)
|
||||
mv raspikiosk.img anotterkiosk-${tag}-arm64-raspberrypi.img
|
||||
pigz -4 anotterkiosk-${tag}-arm64-raspberrypi.img
|
||||
mv raspikiosk.img n-anotterkiosk-${tag}-arm64-raspberrypi.img
|
||||
pigz -4 n-anotterkiosk-${tag}-arm64-raspberrypi.img
|
90
build_x86.sh
90
build_x86.sh
@ -1,90 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# *sigh*, some docker containers don't seem to have sbin in their PATH
|
||||
export PATH=$PATH:/usr/sbin
|
||||
|
||||
SCRIPT_DIR="$(dirname "$(realpath "$0")")"
|
||||
BUILD_DIR="${SCRIPT_DIR}/work/root/"
|
||||
|
||||
# cleanup any previous build attempts
|
||||
umount -fl "${BUILD_DIR}" || true
|
||||
rm -rf "${BUILD_DIR}" || true
|
||||
mkdir -p "${BUILD_DIR}"
|
||||
rm x86kiosk.img || true
|
||||
|
||||
truncate -s 10G x86kiosk.img
|
||||
|
||||
PARTLAYOUT=$(cat <<-END
|
||||
label: gpt
|
||||
label-id: 3BC7D7CD-4BF8-4E92-AAEB-2ACD5F8D05AA
|
||||
device: x86kiosk.img
|
||||
unit: sectors
|
||||
first-lba: 34
|
||||
last-lba: 20971486
|
||||
sector-size: 512
|
||||
|
||||
x86kiosk.img1 : start= 2048, size= 2095105, type=EBD0A0A2-B9E5-4433-87C0-68B6B72699C7, uuid=9C99F1BB-11A8-4BB5-82C2-555D7A38F85C, name="EFI system partition"
|
||||
x86kiosk.img2 : start= 2099200, size= 18870272, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=93A9AB2C-BC29-4C6C-B6DD-1B4EDDED9A1E, name="Linux filesystem"
|
||||
END
|
||||
)
|
||||
echo "${PARTLAYOUT}" | sfdisk x86kiosk.img
|
||||
|
||||
# Setup loop device for x86 image (with partition scanning)
|
||||
ld=$(sudo losetup -P --show -f x86kiosk.img)
|
||||
|
||||
# Create filesystems
|
||||
sudo mkfs.ext4 "${ld}p2"
|
||||
sudo mkfs.fat -F 32 "${ld}p1"
|
||||
|
||||
# Mount partitions
|
||||
sudo mount "${ld}p2" "${BUILD_DIR}"
|
||||
sudo mkdir "${BUILD_DIR}/boot"
|
||||
sudo mount "${ld}p1" "${BUILD_DIR}/boot"
|
||||
|
||||
# Debootstrap debian
|
||||
sudo debootstrap --include=linux-image-amd64,grub-efi,sudo --arch amd64 bookworm "${BUILD_DIR}" http://deb.debian.org/debian/
|
||||
|
||||
# Copy the skeleton files
|
||||
sudo rsync -a "${SCRIPT_DIR}/x86_skeleton/." "${BUILD_DIR}"
|
||||
sudo rsync -a "${SCRIPT_DIR}/kiosk_skeleton/." "${BUILD_DIR}/kiosk_skeleton"
|
||||
|
||||
# Create fstab
|
||||
fat_uuid=$(lsblk -no UUID "${ld}p1")
|
||||
ext_uuid=$(lsblk -no UUID "${ld}p2")
|
||||
|
||||
echo "UUID=${fat_uuid} /boot vfat ro,defaults 0 2" | sudo tee "${BUILD_DIR}/etc/fstab"
|
||||
echo "UUID=${ext_uuid} / ext4 ro,defaults,noatime 0 1" | sudo tee -a "${BUILD_DIR}/etc/fstab"
|
||||
|
||||
# Include git repo version info
|
||||
echo -n "AnotterKiosk x86 version: " > "${BUILD_DIR}/version-info"
|
||||
git describe --abbrev=4 --dirty --always --tags >> "${BUILD_DIR}/version-info"
|
||||
|
||||
# Mount system partitions (from the build host)
|
||||
sudo mount proc -t proc -o nosuid,noexec,nodev "${BUILD_DIR}/proc/"
|
||||
sudo mount sys -t sysfs -o nosuid,noexec,nodev,ro "${BUILD_DIR}/sys/"
|
||||
sudo mount devpts -t devtmpfs -o mode=0755,nosuid "${BUILD_DIR}/dev/"
|
||||
|
||||
# and then actually install everything.
|
||||
sudo chroot "${BUILD_DIR}" /setup.sh
|
||||
sudo chroot "${BUILD_DIR}" /kiosk_skeleton/build.sh
|
||||
|
||||
sudo rm -r "${BUILD_DIR}/kiosk_skeleton"
|
||||
|
||||
cp "${BUILD_DIR}/version-info" version-info
|
||||
|
||||
sudo umount -fl "${BUILD_DIR}/proc"
|
||||
sudo umount -fl "${BUILD_DIR}/sys"
|
||||
sudo umount -fl "${BUILD_DIR}/dev"
|
||||
|
||||
sudo umount "${BUILD_DIR}/proc"
|
||||
sudo umount "${BUILD_DIR}/sys"
|
||||
sudo umount "${BUILD_DIR}/dev"
|
||||
|
||||
sudo umount "${BUILD_DIR}/boot"
|
||||
sudo umount "${BUILD_DIR}"
|
||||
|
||||
sudo losetup -D "${ld}"
|
||||
|
||||
tag=$(git describe --abbrev=4 --dirty --always --tags)
|
||||
mv x86kiosk.img anotterkiosk-${tag}-x86.img
|
||||
pigz -4 anotterkiosk-${tag}-x86.img
|
3
raspberry_pi_skeleton/boot/config.txt → kiosk_skeleton/boot/config.txt
Executable file → Normal file
3
raspberry_pi_skeleton/boot/config.txt → kiosk_skeleton/boot/config.txt
Executable file → Normal file
@ -60,4 +60,5 @@ over_voltage=4
|
||||
arm_boost=1
|
||||
|
||||
[all]
|
||||
avoid_warnings=1
|
||||
avoid_warnings=1
|
||||
dtparam=spi=on
|
@ -15,7 +15,7 @@ reboot_time = 04:00
|
||||
; set screen rotation to be used (normal, left, right, inverted)
|
||||
;rotate_screen = "normal"
|
||||
; configure screen to power on/off as specific time of day (time format in 24 hours)
|
||||
;screen_off_time=23:00
|
||||
screen_off_time=22:30
|
||||
;screen_on_time=07:00
|
||||
; configure chrome to refresh the page every x minutes
|
||||
;refresh_screen_every_x_min=15
|
||||
|
20
kiosk_skeleton/etc/hyperion/hyperion.config.json
Normal file
20
kiosk_skeleton/etc/hyperion/hyperion.config.json
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"device" :
|
||||
{
|
||||
"name" : "MyPi",
|
||||
"type" : "ws281x",
|
||||
"leds" : 50,
|
||||
"colorOrder" : "grb",
|
||||
"gpio" : 18,
|
||||
"freq" : 800000,
|
||||
"dmanum" : 5
|
||||
},
|
||||
|
||||
"grabber-framebuffer" :
|
||||
{
|
||||
"width" : 64,
|
||||
"height" : 64,
|
||||
"frequency_Hz" : 10.0,
|
||||
"priority" : 890
|
||||
}
|
||||
}
|
16
kiosk_skeleton/etc/systemd/system/hyperion.service
Normal file
16
kiosk_skeleton/etc/systemd/system/hyperion.service
Normal file
@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=Hyperion ambient light systemd service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/hyperiond
|
||||
WorkingDirectory=/usr/share/hyperion/bin
|
||||
User=root
|
||||
Group=root
|
||||
TimeoutStopSec=5
|
||||
KillMode=mixed
|
||||
Restart=on-failure
|
||||
RestartSec=2
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -1,4 +1,4 @@
|
||||
# /etc/systemd/system/kiosk-sechedule-screen.service
|
||||
# /etc/systemd/system/kiosk-schedule-screen.service
|
||||
[Unit]
|
||||
Description=Schedule Screen On/Off Timers
|
||||
After=multi-user.target
|
9
raspberry_pi_skeleton/raspberry_pi_bullseye.sh → kiosk_skeleton/raspberry_pi_bullseye.sh
Executable file → Normal file
9
raspberry_pi_skeleton/raspberry_pi_bullseye.sh → kiosk_skeleton/raspberry_pi_bullseye.sh
Executable file → Normal file
@ -11,4 +11,11 @@ APT_LISTCHANGES_FRONTEND=none DEBIAN_FRONTEND=noninteractive apt -o Dpkg::Option
|
||||
# This step is a bit risky, as the current kernel in https://github.com/raspberrypi/rpi-firmware might
|
||||
# be less tested as the currently shipping kernel in the Raspberry Pi images.
|
||||
apt install -y rpi-update
|
||||
SKIP_CHECK_PARTITION=1 SKIP_WARNING=1 rpi-update
|
||||
SKIP_CHECK_PARTITION=1 SKIP_WARNING=1 rpi-update
|
||||
|
||||
# Install Hyperion.ng
|
||||
wget -qO- https://apt.hyperion-project.org/hyperion.pub | gpg --dearmor -o /usr/share/keyrings/hyperion.pub
|
||||
echo "deb [signed-by=/usr/share/keyrings/hyperion.pub] https://apt.hyperion-project.org/ bookworm main" > /etc/apt/sources.list.d/hyperion.list
|
||||
apt update
|
||||
apt install -y hyperion
|
||||
systemctl enable hyperion.service
|
@ -6,8 +6,7 @@ then
|
||||
if [ -f "/boot/id_rsa" ]; then
|
||||
cp /boot/id_rsa /root/.ssh/id_rsa
|
||||
AUTOSSH_KEYPATH="-i /root/.ssh/id_rsa"
|
||||
fi
|
||||
if [ -f "/boot/id_ed25519" ]; then
|
||||
elif [ -f "/boot/id_ed25519" ]; then
|
||||
cp /boot/id_ed25519 /root/.ssh/id_ed25519
|
||||
AUTOSSH_KEYPATH="-i /root/.ssh/id_ed25519"
|
||||
fi
|
||||
|
@ -16,14 +16,7 @@ remount_root() {
|
||||
|
||||
|
||||
get_ini_value() {
|
||||
local section=$1 key=$2
|
||||
awk -F '=' -v sec="$section" -v k="$key" '
|
||||
$0 ~ /^\[.*\]/ { in_section = ($0 == "[" sec "]") }
|
||||
in_section && $1 ~ "^"k"$" {
|
||||
gsub(/^[ \t]+|[ \t]+$/, "", $2)
|
||||
print $2
|
||||
exit
|
||||
}' "$INI_FILE"
|
||||
get-ini "$INI_FILE" "$1" "$2"
|
||||
}
|
||||
|
||||
create_recurring_timer() {
|
||||
|
@ -1,9 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
INI_FILE="/boot/kioskbrowser.ini"
|
||||
REFRESH_INTERVAL=$(awk -F '=' '/^\[screen\]/ { in_screen=1; next }
|
||||
in_screen && /^\[/ { in_screen=0 }
|
||||
in_screen && $1 ~ /refresh_screen_every_x_min/ { gsub(/ /, "", $2); print $2 }' "$INI_FILE")
|
||||
REFRESH_INTERVAL=$(get-ini "$INI_FILE" screen refresh_screen_every_x_min)
|
||||
|
||||
# Function to safely remount root FS
|
||||
remount_root() {
|
||||
|
@ -1,10 +0,0 @@
|
||||
deb http://deb.debian.org/debian bookworm main
|
||||
deb-src http://deb.debian.org/debian bookworm main
|
||||
|
||||
deb http://deb.debian.org/debian-security/ bookworm-security main
|
||||
deb-src http://deb.debian.org/debian-security/ bookworm-security main
|
||||
|
||||
deb http://deb.debian.org/debian bookworm-updates main
|
||||
deb-src http://deb.debian.org/debian bookworm-updates main
|
||||
|
||||
deb http://deb.debian.org/debian bookworm-backports main
|
@ -1 +0,0 @@
|
||||
GRUB_DISTRIBUTOR="AnotterKiosk"
|
@ -1,26 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
apt update
|
||||
# make sure we have all updates installed (from the -updates and -security repos)
|
||||
APT_LISTCHANGES_FRONTEND=none DEBIAN_FRONTEND=noninteractive apt -o Dpkg::Options::="--force-confold" -f -y dist-upgrade
|
||||
APT_LISTCHANGES_FRONTEND=none DEBIAN_FRONTEND=noninteractive apt install -f -y -t bookworm-backports linux-image-amd64
|
||||
# to remove old kernel versions
|
||||
apt --purge autoremove
|
||||
apt install -y polkitd locales zstd dhcpcd wpasupplicant xserver-xorg-video-nouveau
|
||||
locale-gen en_US.UTF-8
|
||||
|
||||
apt install -y firmware-amd-graphics firmware-iwlwifi firmware-brcm80211 firmware-atheros firmware-misc-nonfree firmware-realtek firmware-ath9k-htc
|
||||
|
||||
echo "grub-efi-amd64 grub2/force_efi_extra_removable boolean true" | debconf-set-selections
|
||||
update-grub
|
||||
grub-install --target=x86_64-efi --efi-directory=/boot --removable --bootloader-id=AnotterKiosk
|
||||
|
||||
useradd -U -m -s /bin/bash -u 1000 -G audio,video,users,input,adm,dialout,plugdev,render pi
|
||||
|
||||
systemctl enable dhcpcd
|
||||
|
||||
rm /etc/resolv.conf
|
||||
echo "nameserver 8.8.8.8" > /etc/resolv.conf
|
||||
echo "nameserver 2001:4860:4860::8888" >> /etc/resolv.conf
|
||||
echo "nameserver 8.8.4.4" >> /etc/resolv.conf
|
||||
echo "nameserver 2001:4860:4860::8844" >> /etc/resolv.conf
|
Loading…
x
Reference in New Issue
Block a user