The hostname can be set (in order of precedence):
- via
hostnameboot option - via DHCP (either from HOSTNAME or FQDN)
- Default hostname
linuxrc doesn't write to /etc/hostname, but sets the transient hostname
and writes other settings before Yast starts. After that, Yast takes over.
See https://github.com/yast/yast-network/blob/master/doc/hostname.md
etc/hostnameis an empty file at the beginning of the installationlinuxrcdoesn't write anything to/etc/hostnamelinuxrcwrites by default/etc/install.inf::SetHostname=1
linuxrcwrites/etc/sysconfig/network/dhcp::DHCLIENT_SET_HOSTNAME="yes"
- linuxrc writes
/etc/install.inf::SetHostnameUsed=1 - linuxrc takes the value of
hostnameboot option and- writes it to
/etc/install.inf::Hostname - sets the transient hostname to that value
- writes it to
If hostname=myhost is used
/etc/install.inf
[...]
SetHostname: 1
SetHostnameUsed: 1
Hostname: myhost
[...]
linuxrcdoesn't write/etc/install.inf::Hostname, so it is not present.linuxrcwrites/etc/install.inf::SetHostnameUsed=0.linuxrcsets the transient hostname toinstall.
/etc/install.inf
[...]
SetHostname: 1
SetHostnameUsed: 0
[...]
linuxrc changes the hostname to rescue, which may be overridden by user hostname boot option.
This value is put into /etc/hostname of the rescue system. The value there
may later be overridden by DHCP.