Files
hassio-addons/social_to_mealie/rootfs/etc/cont-init.d/99-run.sh
copilot-swe-agent[bot] 912c572ec0 Fix Illegal instruction crash on aarch64 by rebuilding native modules
On aarch64, native Node.js modules (sharp, @next/swc, etc.) may have
been incorrectly cross-compiled via Docker BuildKit QEMU emulation.
Add an npm rebuild step that runs at startup on aarch64 to re-download
the correct prebuilt native binaries for the actual hardware.

Fixes #XXXX

Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com>
2026-02-26 17:13:28 +00:00

20 lines
776 B
Bash
Executable File

#!/command/with-contenv bashio
# shellcheck shell=bash
set -e
bashio::log.info "Starting Social to Mealie"
cd /app || bashio::exit.nok "App directory not found"
# On aarch64, native Node.js modules (sharp, @next/swc, etc.) may have been
# incorrectly cross-compiled via Docker BuildKit QEMU emulation, causing
# "Illegal instruction" crashes on real hardware. Rebuild them for the actual
# native architecture.
if [ "$(uname -m)" = "aarch64" ]; then
bashio::log.info "Ensuring native modules are built for aarch64..."
npm rebuild 2>&1 || bashio::log.warning "Could not rebuild native modules - the addon may not work correctly on this architecture"
fi
chown nextjs /app/entrypoint.sh
chmod +x /app/entrypoint.sh
exec gosu nextjs /app/entrypoint.sh node --run start