base_role/tasks/Gentoo.yml
2024-01-09 15:39:19 +00:00

360 lines
14 KiB
YAML
Executable File

# -*- mode: yaml; indent-tabs-mode: nil; tab-width: 2; coding: utf-8-unix -*-
---
- name: "DEBUG: base Gentoo.yml base_also_users"
debug:
verbosity: 1
msg: "DEBUG: Including base Gentoo.yml base_also_users={{base_also_users}}"
# mesa needs python on the PATH -- the right one early
- name: "/usr/lib/portage/python{{BASE_PORTAGE_PYTHON_MINOR}}/ebuild-helpers/python"
file:
# Its on the PATH in portage/.../.../temp/environment ahead of
# ...{{USR_LOCAL}}/sbin:{{USR_LOCAL}}/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:...
src: "/usr/bin/python{{BASE_PORTAGE_PYTHON_MINOR}}"
dest: "/usr/lib/portage/python{{BASE_PORTAGE_PYTHON_MINOR}}/ebuild-helpers/python"
state: link
force: yes
- block: # unsafe
- name: "/etc/portage/make.conf base Gentoo GPSD_PROTOCOLS"
blockinfile:
dest: /etc/portage/make.conf
owner: "portage"
group: "portage"
mode: "0644"
create: false
marker: "# {mark} ANSIBLE MANAGED BLOCK base Gentoo.yml [GPSD_PROTOCOLS]"
block: |
GPSD_PROTOCOLS="nmea0183 nmea2000 aivdm"
- name: "/etc/portage/make.conf base Gentoo PORTAGE_PYTHON"
blockinfile:
dest: /etc/portage/make.conf
owner: "portage"
group: "portage"
mode: "0644"
create: false
marker: "# {mark} ANSIBLE MANAGED BLOCK base Gentoo.yml [PORTAGE_PYTHON]"
block: |
PORTAGE_PYTHON=/usr/bin/python{{BASE_PORTAGE_PYTHON_MINOR}}
PORTAGE_PYTHONPATH=/usr/{{BASE_LIB}}/python{{BASE_PORTAGE_PYTHON_MINOR}}
# FixMe: whats this
PORTAGE_PYM_PATH=/usr/{{BASE_LIB}}/python{{BASE_PORTAGE_PYTHON_MINOR}}
#EPYTHON=?
- name: "/etc/portage/make.conf Gentoo2 FEATURES-backup"
blockinfile:
dest: /etc/portage/make.conf
create: false
marker: "# {mark} ANSIBLE MANAGED BLOCK base Gentoo2.yml [FEATURES-backup]"
block: |
FEATURES="${FEATURES} unmerge-backup downgrade-backup binpkg-multi-instance"
- name: "/etc/portage/make.conf Gentoo2 FEATURES"
blockinfile:
dest: /etc/portage/make.conf
create: false
marker: "# {mark} ANSIBLE MANAGED BLOCK base Gentoo2.yml [FEATURES]"
block: |
# https://bugs.gentoo.org/show_bug.cgi?id=605348
# buildpkg
FEATURES="${FEATURES} -collision-detect protect-owned -userfetch"
# https://forums.gentoo.org/viewtopic-p-7863632.html
FEATURES="${FEATURES} -usersandbox -userpriv userfetch fixlafiles news parallel-fetch sfperms unmerge-orphans unknown-features-warn usersync multilib-strict preserve-libs compress-build-logs parallel-install -ebuild-locks"
# If configure failed with a 'cannot run C compiled programs' error, try this:
# FEATURES='-sandbox -usersandbox' emerge sandbox
FEATURES="-sandbox -usersandbox ${FEATURES}"
# https://forums.gentoo.org/viewtopic-p-7863632.html
FEATURES="${FEATURES} -userpriv userfetch fixlafiles news parallel-fetch"
FEATURES="${FEATURES} sfperms unmerge-orphans unknown-features-warn usersync"
FEATURES="${FEATURES} multilib-strict preserve-libs"
FEATURES="${FEATURES} compress-build-logs parallel-install -ebuild-locks"
- name: "/etc/portage/make.conf base Gentoo2.yml CHOST"
blockinfile:
dest: /etc/portage/make.conf
create: false
marker: "# {mark} ANSIBLE MANAGED BLOCK base Gentoo.yml [CHOST]"
block: |
CHOST="x86_64-pc-linux-gnu"
- name: "/etc/portage/make.conf base Gentoo2.yml LLVM_TARGETS"
blockinfile:
dest: /etc/portage/make.conf
create: false
marker: "# {mark} ANSIBLE MANAGED BLOCK base Gentoo2.yml [LLVM_TARGETS]"
block: |
LLVM_TARGETS="X86"
- name: "/etc/portage/make.conf base Gentoo2.yml USE"
blockinfile:
dest: /etc/portage/make.conf
create: false
marker: "# {mark} ANSIBLE MANAGED BLOCK base Gentoo2.yml [USE]"
block: |
# 2020-02 - abi_x86_32 is in pentoo profile
# 2021-03 -abi_x86_32 may be causing havoc
# 2021-04 - gps jack lua subversion
USE="${USE} adns caps lm-sensors networkmanager oss pulseaudio vdpau vaapi xattr"
USE="${USE} -multilib -openmp"
USE="${USE} python" # ruby perl lzma
# https://wiki.gentoo.org/wiki/PulseAudio add "elogind -systemd -consolekit" globally
USE="${USE} X elogind -consolekit -systemd fbcon"
USE="${USE} xinerama x265"
USE="${USE} fbcon"
# 2019-12 python uses sqlite - but we will not do it globally
USE="${USE} curl"
USE="${USE} -nls"
# is this causing problems on the dbus with polkit?
USE="${USE} -gnome-keyring"
USE="${USE} -gnome-online-accounts"
# my changes dunno about -pentoo-full
USE="${USE} -pentoo-full -wireless" # -bluetooth
# -native-headset is from pulseaudio - requires bluetooth
# - - native-headset : Build with native HSP backend for bluez 5.
# - - ofono-headset : Build with oFono HFP backend for bluez 5,
USE="${USE} alsa -native-headset" #? bluetooth
USE="${USE} -vulkan -wayland"
USE="${USE} socks5"
USE="${USE} dbus -thunar -gnome -kde" # qt3support
USE="${USE} cups spell gpm userlocales"
USE="${USE} xvid mp3 flac vorbis ogg theora x264" # xinerama x265
USE="${USE} -ldap -icu"
# virtualbox
USE="${USE} svg jpeg png xpm scanner"
# 2020-02 from Pentoo
USE="${USE} lm-sensors"
# 2020-02 against Pentoo
USE="${USE} -gles2 -gles1"
- name: "/etc/portage/make.conf base Gentoo2.yml USE_EXPAND"
blockinfile:
dest: /etc/portage/make.conf
create: false
marker: "# {mark} ANSIBLE MANAGED BLOCK base Gentoo2.yml [USE_EXPAND]"
block: |
# Env vars to expand into USE vars
USE_EXPAND="${USE_EXPAND} COMPAT_DRIVERS_WIFI COMPAT_DRIVERS_ETHERNET COMPAT_DRIVERS_VARIOUS UNICORN_TARGETS"
- name: "/etc/portage/make.conf base Gentoo2.yml LDFLAGS"
blockinfile:
dest: /etc/portage/make.conf
create: false
marker: "# {mark} ANSIBLE MANAGED BLOCK base Gentoo2.yml [LDFLAGS]"
block: |
# This will help developers track packages, that don't respect
# LDFLAGS, down more effectively
LDFLAGS="${LDFLAGS} -Wl,--defsym=__gentoo_check_ldflags__=0"
- name: "/etc/portage/make.conf base Gentoo2.yml COMPRESS"
blockinfile:
dest: /etc/portage/make.conf
create: false
marker: "# {mark} ANSIBLE MANAGED BLOCK base Gentoo2.yml [COMPRESS]"
block: |
#PORTAGE_BZIP2_COMMAND="bzip2"
#PORTAGE_BUNZIP2_COMMAND="bunzip2"
# with bzip2 quickpkg --umask=0022 --include-config=y =sci-libs/metis-5.1.0-r4
# * Building package for sci-libs/metis-5.1.0-r4 ...lbzip2: unknown option "-T",
# works without anything it works (default zstd)
#! BINPKG_COMPRESS="bzip2"
# BINPKG_COMPRESS_FLAGS="-3"
- name: "/etc/portage/make.conf base Gentoo2.yml USE"
blockinfile:
dest: /etc/portage/make.conf
create: false
marker: "# {mark} ANSIBLE MANAGED BLOCK base Gentoo2.yml [USE]"
block: |
# was USE="${USE} X abi_x86_32 adns caps -consolekit curl elogind fbcon gps jack lm_sensors lua lzma networkmanager oss pentoo-full perl pulseaudio python ruby samba sqlite subversion vdpau vaapi xattr xinerama x265"
# 2020-02 - abi_x86_32 is in pentoo profile
# 2021-03 -abi_x86_32 may be causing havoc
# 2021-04 - gps jack lua subversion
USE="${USE} adns caps lm-sensors oss pulseaudio vdpau vaapi xattr" #? networkmanager
# https://wiki.gentoo.org/wiki/PulseAudio add "elogind -systemd -consolekit" globally
USE="${USE} X elogind -consolekit -systemd fbcon"
USE="${USE} xinerama x265"
USE="${USE} curl sqlite"
USE="${USE} -nls"
# is this causing problems on the dbus with polkit?
USE="${USE} -gnome-keyring"
# my changes dunno about -pentoo-full
USE="${USE} -pentoo-full -wireless" # -bluetooth
# my additions
USE="${USE} alsa -native-headset" #? bluetooth
USE="${USE} -vulkan -wayland"
#USE="${USE} socks5"
- name: "/etc/portage/make.conf base Gentoo2.yml PENTOO_BINPKG_RESTRICTED"
blockinfile:
dest: /etc/portage/make.conf
create: false
marker: "# {mark} ANSIBLE MANAGED BLOCK base Gentoo2.yml [PENTOO_BINPKG_RESTRICTED]"
block: |
#for major use of binpkgs, we need to "fix" a few of gentoo's flaws:
#a package built against kernel A will attempt to be used even when remerging on kernel B (often to hilarious consequences)
#so we will define a long list of such packages and exclude them from being built and used (catch it on both ends to avoid issues)
PENTOO_BINPKG_RESTRICTED="sys-kernel/compat-drivers sys-kernel/ax88179_178a x11-drivers/ati-drivers x11-drivers/nvidia-drivers sys-fs/zfs-kmod sys-kernel/spl \
sys-power/bbswitch pentoo/pentoo-installer x11-drivers/xf86-video-virtualbox app-emulation/virtualbox-guest-additions \
app-emulation/virtualbox-modules app-emulation/vmware-modules app-emulation/open-vm-tools sys-kernel/genkernel dev-python/certifi \
sys-kernel/pentoo-sources dev-python/twisted-web net-analyzer/metasploit sci-libs/lapack-reference x11-base/xorg-drivers app-admin/genmenu \
net-wireless/rtl8812au_aircrack-ng pentoo/pentoo pentoo/pentoo-system media-libs/libepoxy net-wireless/gr-ieee802154 virtual/ssh virtual/service-manager \
x11-libs/libva"
EMERGE_DEFAULT_OPTS="${EMERGE_DEFAULT_OPTS} --ask-enter-invalid --keep-going=y --binpkg-respect-use=y --tree --verbose --with-bdeps=y --autounmask=n"
EMERGE_DEFAULT_OPTS="${EMERGE_DEFAULT_OPTS} --buildpkg-exclude \"${PENTOO_BINPKG_RESTRICTED}\" --usepkg-exclude \"${PENTOO_BINPKG_RESTRICTED}\""
EMERGE_DEFAULT_OPTS="${EMERGE_DEFAULT_OPTS} --binpkg-changed-deps=y --ignore-soname-deps=n"
XFCE_PLUGINS="${XFCE_PLUGINS} brightness menu logout trash"
# Log eqawarn messages
PORTAGE_ELOG_CLASSES="${PORTAGE_ELOG_CLASSES} qa"
PORTAGE_NICENESS="9"
PORTAGE_IO_NICENESS="ionice -c 3 -p \${PID}"
# Env vars to expand into USE vars
USE_EXPAND="${USE_EXPAND} COMPAT_DRIVERS_WIFI COMPAT_DRIVERS_ETHERNET COMPAT_DRIVERS_VARIOUS UNICORN_TARGETS"
#mgorny suggested this speeds up sync, in my testing it makes a rather large difference
PORTAGE_RSYNC_EXTRA_OPTS="--omit-dir-times -4"
INSTALL_MASK="/usr/lib/debug"
# this breaks things .git .
#PORTDIR="/var/db/repos"
PORTDIR="/usr/portage"
DISTDIR="/usr/portage/distfiles"
ACCEPT_LICENSE="* -@EULA intel-ucode-20180807 FraunhoferFDK"
when: false
- name: "/etc/portage/make.conf base Gentoo2.yml CURL_SSL"
blockinfile:
dest: /etc/portage/make.conf
create: false
marker: "# {mark} ANSIBLE MANAGED BLOCK base Gentoo2.yml CURL_SSL"
block: |
#? which is right nss or openssl - one only
# -openssl -axtls -gnutls -libressl -mbedtls -*
CURL_SSL="{{BASE_CURL_SSL}}"
- name: "/etc/portage/make.conf base Gentoo2.yml PKG_CONFIG_PATH"
blockinfile:
dest: /etc/portage/make.conf
create: false
marker: "# {mark} ANSIBLE MANAGED BLOCK base Gentoo.yml [PKG_CONFIG_PATH]"
block: |
PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/lib64/pkgconfig:/usr/share/pkgconfig:{{USR_LOCAL}}/lib/pkgconfig/"
- assert:
that:
- "'{{ BOX_OS_FLAVOR }}' != 'Funtoo'"
- name: "include base by-flavour tasks"
include_tasks: "roles/base/tasks/{{item}}.yml"
with_items:
- "{{ ansible_distribution }}/{{ BOX_OS_FLAVOR }}/main"
# now done as a symlink to portage.yml
# - "{{ ansible_distribution }}/{{ BOX_SERVICE_MGR }}"
- name: "/etc/portage/repos.conf/default.conf" # early
blockinfile:
dest: /etc/portage/repos.conf/default.conf
create: yes
marker: "# {mark} ANSIBLE MANAGED BLOCK base"
owner: "portage"
group: "portage"
mode: "0644"
block: |
[DEFAULT]
# /usr/share/portage/config/repos.conf
main-repo = gentoo
sync-allow-hardlinks = yes
# https://bugs.gentoo.org/552814
sync-depth = 1
- block:
- name: chown portage.portage /var/tmp/portage
shell: |
cd /root
[ -d bin ] || mkdir bin
[ -d /var/tmp/portage ] || mkdir /var/tmp/portage
chown portage.portage /var/tmp/portage
[ -d {{BASE_SCRIPT_DIR}} ] || mkdir {{BASE_SCRIPT_DIR}}
# FixMe: should be all of /usr/local/src
#
- name: "/etc/portage/profile/package.provided"
blockinfile:
dest: /etc/portage/profile/package.provided
create: yes
owner: "portage"
group: "portage"
mode: "0644"
marker: "# {mark} ANSIBLE MANAGED BLOCK base Gentoo"
block: |
# /etc/portage/profile/package.provided
# file can contain a list of packages (one per line) that Portage should assume have been provided.
{% for elt in base_pkgs_provided %}
{{ elt }}
{% endfor %}
# {{ base_pkgs_provided|join('\n') }}
# put this in make.conf?
- set_fact:
portage_proxy_env: "{{ proxy_env }}"
- name: "/etc/portage/make.conf base Gentoo.yml"
blockinfile:
dest: /etc/portage/make.conf
create: false
owner: "portage"
group: "portage"
mode: "0644"
marker: "# {mark} Ansible Managed Block base Gentoo.yml GRUB_PLATFORMS"
block: |
# added 2019-07
# -coreboot -qemu require fonts
# -ieee1275 -loongson -qemu-mips -uboot -xen -xen-32 -xen-pvh -themesf- coreboot -qemu
GRUB_PLATFORMS="efi-32 efi-64 emu multiboot pc"
- name: "/etc/portage/make.conf base Gentoo ACCEPT_LICENSE"
blockinfile:
dest: /etc/portage/make.conf
owner: "portage"
group: "portage"
mode: "0644"
create: false
marker: "# {mark} ANSIBLE MANAGED BLOCK base Gentoo.yml [ACCEPT_LICENSE]"
block: |
ACCEPT_LICENSE="* -@EULA"
- name: "/etc/portage/make.conf base Gentoo VERIFY_SIG_OPENPGP_KEY_REFRESH"
blockinfile:
dest: /etc/portage/make.conf
owner: "portage"
group: "portage"
mode: "0644"
create: false
marker: "# {mark} ANSIBLE MANAGED BLOCK base Gentoo.yml VERIFY_SIG_OPENPGP_KEY_REFRESH"
block: |
# not yes
VERIFY_SIG_OPENPGP_KEY_REFRESH=no