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

Bug#848597: debian-installer: iPXE script in DHCP bootfile option is interpreted as preseed filename



On Wednesday 21 December 2016 10:36:30 Philip Hands wrote:
> Philip Hands <phil@hands.com> writes:
> > Pali Rohár <pali.rohar@gmail.com> writes:
> >> Package: debian-installer
> >> Severity: normal
> >> 
> >> Dear Maintainer,
> >> 
> >> when DHCP server is configured to send bootfile option with iPXE
> >> script
> >> 
> >> then debian-installer fails with following "red" error:
> >>   [!!] Download debconf preconfiguration file
> >>   
> >>   Failed to process the preconfiguration file
> >>   
> >>   The installer failed to process the preconfiguration file from
> >>   <bootfile>. The file may be corrupt.
> >> 
> >> (where <bootfile> is value of that DHCP option)
> >> 
> >> It looks like debian-installer expects that DHCP bootfile option
> >> will contains correct preseed file. And if that DHCP option
> >> contains not Debian preseed file, then it show above "red" error
> >> message.
> > 
> > Is it the case that iPXE config files are the only things we need
> > to worry about here?  (seems probable given the lack of previous
> > reports)
> > 
> > If so, we could just check for '#!ipxe' and if found downgrade the
> > error to a warning, or perhaps to log what happened but otherwise
> > ignore it.
> 
> It occurs to me that we could fix this by adding a feature.
> 
> If we had something that looked out for some string, and would
> interpret it as an instruction to immediately chain into a new file,
> ignoring the rest of the current file, then one could specify the
> preseed to use in the iPXE config, by adding something like this
> near the start:
> 
>   # DEBCONF_CHAIN_LOAD(preseed.cfg)
> 
> If we were looking for /DEBCONF_CHAIN_LOAD([^(]*)/ then it would
> probably work in anything that has a way of specifying comments,
> since it could as easily find it after '// ', '<!-- ' or whatever,
> although we'd need to survive whatever preamble such files might
> have -- I guess we could additionally scan for that string anywhere
> in the file before throwing the problematic error.

This sounds good. With this regex we can check if file provided in DHCP 
bootfile can be processed by Debian installer or not.

> This ought only require us to use the parameter to populate
> preseed/include and then stop processing the current file.
> 
> Cheers, Phil.

-- 
Pali Rohár
pali.rohar@gmail.com

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: