Skip to content

Commit

Permalink
Only trim serial number for hostname
Browse files Browse the repository at this point in the history
Serial numbers previously were limited to 8 characters everywhere. This
changes the configuration so that they're only limited for hostnames
where there's some benefit of making them easier to type. Everywhere
else can use the whole serial number or decide what part of it they
want.
  • Loading branch information
fhunleth committed Jul 8, 2024
1 parent 4ac4dfc commit 36241d5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions rootfs_overlay/etc/boardid.config
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# boardid.config

# Read the D1's SID and use the last 8 digits (turns out 4 isn't sufficient)
# Read the D1's SID
# NOTE: I couldn't find good information on how reliable this method was in
# producing a unique ID. The SID info in the D1's datasheet was on
# accessing the SID and not on how the eFuse's were programmed. Please
# let me know if you find definitive info on this.
-b binfile -f /sys/bus/nvmem/devices/sunxi-sid0/nvmem -l 16 -k 0 -n 8
-b binfile -f /sys/bus/nvmem/devices/sunxi-sid0/nvmem -l 16 -k 0
8 changes: 6 additions & 2 deletions rootfs_overlay/etc/erlinit.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Additional configuration for erlinit
#
# To override the settings in this file, see
# https://hexdocs.pm/nerves/advanced-configuration.html#overriding-erlinit-config-from-mix-config.
#

# Turn on the debug prints
#-v
Expand Down Expand Up @@ -61,10 +65,10 @@
# Erlang release search path
-r /srv/erlang

# Assign a hostname of the form "nerves-<serial_number>".
# Assign a hostname of the form "nerves-<last 8 chars of the serial number>".
# See /etc/boardid.config for locating the serial number.
-d /usr/bin/boardid
-n nerves-%s
-n nerves-%-.8s

# If using shoehorn (https://github.com/nerves-project/shoehorn), start the
# shoehorn OTP release up first. If shoehorn isn't around, erlinit fails back
Expand Down

0 comments on commit 36241d5

Please sign in to comment.