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

Re: preseeding in auto mode URL syntax without hardcoding directory of release name



On 8/15/25 09:51, Philip Hands wrote:
john doe <johndoe65534@mail.com> 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.
E.G: what is the best way to test the start.sh SCR..

Thanks for everything.

--
John Doe


Reply to: