systemd: add patch to consider systemd.hostname= a static hostname #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We use the
systemd.hostname=
kernel commandline parameter to set a unique hostname from factory data via barebox.The current semantics result in somewhat unexpected behaviour when doing so. Clean up the semantics of the systemd.hostname=` kernel parameter to make it more useful and predictable.
The previous semantics were:
systemd.hostname=
takes precedence over/etc/hostname
during boot, even though it is technically considered a transient hostname.systemd-hostnamed
however/etc/hostname
takes precedence oversystemd.hostname=
as it is considered transient again and the normal priorities (static over transient over default) are followed. This means if a new transient hostname is set, the hostname of the system will besethostname()
'd to the one in/etc/hostname
(if present) or the new transient hostname./etc/hostname
does not exist,systemd-hostnamed
does not report a static hostname via dbus to consumers like the NetworkManager dhcp client. In the case of NetworkManager this results in no hostname being set in DHCP requests.The new semantics are:
systemd.hostname=
is considered a static hostname during boot and insystemd-hostnamed
and as such takes precedence over transient or default hostnames.systemd.hostname=
takes precedence over/etc/hostname
.