Sam James 9e0ff1f5b3 Fix various minor issues with Gentoo; make CI pass
This patch contains the known set of changes needed to make a gentoo
image build successfully.

- Standardize use of GENTOO_EMERGE_DEFAULT_OPTS, reduce duplication of
  options set there.
- Correct the cleanup commands to reflect standard Gentoo good
  practices by omitting --complete-graph, which is unneeded with --deep,
  and using --changed-use instead of --newuse to reduce unneeded package
  churn.
- Stop using deprecated layman command to manage reposiotry overlays,
  instead use new supported eselect-repository
- Set new USE flags required for LVM and installkernel. This was
  communicated via a Gentoo news item and is a required cleanup.
- Remove now-invalid skip of gpg if using musl

This is the set of changes needed to get the CI job passing and make DIB
build images at all, and we'd like to land them, but there are still
items we'd like to complete to enhance Gentoo support in DIB:
- Optional, built-in support for Gentoo binhosts -- where you can set a
  DIB_GENTOO_BINHOST=true (or similar) and have the binhost enabled by
  default.
- Make the default configuration of EMERGE_DEFAULT_OPTS more easily
  managed in a DIB-style manner, e.g. setting --quiet vs --verbose based
  on the value of DIB_DEBUG_TRACE.

Signed-Off-By: Jay Faulkner <jay@jvf.cc>
Signed-Off-By: Sam James <sam@gentoo.org>
Co-Authored-By: Sam James <sam@gentoo.org>
Change-Id: Idab82a9fa986fcc56fe4e1e1bf0445c7306b2858
2024-02-05 22:11:46 +00:00
..
2020-07-12 17:50:00 -05:00
2017-04-05 13:11:22 +10:00

Gentoo

Use a Gentoo cloud image as the baseline for built disk images. The images are located in profile specific sub directories:

http://distfiles.gentoo.org/releases/amd64/autobuilds/

As of this writing, only amd64 and arm64 images are available.

Notes:

  • There are very frequently new automated builds that include changes that happen during the product maintenance. The download directories contain an unversioned name and a versioned name. The unversioned name will always point to the latest image, but will frequently change its content. The versioned one will never change content, but will frequently be deleted and replaced by a newer build with a higher version-release number.

  • In order to run the package-installs element you will need to make sure dev-python/pyyaml is installed on the host.

  • In order to run the vm element you will need to make sure sys-block/parted is installed on the host.

  • Other profiles can be used by exporting GENTOO_PROFILE with a valid profile. A list of valid profiles follows:

    default/linux/amd64/17.1 default/linux/amd64/17.1/no-multilib default/linux/amd64/17.1/hardened default/linux/amd64/17.1/no-multilib/hardened default/linux/amd64/17.1/systemd default/linux/arm64/17.0 default/linux/arm64/17.0/systemd

  • You can set the GENTOO_PORTAGE_CLEANUP environment variable to False to disable the clean up of portage repositories (including overlays). This will make the image bigger if caching is also disabled.

  • Gentoo supports many different versions of python, in order to select one you may use the GENTOO_PYTHON_TARGETS environment variable to select the versions of python you want on your image. The format of this variable is a string as follows "python2_7 python3_6".

  • You can enable overlays using the GENTOO_OVERLAYS variable. In it you should put a space separated list of overlays. The overlays must be in the official overlay list and must be git based.

  • GENTOO_EMERGE_ENV is a bash array containing default environment variables for package install, you can override it with another bash array.

  • GENTOO_EMERGE_DEFAULT_OPTS can be set to control the default options passed to emerge for all package actions, this includes operations like depclean and preserved-rebuild.