Packages

Nerves System - OpenWRT One (MediaTek MT7981B / Filogic 820)

Current section

Files

Jump to
nerves_system_openwrt_one rootfs_overlay etc boardid.config
Raw

rootfs_overlay/etc/boardid.config

# boardid.config for the OpenWRT One
#
# boardid prints a unique board serial number that the rest of the Nerves
# stack uses for hostname generation, default node names, and provisioning
# bookkeeping. Lines are tried in order; the first one that returns a
# value wins.
#
# Override this file by dropping a replacement at the same path in your
# Nerves application's rootfs_overlay directory.
# 1. Operator-set serial number stored in the U-Boot environment.
# Set via `fw_setenv nerves_serial_number ...` from the device, or
# via fwup provisioning at flash time. This is the preferred source
# because it lets manufacturing assign meaningful IDs.
-b uboot_env -u nerves_serial_number
# 2. Backwards-compat alias.
-b uboot_env -u serial_number
# 3. Hardware fallback: read the 6-byte factory MAC base out of the SPI
# NOR `factory` MTD partition. Layout (from the device tree):
# offset 0x0 - 0x1000 bytes : WiFi calibration EEPROM
# offset 0x4 - 6 bytes : MAC base (used for eth + wlan derived)
# offset 0x24 - 6 bytes : WAN-specific MAC
# Reading offset 0x4 gives us a per-device unique 12-char hex string
# (e.g. "2005b7013030"). erlinit's `-n nerves-%-.4s` slices off the
# last 4 chars for the hostname, e.g. "nerves-3030".
#
# /dev/mtdblock1 is the SPI NOR `factory` partition on this board.
# If MTD numbering ever changes, update the path here.
-b binfile -f /dev/mtdblock1 -l 6 -k 0x4 -t hex