sys-kernel/coreos-kernel: strip ROOT from TMPDIR before running dracut

Update-bootengine chroots into the sysroot and runs dracut from there.
Dracut 053 has revised TMPDIR handling and the portage TMPDIR prefixed
with ROOT leaks into the chroot. This causes dracut to abort during
setup with the error message "invalid tmpdir".

Override TMPDIR before running update-bootengine to allow dracut to
function.

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
This commit is contained in:
Jeremi Piotrowski 2021-07-13 13:33:58 +00:00
parent 68f2867457
commit 743f86d4da

View File

@ -46,7 +46,8 @@ pkg_setup() {
[[ -n "${KV_OUT_DIR}" ]] || die "Failed to detect modules build tree"
if [[ "${ROOT:-/}" != / ]]; then
${ROOT}/usr/sbin/update-bootengine -m -c ${ROOT} -k "${KV_FULL}" || die
# TMPDIR needs to be corrected for chroot
TMPDIR=${TMPDIR#${ROOT}} ${ROOT}/usr/sbin/update-bootengine -m -c ${ROOT} -k "${KV_FULL}" || die
else
update-bootengine -k "${KV_FULL}" || die
fi