diskimage-builder/diskimage_builder/elements/gentoo/pre-install.d/02-gentoo-03-enable-overlays
Matthew Thode f1d7e902e3
support alternate portage directories
The 17.1 profile changed the defaults used in portage for where we store
our repo, distfiles and binpkgs.  Some portage related variables need to
be set deterministically.  17.1 is no enabled for Systemd's profile.

Change-Id: Ib55f6875c5cb461c3c530b51d7420ce3dc8da360
2019-07-26 19:30:01 -05:00

41 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
if [[ ${GENTOO_OVERLAYS} != '' ]]; then
if mountpoint -q /dev/shm; then
echo "/dev/shm found in /proc/self/mountinfo"
elif [[ -k /dev/shm ]]; then
echo "/dev/shm exists and is stickied"
else
fix_shm
fi
if [[ ! -f ${PORTDIR}/profiles ]]; then
emerge-webrsync -q
fi
# upstream has problems with supporting other libcs still
if [[ "${GENTOO_PROFILE}" == *"musl"* ]]; then
echo '>=sys-block/open-iscsi-2.0.875' >> /etc/portage/package.mask/open-iscsi
echo '=sys-block/open-iscsi-2.0.874-r2' >> /etc/portage/package.keywords/open-iscsi
fi
emerge ${GENTOO_EMERGE_DEFAULT_OPTS} --oneshot openssl openssh
# install layman
emerge ${GENTOO_EMERGE_DEFAULT_OPTS} --oneshot --deep --ignore-built-slot-operator-deps=y layman
# sync the initial overlay list
layman -S
# enable the various overlays, ignore failures (overlay my already be enabled)
set +e
for OVERLAY in ${GENTOO_OVERLAYS}; do
layman -a "${OVERLAY}"
done
set -e
unfix_shm
fi