• Re: Re: How to get preseed to ASK me for hostname + strange partitionin

    From =?utf-8?Q?Jonas_Bygd=C3=A9n?=@21:1/5 to All on Thu Jan 20 16:50:02 2022
    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

    # If you want to force a hostname, regardless of what either the DHCP
    # server returns or what the reverse DNS entry for the IP is, uncomment
    # and adjust the following line.
    #d-i netcfg/hostname string somehost
    #d-i netcfg/hostname seen false

    # Disable that annoying WEP key dialog.
    #d-i netcfg/wireless_wep string
    # The wacky dhcp hostname that some ISPs use as a password of sorts.
    d-i netcfg/dhcp_hostname string debian
    d-i netcfg/get_hostname seen true
    d-i netcfg/get_domain seen true

    But I still only get it set to ‘debian’ without question.

    [..]
    Another thing:

    When I use the above linked preseed file on a (VMWare-) VM it correctly picks
    up the partitioning set in the preseed file,
    'd-i partman-auto/method string crypto' in my case.
    However, when using it on physical hardware (Dell laptops) it seems to ignore
    that and give me the dialog asking how to do it.

    Can someone please help me figure this out?

    The detection mmechanism to detect the installation drive is not perfect. It is
    possible that it fails to detect the correct drive and doesn't know how to handle it. I use scripts to make an educated guess and set partman-auto/disk via partman/early_command.

    You should check /var/log/installer/syslog and console 4 (when the above happens) to see what happened.

    Regards, Daniel
    --
    Regards,
    Daniel Leidert <dleidert@debian.org> | https://www.wgdd.de/ <https://www.wgdd.de/>
    GPG-Key RSA4096 / BEED4DED5544A4C03E283DC74BCD0567C296D05D
    GPG-Key ED25519 / BD3C132D8B3805D1808123AB7ACE00941E338C78

    https://www.fiverr.com/dleidert <https://www.fiverr.com/dleidert> https://www.patreon.com/join/dleidert <https://www.patreon.com/join/dleidert>


    <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><blockquote type="cite" class=""><pre style="white-space: pre-
    wrap; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">Am Donnerstag, dem 20.01.2022 um 13:16 +0100 schrieb Jonas Bygdén:
    &gt; I'm trying to get an automatic install of 11.2 working using a preseed file:
    &gt; (<a rel="nofollow" href="https://gist.github.com/jby/7c3010e7157286166acee617ef47da30" class="">https://gist.github.com/jby/7c3010e7157286166acee617ef47da30</a>)
    &gt; hosted on a server running nginx.
    &gt; According to the nginx logs the file is read.
    &gt; What I'd like to accomplish is to have the install be as fully automated as
    &gt; possible, but I *want* the question about what hostname to give the client.
    &gt; I was told that setting these settings would make it ask me for the hostname:
    &gt; d-i netcfg/get_hostname seen false
    &gt; d-i netcfg/get_domain seen false
    &gt; and/or maybe this:
    &gt; d-i netcfg/hostname seen false

    Works for me. I have a profile for simple-cdd which does exactly that.

    &gt; However, no matter how I do it it always sets the hostname to the default &gt; 'debian'.
    &gt; &nbsp;
    &gt; How do I get it to ask me for the hostname? Are the order of the commands in
    &gt; 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.
    </pre></blockquote>Do you mean at the end of the file, or is it enough to have it at the end of the section?<div class=""><br class=""></div><div class="">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:</div><div class=""><br class=""></div><div class=""><div class=""># Any hostname and domain names assigned from dhcp take precedence over</div><div class=""># values set here. However, setting the values still prevents the
    questions</div><div class=""># from being shown, even if values come from dhcp.</div><div class="">#d-i netcfg/get_hostname seen false</div><div class="">#d-i netcfg/get_domain seen false</div><div class="">#d-i netcfg/get_hostname string unassigned-
    hostname</div><div class="">#d-i netcfg/get_domain string unassigned-domain</div><div class="">d-i netcfg/get_hostname unassigned-hostname</div><div class="">d-i netcfg/get_domain unassigned-domain</div><div class="">d-i netcfg/get_hostname seen true</
    <div class="">d-i netcfg/get_domain seen true</div><div class=""><br class=""></div><div class=""># If you want to force a hostname, regardless of what either the DHCP</div><div class=""># server returns or what the reverse DNS entry for the IP is,
    uncomment</div><div class=""># and adjust the following line.</div><div class="">#d-i netcfg/hostname string somehost</div><div class="">#d-i netcfg/hostname seen false</div><div class=""><br class=""></div><div class=""># Disable that annoying WEP key
    dialog.</div><div class="">#d-i netcfg/wireless_wep string</div><div class=""># The wacky dhcp hostname that some ISPs use as a password of sorts.</div><div class="">d-i netcfg/dhcp_hostname string debian</div><div class="">d-i netcfg/get_hostname seen
    true</div><div class="">d-i netcfg/get_domain seen true</div><div class=""><br class=""></div><div class="">But I still only get it set to ‘debian’ without question.</div><blockquote type="cite" class=""><pre style="white-space: pre-wrap; caret-color:
    rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">
    [..]
    &gt; Another thing:
    &gt; &nbsp;
    &gt; When I use the above linked preseed file on a (VMWare-) VM it correctly picks
    &gt; up the partitioning set in the preseed file,
    &gt; 'd-i partman-auto/method string crypto' in my case.
    &gt; However, when using it on physical hardware (Dell laptops) it seems to ignore
    &gt; that and give me the dialog asking how to do it.
    &gt; &nbsp;
    &gt; Can someone please help me figure this out?

    The detection mmechanism to detect the installation drive is not perfect. It is possible that it fails to detect the correct drive and doesn't know how to handle it. I use scripts to make an educated guess and set partman-auto/disk via partman/early_command.

    You should check /var/log/installer/syslog and console 4 (when the above happens) to see what happened.

    Regards, Daniel
    --
    Regards,
    Daniel Leidert &lt;<a href="mailto:dleidert@debian.org" class="">dleidert@debian.org</a>&gt; | <a rel="nofollow" href="https://www.wgdd.de/" class="">https://www.wgdd.de/</a>
    GPG-Key RSA4096 / BEED4DED5544A4C03E283DC74BCD0567C296D05D
    GPG-Key ED25519 / BD3C132D8B3805D1808123AB7ACE00941E338C78

    <a rel="nofollow" href="https://www.fiverr.com/dleidert" class="">https://www.fiverr.com/dleidert</a>
    <a rel="nofollow" href="https://www.patreon.com/join/dleidert" class="">https://www.patreon.com/join/dleidert</a>
    </pre></blockquote><div class=""><br class=""></div></div></body></html>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Philip Hands@21:1/5 to All on Thu Jan 20 17:20:01 2022
    d-i netcfg/get_hostname unassigned-hostname
    ^
    as Daniel points out, you're missing 'string' in these (as I then copied ... oops!)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Philip Hands@21:1/5 to jbygden@gmail.com on Thu Jan 20 17:20:01 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)