[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Re: How to get preseed to ASK me for hostname + strange partitioning behaviour



Jonas Bygdén <jbygden@gmail.com> writes:

>> Am Donnerstag, dem 20.01.2022 um 13:16 +0100 schrieb Jonas Bygdén:
>> > I'm trying to get an automatic install of 11.2 working using a preseed file:
>> > (https://gist.github.com/jby/7c3010e7157286166acee617ef47da30 <https://gist.github.com/jby/7c3010e7157286166acee617ef47da30>)
>> > hosted on a server running nginx.
>> > According to the nginx logs the file is read.
>> > What I'd like to accomplish is to have the install be as fully automated as
>> > possible, but I *want* the question about what hostname to give the client.
>> > I was told that setting these settings would make it ask me for the hostname:
>> > d-i netcfg/get_hostname seen false
>> > d-i netcfg/get_domain seen false
>> > and/or maybe this:
>> > d-i netcfg/hostname seen false
>> 
>> Works for me. I have a profile for simple-cdd which does exactly that.
>> 
>> > However, no matter how I do it it always sets the hostname to the default
>> > 'debian'.
>> >  
>> > How do I get it to ask me for the hostname? Are the order of the commands in
>> > the preseed file significant?
>> 
>> Yes. the "seen false" must come after any pre-seeting of the value. Maybe
>> you'll have to move the
>> 
>> d-i netcfg/get_domain seen false
>> d-i netcfg/get_hostname seen false
>> 
>> also after preseeding netcfg/hostname? I make sure that the "seen false"
>> entries always come after everything else.
> Do you mean at the end of the file, or is it enough to have it at the end of the section?
>
> I now have this in my preseed file, at the place where it’s in the example file, since I’ve based my config on that:
>
> # Any hostname and domain names assigned from dhcp take precedence over
> # values set here. However, setting the values still prevents the questions
> # from being shown, even if values come from dhcp.
> #d-i netcfg/get_hostname seen false
> #d-i netcfg/get_domain seen false
> #d-i netcfg/get_hostname string unassigned-hostname
> #d-i netcfg/get_domain string unassigned-domain
> d-i netcfg/get_hostname unassigned-hostname
> d-i netcfg/get_domain unassigned-domain
> d-i netcfg/get_hostname seen true
> d-i netcfg/get_domain seen true

The thing to realise is that the 'seen' flag tells debconf that the user
has seen the question, and that it should therefore not be asked it
again. Also, that setting something via preseeding automatically sets
the seen flag (otherwise the user would get asked the question anyway,
so preseeding would be a bit useless)

So, you need to reset the 'seen' flag to 'false' _after_ setting the
value you want it to default to.

In the above, in the commented section you're setting it to false before
setting the value, so that only survives for a moment before being
automatically set again, and in the lower attempt you're setting 'seen'
to 'true' (which prevents the question being shown, and is redundant
anyway because it just got set true by the preseed setting just above).

I'd normally do it thus:

d-i netcfg/get_hostname unassigned-hostname
d-i netcfg/get_hostname seen false

d-i netcfg/get_domain unassigned-domain
d-i netcfg/get_domain seen false


HTH

Cheers, Phil.
-- 
|)|  Philip Hands  [+44 (0)20 8530 9560]  HANDS.COM Ltd.
|-|  http://www.hands.com/    http://ftp.uk.debian.org/
|(|  Hugo-Klemm-Strasse 34,   21075 Hamburg,    GERMANY


Reply to: