From: phil@hands.com
john doe writes:
> On 8/15/25 09:51, Philip Hands wrote:
>> john doe writes:
>>
>>> At [1, B.2.3] says that if an URL has no slash in it
>>> "d-i/trixie/./preseed.cfg" the default path will be used.
>>>
>>> Is there a way to have that same path for an other file than preseed.cfg
>>> (E.G: "url=example.com/alternative.cfg" would translate to
>>> "d-i/bookworm|trixie/./alternative.cfg")?
>>
>> What you probably ought to be doing instead is specifying the option you
>> want via the `classes` setting (an alias for `auto-install/classes`),
>> and then implementing the behaviour you want by setting `preseed/run` in
>> a minimal preseed.cfg, and having a script do whatever you want in
>> response to the classes= setting you specified.
>>
>> So your preseed.cfg would just be:
>> =-=-=-=
>> d-i preseed/run string start.sh
>> =-=-=-=
>>
>> and your start.sh would be something like:
>> =-=-=-=
>> #!/bin/sh
>> . /usr/share/debconf/confmodule
>>
>> db_get auto-install/classes
>> db_set preseed/include "${RET:-default}".cfg;;
>> =-=-=-=
>> (you might want to check that the value of $RET makes sense before using
>> it)
>>
>> Then the real configs go in `default.cfg` and `alternative.cfg`
>> (assuming you're planning on specifying `classes=alternative`)
>>
>
> Appreciate the detailed explanation and the example. With the provided
> example everything works as desired provided that "classes=default" is
> set as kernel boot parameter.
>
> Before I can contribute to your repo, I first need to better understand
> how everything works.
Ah, when I said MRs welcome, I was referring to MRs for the general D-I
documentation.
Of course, if you have contributions to the hands-off preseeding
framework, that's great, but I don't think that's a good place to
document the use of classes & preseed/run simply because the people that
would benefit from that documentation are unlikely to find it if it's
hidden in my repo.
So, instead, I was hoping that you might have some idea where it would
have helped you most to have come across such documentation.
> E.G: what is the best way to test the start.sh SCR..
If you want to play further with hands-off, just try doing an automatic
install using url=hands.com (which should result in you being prompted
with "Here you can specify a list of classes ..." that can be seen in
start.sh, which will demonstrate that you're running start.sh).
The thing that's perhaps not immediately obvious is the filter scripts.
If a class has a filter script, it is used to filter the current set of
classes, which gives one the chance to add dependencies, or remove
conflicting classes from the set that is finally used.
Mostly these scripts are implemented via a script called filter_classes
that's part of the framework. It allows one to add classes by simply
listing them, and remove classes by prefixing them with a '-'.
The framework pipes the set of classes through all of those classes'
filters, and repeats that action until the output matches the input.
After that, one (hopefully) has a consistent set of classes that then
get used to assemble the preseed snippets into a configuration, and
early and late scripts to be run.
Cheers, Phil.
--
Philip Hands -- https://hands.com/~phil
--=-=-Content-Type: application/pgp-signature; name="signature.asc"
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEE3/FBWs4yJ/zyBwfW0EujoAEl1cAFAmijjaYACgkQ0EujoAEl
1cAfZxAAyWHonrEGGEtuMPrZT5b0wPq2W8gwevMD6VjyLPJZeOeJ3yAwK+FYdeic
MEGCW33kI24yIEEgF28KqvF16M6Lb753huutzof4i1us43ZQOomzMcWRwxwP8V87
lEtERoReJRb8b0IIj043rITne2ikPeHQX7tQsglDcXYoBVVamdNATUArgAs31L3g
YMkmfibSyhO9i/O6TgT+2kr6K7xBD/bBlak4ylcEWWOSDcK9svt4gMtUmdHaAsfO
b+JZOPuf8JmoSL9GVD8pfWjKXBfz2WIFIYQFw1SmxDi+eXaYjJJzcQRsCj2TmZTx
DB3DUGKplo7cbwOV2iRaptI1xRateE+bFMgK6jC6gQa8xVTgPmDliRvJlZ3AitHq
cq1m6Q/l1IuB9aUrhKd7Ud0iuB2CR8l8fjzLzYkORFVayocj0JUE+smGN0Yd9YpV
02eXY+r3jblwEdzpER1mSYglH96umFnDbLf7ffTgTTTJ5KdzfFafLfcbUcouavwt
Hcrff9qQ7a0zx0ayoH/v382vf4aLqisL2inxDFG54Wi8uK/Hh76b+htsyI0G4ZqW
jE+dxpL3xiyn4MX13Z1XMgGHl+lWU7AJZ/qDbTyWEy6UfhPbsJQ2fUeMjc3+Zjiy
hszW3ahU/LwtaZ/4oeqj7ZyB5WlUolqh1c8T9PVI+CuTbY2Bod8k4+
-----END PGP SIGNATURE-----
--- SoupGate-Win32 v1.05
* Origin: you cannot sedate... all the things you hate (1:229/2)
|