build icon indicating copy to clipboard operation
build copied to clipboard

[Feature Request]: Set hostname with automatic first boot config

Open spinpwr opened this issue 7 months ago • 3 comments

Which feature would you like to have?

I am about to setup a cluster of SBCs with Armbian and read about "Automatic first boot configuation": https://docs.armbian.com/User-Guide_Autoconfig/

I thought it would be great to be able to set the desired hostname from this config too, e.g. PRESET_HOSTNAME directive.

I have found that it's done in armbian-firstlogin script here. I am happy to help if you think this is a feature worth implementing, with some guidance I could make a PR for it.

Funding

spinpwr avatar May 27 '25 10:05 spinpwr

Hey @spinpwr! 👋

Thanks for opening your first issue with the Armbian project — we’re glad to have you here! 🧡
Your input doesn’t just help us improve the project — it benefits everyone who uses Armbian.

If you'd like to stay informed about project updates or collaborate more closely with the team,
you can optionally share some personal contact preferences at armbian.com/update-data.
This helps us keep in touch without relying solely on GitHub notifications.

Also, don’t forget to ⭐ star the repo to support the work — and welcome aboard! 🚀

github-actions[bot] avatar May 27 '25 10:05 github-actions[bot]

Jira ticket: AR-2690

github-actions[bot] avatar May 27 '25 10:05 github-actions[bot]

Firstboot config runs the /root/provisioning.sh[^1] script at the end, and the docs explicitly mention setting the hostname this way. https://docs.armbian.com/User-Guide_Autoconfig/#provisioning-script

The not so obvious part is assigning unique hostnames for a cluster in a coordinated way. Some possibilities:

  1. You can use meaningful suffixes, such as the MAC addresses: ip link show | awk '/ether/ {gsub(/:/, ""); print substr($2, 7); exit}'
  2. SBC's serial number: awk '/^Serial/ {print $3}' /proc/cpuinfo
  3. Curl names from a central server (could be a 10-line python script)

[^1]: Note the .sh extension, docs omit it mistakenly

ZoomRmc avatar Jun 10 '25 13:06 ZoomRmc

@x13-me in a mood ?

igorpecovnik avatar Jun 23 '25 18:06 igorpecovnik