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

Re: Patch to tidy up wget use, and add return=4 when 404's are seen

On Sun, Mar 02, 2008 at 09:58:59PM +0000, Colin Watson wrote:
> On Sat, Mar 01, 2008 at 04:10:35PM +0000, Philip Hands wrote:
> > The patch to packages/kickseed/initrd-kickseed is untested, and was done
> > just to hint at how that code could be simplified if it used fetch-url.
> > I think it could have most of the other logic ripped out too if it used
> > urls like floppy://... and file://...
> Unfortunately the URLs are not within our control; kickseed's purpose is
> to be compatible with Red Hat's Kickstart implementation, so it's
> limited by what they do. The relevant documentation is here:
>   http://www.redhat.com/docs/manuals/linux/RHL-9-Manual/custom-guide/s1-kickstart2-startinginstall.html

Ah, fair enough -- in that case, I'd suggest (assuming that it's deemed
worthwhile at all) to either make fetch-url able to handle some/all
of these paths, or if we were to decide that they're not nice for some
reason, then have kickseed do a small amount of munging into a URL format
we like, and then let fetch-url deal with the media specific details.

For example, if we wanted to move nfs support into fetch-url, and assuming
that we thought that a URL style like this was most consistent:


Then kickseed could notice the nfs: and turn nfs:<server>:/<path> to
nfs://<server>/<path> and then just call fetch-url nfs://<server>/<path>

Alternatively, we could make fetch-url deal with paths like nfs:<server>:/<path>

Then we move the nfs mounting code from kickseed to whatever
package provides nfs-client capabilities, as /usr/lib/fetch-url/nfs
and any other part of d-i that might be able to tale advantage
of nfs gets the functionality for free, so people get to say
url=nfs://server/d-i/preseed.cfg, perhaps

So, what I'm suggesting is moving all the media specific stuff out of
kickseed into fetch-url methods, and either making fetch-url support
the Kickstart urls natively, or having a few lines of search replace
in kickseed to convert them into a format we prefer.  Then the three case
statements in initrd-kickseed look to me as though they could probably
be replaced with something along the lines of:

  if fetch-url "$KS" "$KSCFG" ; then
    kickseed "$KSCFG"
    logger -t kickseed "... failed"

N.B. that's fetch-url as provided by di-utils after my patch, not
fetch_url from initrd-kickseed, assuming we can get fetch-url to handle
all the media that kickseed needs.  I can imagine that we might also
need some sort of fetch-url-umount thing to unmount all the things that
it decided to mount along the way.

Hope that makes sense.

Cheers, Phil.

Reply to: