#867677 initramfs-tools: [patch] feature request: provide hook to set host name in InitRAMFS config dynamically

#867677#5
Date:
2017-07-08 12:48:00 UTC
From:
To:
Dear Maintainer,

when connecting to the InitRAMFS via network (e.g. encrypted root fs), then it is
helpful if the machine can be registered by its name in the DNS, making it possible
to connect to it via its DNS name. Otherwise you have to look up the assigned ip in
the DHCP server log.
Therefore please provide a config and hook that dynamically sets the host name
on InitRAMFS creation.

My current workaround consists of a simple config file and a simple hook script:
/etc/initramfs-tools/conf.d/network
/etc/initramfs-tools/hooks/set_hostname_in_network_config.sh

This workaround is easy to use on any machine without manually editing the host name
on installation or whenever it changes. Also avoiding typos of the host name.
Additionally it gives an explicit point where to define your network configuration
for InitRAMFS-only (not as a kernel command line).

Would be great if you could consider adding this to the package.

Kind regards
Maddes

#867677#10
Date:
2017-07-08 12:54:47 UTC
From:
To:
Updated script, more clean and also processes conf/initramfs.conf
#867677#15
Date:
2017-07-11 19:09:42 UTC
From:
To:
And if you remove the extension .sh, then it is also backwards
compatible with Debian 4.0 "Etch" :)