blob: 7d5af26a50201b3b53d6906deea7510e8fe44ed2 [file] [log] [blame]
#
# Copyright 2023 Google LLC
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# shellcheck disable=SC2034,SC2154
EAPI=7
CROS_WORKON_COMMIT="93a58b97bb99c6955e4cd3c18bfb9528b7dd7f13"
CROS_WORKON_TREE="fef2837a2d9e442abc7415d55b007dd230e05e00"
CROS_WORKON_REPO="https://cos.googlesource.com"
CROS_WORKON_PROJECT="third_party/kernel"
CROS_WORKON_LOCALNAME="kernel/v6.1"
# This must be inherited *after* EGIT/CROS_WORKON variables defined
inherit cros-workon cos-kernel
cos_kernel_config_arch() {
case ${ARCH} in
amd64) echo "x86";;
arm64) echo "arm64";;
*) die "Unknown architecture: ${ARCH}";;
esac
}
STRIP_MASK+=" /usr/src/${P}/build/vmlinux"
STRIP_MASK+=" *.ko"
DESCRIPTION="COS Linux Kernel 6.1"
HOMEPAGE="https://cloud.google.com/container-optimized-os"
KEYWORDS="*"
IUSE="module_sign lockdown gpu +apply_patches tdx +nofragments"
COS_KERNEL_X509_GENKEY="${FILESDIR}/x509.genkey"
# Use in-tree kernel config
CHROMEOS_KERNEL_CONFIG="arch/$(cos_kernel_config_arch)/configs/lakitu_defconfig"
src_configure() {
cos-kernel_src_configure
}
# Change for EAPI=6
src_prepare() {
default
cos-kernel_src_prepare
if use tdx; then
for patch in "${FILESDIR}"/tdx/*.patch; do
if [[ -f "${patch}" ]]; then
eapply "${patch}"
fi
done
fi
}
src_install() {
cos-kernel_src_install
}
# Change the following (commented out) number to the next prime number
# when you change base.config. This workaround will force the
# ChromeOS CQ to uprev sys-kernel/kernel-6_1 ebuild and pick up the
# configuration changes. In absence of this workaround the config changes
# would not be picked up unless there was a code change in kernel source tree.
#
# NOTE: There's nothing magic keeping this number prime but you just need to
# make _any_ change to this file. ...so why not keep it prime?
#
# The coolest prime number is: 13