Skip to content
Snippets Groups Projects
Verified Commit 8e289b7d authored by Johannes Schauer Marin Rodrigues's avatar Johannes Schauer Marin Rodrigues
Browse files

Do not attempt installing reform-qcacld2 in the background if inside chroot

If this script is not run on a real system with a real init process but
in a container-like chroot environment, then creating these background
processes without waiting for their completion will leave zombie
processes behind which hog resources like /dev/null and thus prevent the
container software from cleanly un-mounting bind-mounts as they may have
been created for /dev/null. We cannot reliably detect whether the
container manager will automatically wait for and reap zombie processes,
so as a hacky workaround, we just make this script a no-op if it is
started inside a chroot environment.
parent 306296af
No related branches found
No related tags found
No related merge requests found
Pipeline #2512 failed
......@@ -14,6 +14,20 @@ update_package() {
apt install -y reform-qcacld2
}
# If this script is not run on a real system with a real init process
# but in a container-like chroot environment, then creating these
# background processes without waiting for their completion will leave
# zombie processes behind which hog resources like /dev/null and thus
# prevent the container software from cleanly un-mounting bind-mounts
# as they may have been created for /dev/null. We cannot reliably
# detect whether the container manager will automatically wait for and
# reap zombie processes, so as a hacky workaround, we just make this
# script a no-op if it is started inside a chroot environment
if ischroot; then
echo "I: chroot environment detected: not attempting to install reform-qcacld2 in the background" >&2
exit 0
fi
echo "Starting background process to update reform-qcacld2 driver package (for Wi-Fi) to match kernel version."
# Background because we need to wait for the main running apt install process to finish
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment