Skip to content

Commit 36241d5

Browse files
committed
Only trim serial number for hostname
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.
1 parent 4ac4dfc commit 36241d5

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

rootfs_overlay/etc/boardid.config

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# boardid.config
22

3-
# Read the D1's SID and use the last 8 digits (turns out 4 isn't sufficient)
3+
# Read the D1's SID
44
# NOTE: I couldn't find good information on how reliable this method was in
55
# producing a unique ID. The SID info in the D1's datasheet was on
66
# accessing the SID and not on how the eFuse's were programmed. Please
77
# let me know if you find definitive info on this.
8-
-b binfile -f /sys/bus/nvmem/devices/sunxi-sid0/nvmem -l 16 -k 0 -n 8
8+
-b binfile -f /sys/bus/nvmem/devices/sunxi-sid0/nvmem -l 16 -k 0

rootfs_overlay/etc/erlinit.config

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# Additional configuration for erlinit
2+
#
3+
# To override the settings in this file, see
4+
# https://hexdocs.pm/nerves/advanced-configuration.html#overriding-erlinit-config-from-mix-config.
5+
#
26

37
# Turn on the debug prints
48
#-v
@@ -61,10 +65,10 @@
6165
# Erlang release search path
6266
-r /srv/erlang
6367

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

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

0 commit comments

Comments
 (0)