pmaports/main/postmarketos-base-ui/rootfs-etc-NetworkManager-conf.d-hostname-mode.conf
Oliver Smith 13a7778f94
main/postmarketos-base-ui: NetworkManager: hostname-mode=none (MR 2457)
Disable the hostname management feature of NetworkManager. This isn't
useful for the postmarketOS use case, where we set one hostname in
/etc/hostname via pmbootstrap and want it to be used. (It makes more
sense for normal PCs, which may just have the hostname 'localhost' at
the end of the installation and then not be unique in the network.)

NetworkManager is supposed to only change the hostname if it is set to
localhost, however this detection does not work properly in
postmarketOS. I've skimmed through sources of elogind, NetworkManager
and OpenRC a bit and found that in OpenRC the definitive location to put
the hostname is /etc/hostname. The other path, /etc/conf.d/hostname, is
just a fallback. Experiments show that setting something in
/etc/conf.d/hostname does prevent NM from setting a hostname offered by
the DHCP server, but it's not clear to my why this happens. I suspect
elogind + dbus. Disabling this feature we don't need anyway seems like a
good approach to me without wasting too much time here.
2021-08-24 14:37:41 +02:00

4 lines
127 B
Text

[main]
# Don't mess with the hostname, just let the system use the one from
# /etc/hostname (pmaports#768).
hostname-mode=none