diskimage-builder/diskimage_builder/elements/gentoo/pre-install.d/02-gentoo-03-enable-overlays
Matthew Thode 89f95a5351
enable caching for gentoo builds
To facilitate this I've created two new environment variables to set
the environment and default options for package actions.

eval is needed for the export as it preserves quotes.

Change-Id: Ib03651ee8dacd48cd1c135afd57cd31101356056
Signed-off-by: Matthew Thode <mthode@mthode.org>
2018-10-15 23:17:37 -05:00

43 lines
1.3 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 /usr/portage/profiles ]]; then
emerge-webrsync -q
fi
# layman requires cryptography, which needs ecc crypto functions.
# binaries providing those functions have questionable legality for
# redistribution, so we have to use a version of openssl that works around
# it (using fedora's patchset) and also use a version of cryptography that
# depends on that version of openssl.
echo '=dev-python/cryptography-2.1.4-r2 ~amd64' >> /etc/portage/package.keywords/layman
echo '=dev-libs/openssl-1.0.2o-r6 ~amd64' >> /etc/portage/package.keywords/layman
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