Compare commits

..

2 Commits
1.0.35 ... main

Author SHA1 Message Date
8ac881ffcf Add apt cleanup to reduce image size 2025-07-22 17:27:24 +01:00
b7e48f776e Display git tag on web interface 2025-07-22 17:25:47 +01:00
8 changed files with 52 additions and 68 deletions

View File

@ -1 +0,0 @@
58a3ec57402c86332e67789a6b8f149aeeb4e7bb0a16c9388a66ea6e07012e45 2024-03-15-raspios-bookworm-arm64-lite.img.xz

View File

@ -3,7 +3,6 @@ N-AnotterKiosk (Not-AnotterKiosk)
### I have hacked this about alot from the main branch, mainly Raspberry Pi changes ### I have hacked this about alot from the main branch, mainly Raspberry Pi changes
- Removed x86 support
- Added scheduled screen on/off - Added scheduled screen on/off
- Added scheduled chrome page refresh - Added scheduled chrome page refresh
- Rpi3 Overclock settings - Rpi3 Overclock settings

View File

@ -15,16 +15,13 @@ sudo mkdir -p "${BUILD_DIR}"
# download a modern RaspiOS build # download a modern RaspiOS build
if [ ! -f raspios.img.xz ] if [ ! -f raspios.img.xz ]
then then
wget -O raspios.img.xz "https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2024-03-15/2024-03-15-raspios-bookworm-arm64-lite.img.xz" wget -O raspios.img.xz "https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2023-05-03/2023-05-03-raspios-bullseye-arm64-lite.img.xz"
wget -O raspios.img.xz.sha256 "https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2024-03-15/2024-03-15-raspios-bookworm-arm64-lite.img.xz.sha256" echo "bf982e56b0374712d93e185780d121e3f5c3d5e33052a95f72f9aed468d58fa7 raspios.img.xz" | sha256sum --check --status
sed -i 's/2024-03-15-raspios-bookworm-arm64-lite.img.xz/raspios.img.xz/g' raspios.img.xz.sha256
sha256sum --check --status raspios.img.xz.sha256
if [ $? -ne 0 ] if [ $? -ne 0 ]
then then
echo "downloaded raspios does not match checksum"; echo "downloaded raspios does not match checksum";
exit -1; return -1;
fi fi
rm raspios.img.xz.sha256
fi fi
rm -f raspios.img rm -f raspios.img
@ -46,11 +43,8 @@ sudo mount /dev/loop0p2 "${BUILD_DIR}"
sudo mount /dev/loop0p1 "${BUILD_DIR}/boot" sudo mount /dev/loop0p1 "${BUILD_DIR}/boot"
# Copy the (raspberry pi-specific) skeleton files # Copy the (raspberry pi-specific) skeleton files
sudo rsync -rl --exclude ".DS_Store" --exclude "boot" "${SCRIPT_DIR}/raspberry_pi_skeleton/." "${BUILD_DIR}" sudo rsync -a "${SCRIPT_DIR}/raspberry_pi_skeleton/." "${BUILD_DIR}"
sudo rsync -rl --exclude ".DS_Store" "${SCRIPT_DIR}/kiosk_skeleton/." "${BUILD_DIR}/kiosk_skeleton" sudo rsync -a "${SCRIPT_DIR}/kiosk_skeleton/." "${BUILD_DIR}/kiosk_skeleton"
sudo cp "${SCRIPT_DIR}/raspberry_pi_skeleton/boot/config.txt" "${BUILD_DIR}/boot/config.txt"
sudo cp "${SCRIPT_DIR}/raspberry_pi_skeleton/boot/ssh" "${BUILD_DIR}/boot/ssh"
sudo sed -i '$ s/$/ logo.nologo consoleblank=0 loglevel=0 quiet/' "${BUILD_DIR}/boot/cmdline.txt"
# Make fstab read-only # Make fstab read-only
sed -i 's/vfat defaults/vfat ro,defaults/g' "${BUILD_DIR}/etc/fstab" sed -i 's/vfat defaults/vfat ro,defaults/g' "${BUILD_DIR}/etc/fstab"
@ -65,10 +59,14 @@ 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 sys -t sysfs -o nosuid,noexec,nodev,ro "${BUILD_DIR}/sys/"
sudo mount devpts -t devtmpfs -o mode=0755,nosuid "${BUILD_DIR}/dev/" sudo mount devpts -t devtmpfs -o mode=0755,nosuid "${BUILD_DIR}/dev/"
# Raspbian currently ships only Debian 11. Let's upgrade to 12.
sudo chroot "${BUILD_DIR}" /raspberry_pi_bullseye.sh
# and then actually install everything. # and then actually install everything.
sudo chroot "${BUILD_DIR}" /kiosk_skeleton/build.sh sudo chroot "${BUILD_DIR}" /kiosk_skeleton/build.sh
sudo rm -r "${BUILD_DIR}/kiosk_skeleton" sudo rm -r "${BUILD_DIR}/kiosk_skeleton"
sudo rm "${BUILD_DIR}/raspberry_pi_bullseye.sh"
cp "${BUILD_DIR}/version-info" version-info cp "${BUILD_DIR}/version-info" version-info

