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

Re: Multiple late_command entries in preseed



Matt Hart <matthew.hart@linaro.org> writes:

> Hi all,
> TL;DR Can d-i support multiple late_command entries in a preseed?
>
> Long version:
> I'm adding support for testing automated installers into LAVA
> (https://validation.linaro.org/static/docs/#what-is-lava) which lets
> testers provide a kernel, ramdisk and preseed file which LAVA boots
> on a device and follows the install through.
>
> I need to use a late_command to copy some files into the installed target
> so we can test the installed system when it boots. But I also have to
> support users providing a preseed file that already has a late_command.
>
> This makes for some awkward parsing of backslashes and semicolons
> where I have to work out how to add an extra command at the end of the
> string they have already defined.
> As you can imagine, appending another late_command to the file would
> be considerably easier. Or late_command2, late_command3 etc.
>
> Maybe there's an easier way of doing this and I've missed something?

You just get the one late_command.

I think I'd deal with this by running the user-provided preseed files
through sed to chang the late_command to something of your chosing, and
then making your late command chain into that if it's defined.

You should be able to do the sed (or whatever) bit with preseed/run and
a script that takes the user-provided preseed as a parameter.

There are some examples of preseed/run usage in here:  http://hands.com/d-i/

It also has examples of defining your own debconf variables -- look for
"db_register" here http://hands.com/d-i/jessie/start.sh for instance.

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: