Skip to content

Commit 3dda963

Browse files
committed
fix: update hostname based on SMBIOS
1 parent 3361cc9 commit 3dda963

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

‎config/before.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ log "Running before.txt as first boot configuration"
99
# Update generic hostname
1010
# Command:
1111
# update_generic_hostname <generic hostname>
12-
update_generic_hostname rock-2 rock-5t radxa-rk3528 radxa-rk3576 radxa-a733
12+
update_generic_hostname rock-2 rock-5t radxa-rk3528 radxa-rk3576 radxa-a733 radxa-orion-cix-p1
1313

1414
# Create default accounts
1515
# Commands:

‎src/usr/lib/rsetup/cli/system.sh‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,12 @@ update_generic_hostname() {
100100
local current_hostname
101101
current_hostname="$(hostname)"
102102

103-
if __in_array "$current_hostname" "$@" >/dev/null
104-
then
103+
if __in_array "$current_hostname" "$@" >/dev/null; then
104+
if [[ ! -f /proc/device-tree/compatible ]]; then
105+
update_hostname "$(dmidecode -s system-product-name)"
106+
else
105107
update_hostname "$(get_product_id)"
108+
fi
106109
fi
107110
}
108111

0 commit comments

Comments
 (0)