View File

@ -2,10 +2,10 @@
# This script is being run on the target debian platform # This script is being run on the target debian platform
apt update apt update
DEBIAN_FRONTEND=noninteractive apt install -y lightdm openbox nginx php-fpm php-cli chromium autossh unclutter x11-xserver-utils xdotool htop nano openssh-server rsync x11vnc lm-sensors ntpdate scrot wireless-regdb fontconfig php-cli uuid-runtime APT_LISTCHANGES_FRONTEND=none DEBIAN_FRONTEND=noninteractive apt dist-upgrade -y
DEBIAN_FRONTEND=noninteractive apt install -y lightdm openbox nginx php-fpm php-cli chromium autossh unclutter x11-xserver-utils xdotool htop nano openssh-server rsync x11vnc lm-sensors ntpdate scrot wireless-regdb fontconfig
rsync -a --chown=root:root "/kiosk_skeleton/." "/" rsync -a --chown=root:root "/kiosk_skeleton/." "/"
chmod +x /usr/bin/kiosk-* /usr/bin/get-ini /usr/bin/refresh-screen /usr/bin/schedule-* /usr/bin/setup-refresh-timer
# Add emoji support # Add emoji support
mkdir -p /home/pi/.fonts mkdir -p /home/pi/.fonts
@ -60,8 +60,6 @@ mkdir -p /etc/wpa_supplicant/
ln -sf /tmp/hosts /etc/hosts ln -sf /tmp/hosts /etc/hosts
ln -sf /tmp/hostname /etc/hostname ln -sf /tmp/hostname /etc/hostname
ln -sf /tmp/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf ln -sf /tmp/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf
mkdir -p /etc/NetworkManager/system-connections/
ln -sf /tmp/kiosk.nmconnection /etc/NetworkManager/system-connections/kiosk.nmconnection
systemctl daemon-reload systemctl daemon-reload
@ -72,7 +70,6 @@ systemctl disable avahi-daemon || true
systemctl disable bluetooth || true systemctl disable bluetooth || true
systemctl enable kiosk-ssh-keys systemctl enable kiosk-ssh-keys
systemctl enable NetworkManager
systemctl enable kiosk-wifi systemctl enable kiosk-wifi
systemctl enable kiosk-autossh systemctl enable kiosk-autossh
systemctl enable kiosk-watchdog systemctl enable kiosk-watchdog
@ -95,15 +92,10 @@ apt install -y hyperion
# Run Hyperion as the 'pi' user # Run Hyperion as the 'pi' user
mkdir -p /etc/systemd/system/hyperiond.service.d mkdir -p /etc/systemd/system/hyperiond.service.d
echo -e "[Service]\nUser=pi\nGroup=pi" > /etc/systemd/system/hyperiond.service.d/override.conf echo -e "[Service]\nUser=pi\nGroup=pi" > /etc/systemd/system/hyperiond.service.d/override.conf
mkdir -p /var/lib/hyperion chown -R pi:pi /var/lib/hyperion || true
mkdir -p /etc/hyperion
chown -R pi:pi /var/lib/hyperion
chown -R pi:pi /etc/hyperion chown -R pi:pi /etc/hyperion
usermod -a -G video pi usermod -a -G video pi
# clean up apt cache to reduce image size
apt clean
# generate a version info/build info file # generate a version info/build info file
echo -n "Chromium version: " >> /version-info echo -n "Chromium version: " >> /version-info
dpkg --list | grep "ii chromium " >> /version-info dpkg --list | grep "ii chromium " >> /version-info
@ -111,3 +103,7 @@ dpkg --list | grep "ii chromium " >> /version-info
echo -n "Linux kernel version: " >> /version-info echo -n "Linux kernel version: " >> /version-info
ls /lib/modules/ | sort -r | head -n 1 >> /version-info ls /lib/modules/ | sort -r | head -n 1 >> /version-info
echo >> /version-info echo >> /version-info
# Clean up apt cache and remove unused packages
apt-get clean
apt-get autoremove -y

