On 2020-04-28, Buck wrote:
> This is not clear.  It sounds like a riddle.  Please provide examples of 
> usage of each.

What is not clear? What is a riddle? Examples of usage of each of what?

I will admit, I am feeling the same way about these bug reports from
this side of the computer screen. :P


>>> It would be helpful if you could provide your proposed profile in
>>> more detail. 
>
> I will, now that I know you want this.  But first in this message and
> your next reply, I want to eliminate usage errors as the problem.
> Then we can move into the details of the profile.

Yes, it could have saved a *lot* of back and forth to provide those up
front.

It is much easier to explain specific details that demonstrate specific
issues and concepts than speak about this sort of thing in general...


>> If you want to override parts of the "default" profile, you also need
>> ~/my-simple-cdd/profiles/default.* as well. The "default" profile is
>> always included, and for questions asked very early in debian-installer,
>> the only way to preseed some questions using simple-cdd.
>
> Wait wait whoah whoah.  The docs I've been reading for weeks don't
> sound like this at all.  I'm going to explain what I've been lead to
> believe.  You will hopefully tell me *specifically* how I am wrong,
> and suggest correct usage instead.

What docs are you referring to?

From the README:

  Default Profile

  the profile named "default" is special, because it always gets installed.

  modify the profile/default.* files with care, as simple-cdd relies upon the
  default profile working in certain ways ...


> My objective is to build a QEMU image of an installer that requires
> zero (ZERO) user interaction, and can actually be run headless,
> because it knows the answers ahead of time.  Then I want this VM to
> automatically run a script after Debian is install, and this script
> pulls from a private Git repo, and runs another script from that repo.
> That's the objective.

It's certainly possible, as long as all the packages you install support
debconf preseeding correctly.

The "test" profile attempts to automate everything in this way, and
might be a good example of the kinds of things you may need for a fully
automated install.

It's actually used as a profile to test the other profiles with minimal
interaction, and is meant to simply be added to the profiles to automate
testing a profile:

  simple-cdd --profiles x-basic,ltsp,router,test --auto-profiles test,router

Should include all four profiles (plus the default profile) on the
installer image, and then automatically select the test and router
profiles without interaction.

  simple-cdd --profiles x-basic,ltsp,router,test

Should generate an image with the same profiles as above, but prompt for
which you want to use at installation time (obviously not your desired
use-case, but I include it for the clarification of the difference
between --profiles and --auto-profiles).


> I've been lead to believe that to accomplish this, I need a
> custom.preseed file that answers all of the important questions.  And
> I need a custom.postinst that is a BASH script.

Not necessarily bash, most likely /bin/sh, possibly whatever #! you put
in your script. Though it's been a long time since I've looked, it might
specifically require #!/bin/sh...

The .postinst scripts are really just for quick hacks that can't be
handled with preseeding.


> And these must be the only files read by build-simple-cdd, and they go
> in profiles/ under the directory I run build-simple-cdd from (which is
> ~/my-simple-cdd).
...
> I've been lead to believe that if I put custom.preseed and
> custom.postinst into a profiles/ directory under ~/my-simple-cdd, and
> I run `build-simple-cdd --profiles custom` from within
> ~/my-simple-cdd, then the custom profile will be read.  The
> implication from the docs is that *only* the custom profile will be
> read if I am using `--profiles custom`.

I don't understand where you get this impression from.


> But when I run with `--profiles custom`, I get an image, which I run
> in QEMU and I see a normal default Debian installer that asks me if I
> want graphical vs text, etc. and

The default profile attempts to answer many debconf questions, but may
need updates to reflect new questions in debian-installer or installed
packages. It hasn't been tested by me since the release of buster...


> then asks me to choose a language and I know I (think I) put that in
> my custom.preseed file.

Language selection is addressed in the README in the "Language and
Country Selection" heading. It's one of those special configurations.

There's also some debian-installer documentation the briefly touches on
what questions can be answered with which methods of preseeding:

  https://www.debian.org/releases/stable/amd64/apbs01.en.html

There are a lot of other things documented in the adjacent
chapters. It's pretty much what simple-cdd is designed to facilitate, as
a thin layer on top of debian-installer.

Currently, simple-cdd uses the CD/DVD preseeding method, though I
actually should consider switching to the initrd method, which would be
more flexible and avoid some of these problems. If only I had more
time...


>>  That said, not including or aggressively overriding contents in the default 
>> profile is
>> possible to break how simple-cdd works, so be selective in what you
>> override.
>
> That's not helpful!  Please point me to the docs that explain the
> precise interplay between default and custom profiles, including a
> specific list of what I must not override!

There are no such docs. The specific values change over time largely
entirely outside of simple-cdd...

