|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# This script will install chromium to use with the browser block |
| 4 | +# If the device is a Raspberry Pi (any model), it will use the version |
| 5 | +# from the raspios repo (together with mesa and X), because |
| 6 | +# * Since Debian 12, the upstream chromium provided in Debian repos |
| 7 | +# does not work on armv7 at all |
| 8 | +# * The upstream chromium will not work on devices with < 1GB memory |
| 9 | +# namely the Pi3A and the PiZero2 even when using aarch64 |
| 10 | +# * The Raspberry Pi 5 needs patched versions of mesa and X to work |
| 11 | + |
| 12 | +BASE_DIR="/usr/src/build" |
| 13 | +CHROMIUM_PACKAGE="chromium" |
| 14 | + |
| 15 | +MACHINE_NAME="$1" |
| 16 | + |
| 17 | +# FORCE_RPI_REPO=0 never includes the repo |
| 18 | +# FORCE_RPI_REPO=1 always includes the repo |
| 19 | +# If the machine name starts with "raspberry", or if the machine |
| 20 | +# is a balenaFin, include the repo |
| 21 | +if [ "${FORCE_RPI_REPO}" != "0" ] && [ "${FORCE_RPI_REPO}" = "1" -o "${MACHINE_NAME:0:9}" = "raspberry" -o "${MACHINE_NAME}" = "fincm3" ] |
| 22 | +then |
| 23 | + echo "Enabling raspios repository" |
| 24 | + |
| 25 | + cp -a "${BASE_DIR}/rpi/raspi.list" "/etc/apt/sources.list.d/" |
| 26 | + cp -a "${BASE_DIR}/rpi/raspberrypi-archive-stable.gpg" "/etc/apt/trusted.gpg.d/" |
| 27 | + |
| 28 | + # The RPi-patched chromium package is called chromium-browser |
| 29 | + CHROMIUM_PACKAGE="chromium-browser" |
| 30 | +else |
| 31 | + # The node library launches /usr/bin/chromium-browser |
| 32 | + # which is not provided by the upstream package |
| 33 | + ln -s /usr/bin/chromium /usr/bin/chromium-browser |
| 34 | +fi |
| 35 | + |
| 36 | +install_packages \ |
| 37 | + ${CHROMIUM_PACKAGE} \ |
| 38 | + chromium-common \ |
| 39 | + libgles2-mesa \ |
| 40 | + lsb-release \ |
| 41 | + mesa-vdpau-drivers \ |
| 42 | + scrot \ |
| 43 | + x11-xserver-utils \ |
| 44 | + xserver-xorg-input-evdev \ |
| 45 | + xserver-xorg-legacy \ |
| 46 | + xserver-xorg-video-fbdev \ |
| 47 | + xserver-xorg xinit \ |
| 48 | + xinput \ |
| 49 | + xterm |
0 commit comments