View File

@ -1,6 +1,6 @@
[Unit] [Unit]
Description=Generate NetworkManager connection profile from kioskbrowser.ini Description=Generate wpa_supplicant.conf from kioskbrowser.ini
Before=NetworkManager.service Before=wpa_supplicant.service dhcpcd.service
[Service] [Service]
Type=oneshot Type=oneshot

View File

@ -1,50 +1,27 @@
#!/bin/bash #!/bin/bash
set -e
echo "Generating NetworkManager connection profile..." if [ -f "/boot/wpa_supplicant.conf" ]; then
ln -s /boot/wpa_supplicant.conf /tmp/wpa_supplicant.conf
exit
fi
WIFI_SSID=$(get-ini /boot/kioskbrowser.ini wifi ssid) WIFI_SSID=$(get-ini /boot/kioskbrowser.ini wifi ssid)
WIFI_PSK=$(get-ini /boot/kioskbrowser.ini wifi psk) WIFI_PSK=$(get-ini /boot/kioskbrowser.ini wifi psk)
WIFI_COUNTRY=$(get-ini /boot/kioskbrowser.ini wifi country)
if [ -z "${WIFI_SSID}" ]; then if [ -n "${WIFI_SSID}" ]
echo "No WiFi SSID configured. Exiting." then
exit 0 echo "country=${WIFI_COUNTRY}" > /tmp/wpa_supplicant.conf
echo "ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev" >> /tmp/wpa_supplicant.conf
echo "update_config=1" >> /tmp/wpa_supplicant.conf
echo "network={" >> /tmp/wpa_supplicant.conf
echo " ssid=\"${WIFI_SSID}\"" >> /tmp/wpa_supplicant.conf
if [ -n "${WIFI_PSK}" ]
then
echo " psk=\"${WIFI_PSK}\"" >> /tmp/wpa_supplicant.conf
else
echo " key_mgmt=NONE" >> /tmp/wpa_supplicant.conf
fi
echo "}" >> /tmp/wpa_supplicant.conf
fi fi
# The profile will be written to /tmp and symlinked from /etc
PROFILE_NAME="kiosk"
PROFILE_PATH="/tmp/${PROFILE_NAME}.nmconnection"
# Generate a UUID for the connection
UUID=$(uuidgen)
# Create the NetworkManager connection file
cat > "${PROFILE_PATH}" << EOF
[connection]
id=${PROFILE_NAME}
uuid=${UUID}
type=wifi
interface-name=wlan0
autoconnect=true
[wifi]
mode=infrastructure
ssid=${WIFI_SSID}
[wifi-security]
auth-alg=open
key-mgmt=wpa-psk
psk=${WIFI_PSK}
[ipv4]
method=auto
[ipv6]
method=auto
EOF
# Set the correct permissions
chmod 600 "${PROFILE_PATH}"
chown root:root "${PROFILE_PATH}"
echo "Successfully created connection profile at ${PROFILE_PATH}."

View File

@ -1,4 +1,5 @@
<h1>Kioskbrowser</h1> <h1>Kioskbrowser</h1>
<h2>Version: <?php echo exec('git describe --tags --abbrev=0'); ?></h2>
CPU temperature: <br> CPU temperature: <br>
<?php passthru("sudo vcgencmd measure_temp"); ?> <?php passthru("sudo vcgencmd measure_temp"); ?>

View File

@ -0,0 +1,14 @@
#!/bin/bash
echo > /etc/apt/sources.list
echo "deb http://deb.debian.org/debian bookworm main contrib non-free" >> /etc/apt/sources.list
echo "deb http://security.debian.org/debian-security bookworm-security main contrib non-free" >> /etc/apt/sources.list
echo "deb http://deb.debian.org/debian bookworm-updates main contrib non-free" >> /etc/apt/sources.list
apt update
APT_LISTCHANGES_FRONTEND=none DEBIAN_FRONTEND=noninteractive apt -o Dpkg::Options::="--force-confold" -f -y dist-upgrade
# 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