Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/v2_3' into dev/v2_3/improved_err…
Browse files Browse the repository at this point in the history
…or_logging
  • Loading branch information
msalinoh committed Dec 9, 2024
2 parents 142f8e9 + 9072e77 commit 89c4646
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions overlay/usr/lib/raspberrypi-sys-mods/firstboot
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ do_resize() {

sethostname() {
if [ -z "$DEVICE_ID" ]; then
DEVICE_ID="$(</proc/cpuinfo grep Serial | sed s/'.*:\s0*'/''/)"
# Grab last 8 characters of serial number
DEVICE_ID="$(</proc/cpuinfo grep Serial | sed s/'.*\(.\{8\}$\)'/'\1'/)"
fi

# If we still have no UID, just give up
Expand All @@ -183,7 +184,7 @@ sethostname() {
fi

# Set device is as the hostname
DEVICE_ID=$(printf "wt-%08x" $((16#$DEVICE_ID)))
DEVICE_ID="wt-$DEVICE_ID"
HOSTNAME="$(hostname)"

if [ "$HOSTNAME" != "$DEVICE_ID" ]; then
Expand Down

0 comments on commit 89c4646

Please sign in to comment.