Sometimes, depending on the buffering, or length of data being received,
the end of the data could be the 1st byte or so of a UTF8 character.
This would cause a crash when trying to decode the raw data buffer.
This switches it to only decode once a full line has been found.
It also adds tests for the LogMonitor class.
Make sure that os.ftruncate() is called with an int() size. Before python
3.10 it used to handle this internally, but in 3.9 it was deprecated and
in 3.10 it now raises an error:
TypeError: 'float' object cannot be interpreted as an integer
This makes sure that the size is truncated to an int(). The value is in
bytes, so truncation does not lose anything.
dracut needs a reasonable chroot environment in order to run correctly.
This adds the DracutChroot context manager that sets up and tears down
mounts inside the root directory tree.
Switch to using it in creator.rebuild_initrds_for_live() and
TreeBuilder.rebuild_initrds()
The branding package name doesn't always match the product name. This
saves the branding package names as discovered in the enabled repos and
exposes it to the templates as branding.release and branding.logos --
which could potentially be None so the template needs to take that into
account.
Related: rhbz#1956205
weldr-client has replaced composer-cli so remove all of the code and
tests, adjust various things so they don't expect it to be available,
and rename some things like test/composertest.py to reflect its
exclusive use by lorax.
This will cause livemedia-creator to terminate anaconda and exit when an
install hits an error that often causes anaconda to get stuck and not
exit.
Resolves: rhbz#1900596
When monitoring log output in livemedia-creator --no-virt it could get
stuck if the output from anaconda stops for some reason.
This changes execReadlines so that it will only read output when it is
available, will monitor the process state, and continue to call the
callback function.
It also adds a final timeout on proc.communicate() so that if Anaconda
becomes stuck and won't exit livemedia-creator will eventually exit.
When the no-virt callback terminates anaconda on an error it now sends a
TERM signal to all of the unshare process' children because just sending
it to unshare doesn't cause anaconda to exit.
Because of the way that compress pipes things between processes it would
leave open file descriptors, and running processes around for a bit.
This waits for them to exit and closes the fds before returning.
Python will eventually close open files, but it is recommended to
explicitly close them instead of waiting for the gc or program exit.
This fixes all the uses of open...read/write in the codebase, mostly in
tests.
Creating /proc/modules just quiets one dracut warning, it doesn't
actually effect the initrd that is created.
Now that mock is being run with netsharedpath set to exclude /proc is
causes problems for running lorax inside a mock, so just remove this to
prevent a crash when it doesn't exist.
Related: rhbz#1848201
The host system can run out of space while running mksquashfs, and while
this is logged to program.log it isn't detected by lorax or
livemedia-creator so it will continue running, possibly reporting
unrelated errors and causing confusion.
This adds checks for the return status when calling mksquashfs, logs it
to the log, and either exits or raises an error immediately.
Previously the release package was chosen by picking the first package
that provides 'system-release' that isn't named generic. This can cause
branding issues with repos containing multiple system-release packages.
This patch changes _install_branding so that it will give preference to
a system-release package that ends with lowercase --variant name. If
there isn't one it will fall back to the previous behavior.
Resolves: rhbz#1472622
epoch wasn't included in the lorax-packages.log, but arch is. And for
the debuginfo the epoch, including 0, *is* included. This should match
the previous output.
Resolves: rhbz#1815000
A change in glibc now requires /proc be mounted in order to run mknod
which is needed in order to run rpm from runtime-postinstall.
This drops that code from the template and moves writing the package
list into run_transaction, which already has all of the needed
information to generate the list.
Resolves: rhbz#1812895
It isn't always obvious what happened when the rootfs runs out of space,
especially when using lorax via pungi. So this checks for the out of
space error string when building the runtime image and logs it to the
primary logfile and console as an error with the rootfs size.
eg.
2020-01-20 18:52:58,920: The rootfs ran out of space with size=1
startProgram is running in binary mode, so bufsize=1 is invalid. The
ExecLineReader class already breaks it up into lines using readline() so
there is no need to change the default buffering.
On some platforms (aarch64, ppc64le) toolchain limitations/optimizations
can break anaconda startup, as discussed in rhbz#1722181. The workaround
is to preload libgomp.so before starting anaconda.
The 'enabled' field in the /compose/types output now reflects whether or
not the type is supported on the current architecture. Disabled types
are not allowed to be built, and will raise an error like:
Compose type 'alibaba' is disabled on this architecture