Once or twice a Debian release cycle(usually near a release), simple-cdd
gets updates, or when people help by reporting and ideally fixing
issues. It's been that way for the majority of the 16 years it has
existed... I'm honestly surprised that's it's still around!


>> In general, I've tried to make the default profile not too
>> intrusive, so it shouldn't need to be overridden in most cases...
>
> Thank you, but the docs suggested to me that it must be completely
> overridden, 100%, as in default vs custom is either/or.  So I'll need
> details of what is "most cases" vs other cases, etc.

Yes, I would recommend copying whatever files you need to modify from
/usr/share/simple-cdd/profiles/ into your working ./profiles/ directory
and change as little as you can to get what you want.


>>> If you want to override the built-in profiles, you need to create
>>> replacement files (e.g. profiles/default.preseed,
>>> profiles/default.*), though I would generally recommend providing
>>> additional profiles rather than overriding the default profiles.
>
> Okay but again, please point to docs that give a detailed explanation
> of how custom and default profiles interact.

When you run:

  simple-cdd --profiles=PROFILE

For each file type it looks first in ./profiles/PROFILE.* and if it
doesn't find one, it looks in /usr/share/simple-cdd/profiles/PROFILE.*

The "default" profile is *always* loaded, so if you want to change
something in it, you need to add ./profiles/default.* for any of the
files you want to change or override.

The "default" profile is loaded a little earlier than the other
profiles; any other simple-cdd profiles will be loaded after the
"default" profile preseed has run and should be able to overwrite the
"default" settings ... except for things that have already been used by
debian-installer.


>> The custom.preseed file may not be loaded till later in the process; it
>> depends on which questions you're thinking are answered by it. There is
>> a question during the install that asks which simple-cdd profiles to
>> load; any pquestions asked before that obviously can't be preseeded.
>
> Okay and I see why you need my exact files and I will send them.  But
> first please tell me this: is my objective of a 100% non-interactive
> QEMU image of a Debian installer possible with simple-cdd or will
> there always be some requirement for user interaction?

It should be possible, but often time all the exact questions asked may
be hard to track down.


>> Where do you expect $default_desktop to be defined?
>
> That was essentially the question I was asking you in
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=958276 but I think
> it does not matter because that error was caused by me removing the
> default profiles.  I did not expect to ever see $default_desktop and I
> do not want my installer to require a desktop, and it does not require
> any GUI or UI because it must require no user interaction.

Ok, let's drop that part of the issue then...


>> you can just specify one of the profiles in
>> /usr/share/simple-cdd/profiles, preferably in a directory that does not
>> contain any "profiles" directory:
>
> That was the opposite of what I am trying to test.  I am asking you to
> please recommend a default set of profile files I can download, put
> into ~/my-simple-cdd/profiles, and run with `build-simple-cdd
> --profiles thatone` so that I can test if the problem is my specific
> profiles files, or the process of loading a custom profile.  Once I
> understand correct usage, and I test running with a custom profile set
> (in ~/my-simple-cdd/profiles) *then* any errors I have must be from my
> profile files, and I will send those here.

There's no real difference in simple-cdd profiles defined in ./profiles/
and in /usr/share/simple-cdd/profiles, other than the order in which
simple-cdd looks for files, preferring the files in the ./profiles/
directory.

The files in /usr/share/simple-cdd/profiles are just examples that are
effectively enableable out of the box.


> The suggestion you gave uses profiles in
> /usr/share/simple-cdd/profiles, that are pre-loaded/included profiles,
> not custom ones, and custom is what I want to test.

Then copy one of those profiles from /usr/share/simple-cdd/profiles/
into ./profiles/ and adjust the settings in the files to test it.


>> simple-cdd --profiles router,x-basic
>> If that's not working, then there's definitely a bug in simple-cdd.
>
> Right and that does build an installer.  But that doesn't mean that
> there isn't a bug in simple-cdd because this usage is different from
> what I am using, and the result is different from my desired result.
> So although this does not prove that simple-cdd has a bug, it does not
> prove that `build-simple-cdd --profiles custom` does not have a bug.

  cp profiles/usr/share/simple-cdd/router.* ./profiles/

... rename all the ./profiles/router.* to ./profiles/some-custom-profile.*

  simple-cdd --profiles=some-custom-profile --auto-profiles=some-custom-profile

You have a custom profile very similar to the example "router" profile!


> I appreciate you going through this with me at this level of detail.

I am very glad, as this has taken quite a bit of time. :)


> Maybe this is not a bug, but simply an incorrect understanding of what
> simple-cdd can do, or most likely my incorrect understanding of how to
> use it.  But I've read every doc on the subject and this usage is what
> was made clear to me, so at a minimum I hope to help illuminate issues
> with the doc.

Once you grasp this, I would *very* much appreciate patches to improve
the documentation. :)


live well,
  vagrant

Attachment: signature.asc
Description: PGP signature

Reply via email to