Support setting custom aptoptions for FAI mika/faiopts
authorMichael Prokop <mika@grml.org>
Thu, 6 May 2021 22:09:05 +0000 (00:09 +0200)
committerMichael Prokop <mika@grml.org>
Thu, 6 May 2021 22:14:57 +0000 (00:14 +0200)
commitf90fcb0ecd170b5e2cfa818c867b93e73a4e2004
tree77f784b95c70eaf0cf701efdcdc1b03822d305c7
parenta9506baa4a8065fbb08f31ce7b132efee18fb409
Support setting custom aptoptions for FAI

/dev/pts might not be available, for for example when running grml-live
inside a (unprivileged) docker container. Then apt/aptitude invocations
cause the following error message to show up:

| E: Can not write log (Is /dev/pts mounted?) - posix_openpt (19: No such device)

Sadly FAI's task_instsoft include the following hardcoded check:

| grep -E "^E:" $LOGDIR/software.log && task_error 472

So whenever the /dev/pts error message shows up, FAI considers this as
error and we're failing installation.

apt supports usage of `-o Dpkg::Use-Pty=0` though to not trigger the
pty related code (pkgDPkgPM::StartPtyMagic()).

By setting the environment variable aptoptions="-o Dpkg::Use-Pty=0" for
FAI execution, we can avoid this error message showing up in FAI's
software.log and being considered as error.

Support passing custom environment variables to the fai command line via
$FAI_ENV.
grml-live