Skip to content

WIP: d-i preseed fixes

Lyndon Brown requested to merge jnqnfe/live-build:preseed into master

a few days ago i assisted a user in the mailing list who was trying to make use of d-i preseeding, and i found some issues. i've just tested and polished this off for submission to fix them.

the primary issue is that the manpage info and config (defaults) stuff has been out of sync with installer_preseed since v4.0~21-1 (2013; 966afa2d), which also introduced a regression that has meant that with iso|iso-hybrid|hdd images users have been forced to use --debian-installer-preseedfile preseed.cfg to get the feature working ever since, when previously this was automatic if using the default config filename/path. it also abruptly changed the config files it read without backwards compatibility.

things are detailed properly in the commit log, but to highlight the important things, this:

  • fixes the regression such that the filename preseed.cfg is automatically used for iso|iso-hybrid|hdd image types as previously, saving the user from having to do it with the option.
  • fixes the manpage to update it and clarify that the option is only needed for netboot images now.

the second thing addressed is that i noticed that the install_preseed script would create a corrupt preseed file in circumstances involving multiple user preseed files and the content of one or more of those files not terminating with a newline. essentially it's a simple concatenation issue where the first and last lines of two files get merged into one line.

i also slipped in a tiny manpage typo fix to avoid a separate MR.

a fix is also needed for the manual to at least clarify that the content to put in the preseed file it discusses should be d-i live-installer/enable false not live-installer/enable=false.


minor concern: there's a small detail of install_preseed that confuses me. there are three sources of preseed file content it appends to the output file, config/preseed/*.cfg, config/preseed/*.cfg.installer and chroot/root/packages.installer. i do not know where the last one comes from, whether this is a mistake. note that these three sources are listed in two places in the file. where checks are done in installer_debian-installer this last file is not referred to, and i had to do similar in configuration.sh. researching the origins turns up commit 966afa2d, mentioned above. this commit is very unhelpful; it is titled as a simple move of preseed stuff to its own script, yet does much more in also changing the actual set of config files content is sourced from to this set of three. no explanation is given. the third file was not referred to anywhere else. the only thing my git search turns up even close is the directory cache/packages.installer_debian-installer.udeb. so this source is a complete mystery to me. given the nature of other mistakes i've come across i'd not be surprised if it was part of an incomplete change or an outright mistake. if it's a genuine source then the solution here might need an adjustment to correct for it, but given that the file comes from chroot/* this would be a significant difference to account for properly.


edit: looking at the manual briefly to see how big a effort it might take to update it, it does not discuss this form of preseeding (config/preseed/* files that get written to binary/install/preseed.cfg with a kernel param to point to it), it instead describes a separate method of writing settings into config/includes.installer/preseed.cfg, which gets packed into initrd by installer_debian-installer, so it seems like we may have two working and competing solutions, with only the latter actually described?

some additional interesting commits: 384a050c, eae542da. hmm, there might be some interesting hints to dig up there, i'll just put this on temporary WIP status to dig a little further into the history of things to be a little more confident that in the details of the the approach. i'll get some sleep, get some higher priority stuff done first, then return to this...

Edited by Lyndon Brown

Merge request reports

Loading