#719101 netcfg: provide a clean way to change default hostname (for derivatives)

Package:
netcfg
Source:
netcfg
Submitter:
Raphaël Hertzog
Date:
2013-08-08 15:45:07 UTC
Severity:
wishlist
#719101#5
Date:
2013-08-08 13:11:12 UTC
From:
To:
For Kali, we obviously wanted to have "kali" as the default hostname. Up
to now we just used to add this in preseed.cfg in our installer initrd:

# Change default hostname
d-i netcfg/get_hostname string kali
d-i netcfg/get_hostname seen false

Unfortunately this has bad side-effects such as the impossibility to
actually automate a PXE install because the "seen" flag is always reset
to false (even if we pass "hostname=kali" on the kernel command line).

That's because the preseed in the initrd is evaluated after the preseed
for the kernel command line and takes precedence over it.

Thus I would suggest to add another preseed_variable
"netcfg/default_hostname" that would be used as default value
when asking the question for "netcfg/get_hostname". The derivatives could
preseed "netcfg/default_hostname" to adjust the default hostname
and the end-users still have the possibility to preseed
"netcfg/default_hostname" to automate installs.

Would this be possible?

Cheers,

#719101#10
Date:
2013-08-08 14:09:47 UTC
From:
To:
Raphaël Hertzog <hertzog@debian.org> (2013-08-08):

Use hostname?=kali on the kernel command line instead?

Mraw,
KiBi.

#719101#15
Date:
2013-08-08 15:42:33 UTC
From:
To:
That goes in the opposite direction. This ensures that the seen flag stays
at false. I really want seen=true so that the question is not
displayed but since the initrd contains seen=false, the seen=true set
by the early preseed from the kernel command line is reverted...

At least that's my understanding of the problem I have been experiencing.

Another solution would be to have a two-step parsing of kernel command
line preseeds, we could add "!hostname=kali" or something like that would
be only parsed after the initrd preseed and would thus override those set
there.

Cheers,