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

Bug#511683: Latest auto-install does not respect DHCP preseeding



On Fri, Jan 16, 2009 at 05:57:13PM +0100, Frans Pop wrote:
> On Tuesday 13 January 2009, Jonathan Quick wrote:
> > While playing with the DHCP preseeding method for the installer in
> > 'auto' mode, I discovered that the 20090112-20:05 daily i386 netboot
> > image now asks for a preseed/url despite it being specified by the DHCP
> > server - presumeably the check for a preseed/url or preseed/file is
> > done too early ie. before the value is filled in from the DHCP server
> > response .  In contrast, the lenny RC1 installer picks up the DHCP
> > specified preseed file as expected.
> 
> I think your analysis is correct. This looks like a regression introduced 
> in auto-install (1.4), which just does not allow for the fact that the 
> URL can also be set using DHCP.
> 
> Phil: please take a look ASAP!
> This really should be fixed before RC2, possibly by reverting the change.

OK, I've just committed a fix.

Note that this needs the latest versions of the choosers to work properly.
That's because the code works like this:

  localechooser.isinstallable checks if preseed/url is set -- it cannot
  check DHCP preseeding yet because the networks not up at this point.
  If we're in auto-install and there's a preseed/url, delay the chooser
  by returning 1. Also touch /var/run/delay_choosers

  kbd-chooser.isinstallable bases it's decision on the presence of
  /var/run/delay_choosers

  auto-install.postinst, as a result of this patch, now checks for the
  presence of a dhcp preseed setting in addition to preseed/url -- if
  found it gets rid of /var/run/preseed_unspecified_at_boot so later
  preseed scripts will know that a preseed was specified

The patch also moves the code for finding dhcp preseed URL from
network-preseed.postinst into the new dhcp_preseed_url() function
in preseed.sh and uses that function in auto-install.postinst,
network-preseed.isinstallable and network-preseed.postinst.

The result of this is that, if the Automatic Install option is specified,
and no preseed is specified, either on kernel command line, or DHCP,
then preseed/url will be propted for.  Otherwise, the choosers are delayed
until after the network is up, so that the network preseed can also set
these settings.  The exception is if the preseed URL is specified by
DHCP, since we cannot tell if that's the case once the network is up,
so for DHCP preseeding the kbd & locale will still need to be preseeded
via the pxelinux.cfg kernal command line.

Cheers, Phil.



Reply to: