diskimage-builder/diskimage_builder/elements/gentoo/pre-install.d/02-gentoo-03-enable-overlays
Matthew Thode 4d5ba1497c
simplify updating python versions in gentoo
portage now generates /etc/python-exec/python-exec.conf based on the
order of PYTHON_TARGETS in /etc/portage/make.conf

fixes an issue where ARCH was being detected as amd64 not x86_64
fixes kernel installs (virtual/dist-kernel)

standardizes simple if statements (note, the 'shorthand' method will
pass the exit code back to shell but the 'longhand' does not).

Change-Id: I74041c232bc6ab4d6e67a4ecfaa759aa4a5feb6c
Signed-off-by: Matthew Thode <mthode@mthode.org>
2021-01-27 11:34:09 -06:00

38 lines
983 B
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
emerge ${GENTOO_EMERGE_DEFAULT_OPTS} --oneshot openssl openssh
# install layman
emerge ${GENTOO_EMERGE_DEFAULT_OPTS} --deep --ignore-built-slot-operator-deps=y layman
# set layman config options
sed -i 's/^check_official.*/check_official : No/g' /etc/layman/layman.cfg # allow unoffical repos
# 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