diskimage-builder/diskimage_builder/elements/gentoo/pre-install.d/02-gentoo-02-flags
Matthew Thode 041bdd331a
use stage3 instead of stage4 for gentoo builds
The main reason for using the stage4 is now gone (kernel compile).
Install and use the distro provided binary kernel package.

In addition to this, set the locale and timezone, beyond that very
little was done in the gentoo stage4.

Change-Id: I541b7d9b807e2357398ae1c249b1978958dd1137
Signed-off-by: Matthew Thode <mthode@mthode.org>
2020-05-27 18:50:16 -05:00

46 lines
1.9 KiB
Bash
Executable File

#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
# get the directories in order
mkdir -p /etc/portage/profile
mkdir -p /etc/portage/package.accept_keywords
if [ -f /etc/portage/package.keywords ]; then
mv /etc/portage/package.keywords /etc/portage/package.accept_keywords/prebuilt-1
fi
mkdir -p /etc/portage/package.mask
mkdir -p /etc/portage/package.unmask
mkdir -p /etc/portage/package.use
# needed in order to install pip packages as root
echo 'dev-python/pip vanilla' >> /etc/portage/package.use/pip
# needed to create disk images
echo 'sys-fs/lvm2 -thin' >> /etc/portage/package.use/grub
echo 'sys-boot/grub device-mapper' >> /etc/portage/package.use/grub
# needed in order to install pip packages as root
echo '=dev-python/pip-9.0.1-r2 ~amd64' >> /etc/portage/package.accept_keywords/pip
# needed to install static kernel
echo '~sys-apps/debianutils-4.9.1 ~amd64' >> /etc/portage/package.accept_keywords/kernel
echo 'sys-kernel/installkernel-gentoo ~amd64' >> /etc/portage/package.accept_keywords/kernel
echo 'sys-kernel/gentoo-kernel-bin ~amd64' >> /etc/portage/package.accept_keywords/kernel
# needed for sfdisk to work
echo '~sys-apps/util-linux-2.35.2 ~amd64 # sfdisk growpart fix' >> /etc/portage/package.accept_keywords/util-linux
if [[ "${GENTOO_PROFILE}" == *"systemd"* ]]; then
# systemd import-tar is broken, use a more recent (fixed) version
echo '~sys-apps/systemd-241 ~amd64' >> /etc/portage/package.accept_keywords/systemd
fi
if [[ "${GENTOO_PROFILE}" == *"musl"* ]]; then
echo "dev-vcs/git -gpg" >> /etc/portage/package.use/musl # gpg doesn't build on musl profiles
echo "=sys-block/open-iscsi-2.0.874-r1 ~amd64" >> /etc/portage/package.accept_keywords/musl
echo "=sys-block/open-isns-0.97 ~amd64" >> /etc/portage/package.accept_keywords/musl
echo "sys-libs/pam cracklib" >> /etc/portage/package.use/musl
fi