diskimage-builder/diskimage_builder/elements/gentoo/root.d/50-gentoo-cache

22 lines
771 B
Plaintext
Raw Normal View History

#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
[ -n "${TARGET_ROOT}" ]
GENTOO_PORTAGE_DISTFILES_DIR="${DIB_IMAGE_CACHE}/gentoo/distfiles"
GENTOO_PORTAGE_PACKAGE_DIR="${DIB_IMAGE_CACHE}/gentoo/packages/${GENTOO_PROFILE}"
GENTOO_PORTAGE_DIR="${DIB_IMAGE_CACHE}/gentoo/portage"
mkdir -p "${GENTOO_PORTAGE_DIR}" "${GENTOO_PORTAGE_PACKAGE_DIR}" "${GENTOO_PORTAGE_DISTFILES_DIR}"
mkdir -p "${TMP_MOUNT_PATH}${PORTDIR}"
sudo mount --bind "${GENTOO_PORTAGE_DIR}" "${TMP_MOUNT_PATH}${PORTDIR}"
mkdir -p "${TMP_MOUNT_PATH}${DISTDIR}"
sudo mount --bind "${GENTOO_PORTAGE_DISTFILES_DIR}" "${TMP_MOUNT_PATH}${DISTDIR}"
mkdir -p "${TMP_MOUNT_PATH}${PKGDIR}"
sudo mount --bind "${GENTOO_PORTAGE_PACKAGE_DIR}" "${TMP_MOUNT_PATH}${PKGDIR}"