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

enabling fetch_url to deal with inline data



Hi,

It occurs to me that it would be nice to be able to put inline data in
some places where we currently only accept URLs.  For instance, when
specifying the keys to go with additional 'local' repos.

AFAIK at present, such keys can only be specified as the content of a
file, which then needs to be available via a URL somehow, rather than
within the preseed file itself.

I think the right place to put it would probably be as an additional
"proto" handler in fetch_url's methods.

One could make up a pretend protocol (a scheme in URI parlance) of e.g.
"base64" and then specify something like:

  d-i apt-setup/local0/key string base64://bm90IHJlYWxseSBhIGtleQ==

or one could go with the standards, and use the 'data' scheme, and
specify something like:

  d-i apt-setup/local0/key string data:base64,bm90IHJlYWxseSBhIGtleQ==

I cannot think of good reasons to support the full set of variations
available via the data scheme, so it seems like we'd end up throwing an
error if anyone tries to use any of them.

If that's the case, we might as well not bother pretending to support
the data scheme, and just make up our own.  This also allows us to put
the // after the colon (as above) which means that the main code in
fetch_url need not be touched, and so the patch will be trivial and
obvioulsy safe.

Does anyone have opinions, or perhaps a better suggestion for a made-up
scheme name?

If not, I'll knock up a 'base64' method for fetch_url, and do some testing.

BTW This will also need busybox to have the base64 component turned on
for the udeb, which seems to add about 1k to the size of the udeb.

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

Attachment: signature.asc
Description: PGP signature


Reply to: