Fix FlareSolverr Chromium startup on HA OS

This commit is contained in:
Alexandre
2025-09-21 20:54:49 +02:00
parent 20ec912c2d
commit bc85050b47
4 changed files with 35 additions and 2 deletions

View File

@@ -1,4 +1,8 @@
## 3.4.1-1 (21-09-2025)
- Fix Chromium startup by hardening the shared memory helper for large reported sizes (thanks to community reports)
## 3.4.1 (20-09-2025)
- Update to latest version from FlareSolverr/FlareSolverr (changelog : https://github.com/FlareSolverr/FlareSolverr/releases)
## 3.4.0 (26-08-2025)

View File

@@ -80,6 +80,6 @@
"slug": "flaresolverr",
"udev": true,
"url": "https://github.com/alexbelgium/hassio-addons",
"version": "3.3.25",
"version": "3.4.1-1",
"webui": "[PROTO:ssl]://[HOST]:[PORT:8191]"
}

View File

@@ -0,0 +1,29 @@
#!/usr/bin/env bashio
# shellcheck shell=bash
set -euo pipefail
fix_file="/etc/chromium.d/dev-shm"
if [ -f "${fix_file}" ]; then
bashio::log.info "Patching Chromium shared memory helper for reliable startup"
cat <<'PATCH' > "${fix_file}"
# shellcheck shell=sh
# Patched by alexbelgium/hassio-addons to avoid arithmetic errors with large values on some shells.
shm_avail=$(findmnt -bnr -o avail -T /dev/shm 2>/dev/null)
if python3 - "${shm_avail}" <<'PY'
import re
import sys
raw = sys.argv[1] if len(sys.argv) > 1 else ''
match = re.search(r'\d+', raw)
value = int(match.group(0)) if match else 0
LIMIT = 4080218931
sys.exit(0 if value < LIMIT else 1)
PY
then
export CHROMIUM_FLAGS="${CHROMIUM_FLAGS} --disable-dev-shm-usage"
fi
PATCH
chmod 0644 "${fix_file}"
fi

View File

@@ -1,5 +1,5 @@
{
"last_update": "20-09-2025",
"last_update": "21-09-2025",
"repository": "alexbelgium/hassio-addons",
"slug": "flaresolverr",
"source": "github",