blob: 84f42a7c6040b7048190a41a9d8795875dcfcef0 [file] [log] [blame]
# Copyright 2023 The ChromiumOS Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: cros-kernel-version.eclass
# A utility eclass for Chromium OS kernel version handling. In particular, it
# provides the names for kernel packages and IUSE flag names.
if [[ -z ${_CROS_KERNEL_VERSION_ECLASS} ]]; then
# Check for EAPI 5+
case "${EAPI:-0}" in
0|1|2|3|4) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}." ;;
5|6|7) ;;
# CHROMEOS_KERNELS maps IUSE flag names to kernel package names.
declare -g -A CHROMEOS_KERNELS=(
# Add blockers so when switching between kernels packages, the old package gets
# unmerged automatically. Add blockers only for kernels in CHROMEOS_KERNELS.
if [[ ${CATEGORY} == "sys-kernel" ]] && has "${PN}" "${CHROMEOS_KERNELS[@]}"; then
$(for v in "${CHROMEOS_KERNELS[@]}"; do [[ ${PN} == "${v}" ]] || echo "!sys-kernel/${v}"; done)