opnsense-deps/config/GATEWAY.conf
Jeremy Karst e1b9aa77fd Drop the cross-build leftovers, pilot and migrate-device.sh
The build runs natively on arm64 since 2026-11-18: setup no longer installs
qemu-user-static and aarch64-binutils (and refuses a non-aarch64 host),
GATEWAY.conf drops PRODUCT_WANTS_CROSS, build no longer asks tools for an
xtools set, finish no longer moves one aside, and mk-image.sh no longer
sets up xtools or removes qemu. The pilot command, which timed ports
before the first full build, goes too.

Gateways are migrated with the shell commands in RELEASE.md, as
ApolloGuardian was, instead of migrate-device.sh; that includes the
custom mirror for a proxy that is not on 443 inside the LAN, and the
major upgrade's UPGRADE_RELEASE.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 20:41:11 -05:00

80 lines
2.8 KiB
Text

# Mono Gateway Development Kit (NXP LS1046A)
# https://mono.si
#
# Boot: U-Boot booti (NOT EFI -- loader.efi broken on this SoC)
# Console: serial 115200 (headless, no video output)
# U-Boot lives on QSPI NOR -- not installed from SD card
export PRODUCT_KERNEL=GATEWAY
export PRODUCT_TARGET=arm64
export PRODUCT_ARCH=aarch64
export PRODUCT_COMSPEED=115200
export HOSTNAME=mono-gateway
export ARM_FAT_SIZE="80m -b 32m"
# No PRODUCT_UEFI -- we boot via U-Boot booti, not EFI
# deps directory (opnsense-deps repo with board modules, tools, configs)
DEPSDIR="${DEPSDIR:-/usr/deps}"
MONO_GW_DEPS="${MONO_GW_DEPS:-${DEPSDIR}/dist}"
arm_install_uboot()
{
# We need kernel.img and DTB on the FAT boot partition for U-Boot to
# load via booti.
# Move kernel
mv ${STAGEDIR}/boot/kernel/kernel.bin \
${STAGEDIR}/boot/msdos/kernel.img
# Copy device tree binary
mkdir -p ${STAGEDIR}/boot/msdos/dtb
cp ${STAGEDIR}/boot/dtb/freescale/mono-gateway-dk.dtb \
${STAGEDIR}/boot/msdos/dtb/
# rc.conf.local must be written here (not in arm_hook) because
# setup_xbase() deletes rc.conf.local after arm_hook runs.
local MONO_GW_RCD="${DEPSDIR}/rc.d"
if [ -f "${MONO_GW_RCD}/rc.conf.local" ]; then
cat "${MONO_GW_RCD}/rc.conf.local" >> \
"${STAGEDIR}/etc/rc.conf.local"
fi
}
arm_hook()
{
local STAGEDIR=${1}
# The generic arm_hook (extras.conf) already ran and set
# primaryconsole=video. Fix it: this board has no video.
sed -i '' \
's|<primaryconsole>video</primaryconsole>|<primaryconsole>serial</primaryconsole>|' \
${STAGEDIR}${CONFIG_XML}
sed -i '' '/<secondaryconsole>/d' ${STAGEDIR}${CONFIG_XML}
# Headless serial only (generic set -D for dual console)
echo "-S${PRODUCT_COMSPEED} -h" > ${STAGEDIR}/boot.config
# Serial console: auto-detect terminal size on login
echo "resizewin" >> ${STAGEDIR}/root/.profile
# --- Install mono-gateway package ---
# All board-specific files (kernel modules, userspace tools, configs,
# rc.d scripts) are delivered via the mono-gateway FreeBSD package.
# Install using the host's pkg via chroot, same mechanism as
# setup_packages() in common.sh. /dev must be mounted for pkg -c.
# The package is also published in the OPNsense repository, so it is
# annotated as coming from there and later updates follow that repo.
local MONO_GW_PKG=$(ls ${MONO_GW_DEPS}/mono-gateway-*.pkg 2>/dev/null | head -1)
if [ -n "${MONO_GW_PKG}" ]; then
cp "${MONO_GW_PKG}" "${STAGEDIR}/tmp/"
mount -t devfs devfs "${STAGEDIR}/dev"
pkg -c "${STAGEDIR}" add "/tmp/$(basename ${MONO_GW_PKG})"
pkg -c "${STAGEDIR}" annotate -qyA mono-gateway repository OPNsense
umount "${STAGEDIR}/dev"
rm "${STAGEDIR}/tmp/$(basename ${MONO_GW_PKG})"
else
echo ">>> ERROR: mono-gateway package not found in ${MONO_GW_DEPS}" >&2
echo ">>> Run: make -C /usr/deps package OPS_VERSION=<release>" >&2
return 1
fi
}