El hostname in systems based on Linux it is used a lot for different applications, but accessing it is usually done by the workspace and the init system when starting the operating system. The problem can occur if some user space process attempts to read the hostname from the system before it has been set. These problems are or may be part of the present, but their days are numbered and they will disappear during this 2022.
It has been Dan Molding (via Phoronix) who has introduced a kernel parameter in the form of a patch that will allow set the hostname before the workspace starts. Larabel explains one possible scenario where this could be a problem: mdadm relies on the hostname to determine whether it is a local or foreign disk array, and takes different paths. «If mdadm tries to get the hostname before it is read from the file system and set by the init system, you might encounter unexpected behavior", Explain.
Hostname before user-space on Linux in 2022
What this patch would allow would be to set the "hostname=" kernel parameter to something else during the OS boot process, before the file system is mounted and user space has been started. This is an extra step to go from users to administrators in some scenarios, which can be a hassle, but it will be an option that can be used or not. As almost always in Linux, the choice will be ours.
About when this change will be available, that everything must be said, it is likely that not many of us will use it, it is expected to arrive next to Linux 5.19. Linux 5.18 is in development right now, and its stable release is more than likely to arrive tomorrow, so 5.19 should land on July 24 or July 31.