mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2025-12-09 00:07:57 +03:00
linux-info.eclass: Fix building modules when /lib/modules is locked down
/lib/modules/*/build is often a symlink. get_version is usually run in pkg_setup as root, so fully resolve it then in case the unprivileged user doesn't have permission to do it later. Closes: https://bugs.gentoo.org/957187 Signed-off-by: James Le Cuirot <chewi@gentoo.org>
This commit is contained in:
parent
eff2c417dc
commit
4145a2143b
@ -574,7 +574,12 @@ get_version() {
|
||||
# We cannot use the local version to find the output directory
|
||||
# because that is where it is written to.
|
||||
KV_OUT_DIR+="/lib/modules/${KV_FULL}/build"
|
||||
[[ -d ${KV_OUT_DIR} ]] && break
|
||||
# build is often a symlink. This function is usually run in
|
||||
# pkg_setup as root, so fully resolve it now in case the
|
||||
# unprivileged user doesn't have permission to do it later. If we
|
||||
# don't have permission now, then this will fall back to KV_DIR
|
||||
# below, which is probably where the build symlink points to anyway.
|
||||
KV_OUT_DIR=$(realpath -q -e "${KV_OUT_DIR}") && break
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user