| # Copyright 2020 The Chromium OS Authors. All rights reserved. |
| # Distributed under the terms of the GNU General Public License v2 |
| |
| EAPI=6 |
| |
| CROS_WORKON_MANUAL_UPREV="1" |
| CROS_WORKON_COMMIT="771286dc9ae939138bd04c39e73060c0e6bdd65c" |
| CROS_WORKON_TREE="b74e8447d2a80b323e4f824ceba4dd75a5f90a3b" |
| CROS_WORKON_REPO="https://cos.googlesource.com" |
| CROS_WORKON_PROJECT="third_party/kernel" |
| CROS_WORKON_LOCALNAME="kernel/v5.10" |
| |
| # This must be inherited *after* EGIT/CROS_WORKON variables defined |
| inherit cros-workon cros-kernel2 |
| |
| DESCRIPTION="A dump capture kernel for kdump functionality" |
| HOMEPAGE="https://cloud.google.com/container-optimized-os" |
| KEYWORDS="*" |
| CHROMEOS_KERNEL_CONFIG="${FILESDIR}/${CHROMEOS_KERNEL_CONFIG_FILE}" |
| |
| STRIP_MASK+=" /usr/src/${P}/build/vmlinux" |
| STRIP_MASK+=" *.ko" |
| |
| DEPEND=" |
| !sys-kernel/lakitu-kernel |
| " |
| RDEPEND="${DEPEND}" |
| |
| src_prepare() { |
| default |
| cros-kernel2_src_prepare |
| } |
| |
| # Use stripped-down version of cros-kernel2 configure routine |
| # to avoid dragging in all fragments enabled by USE flags |
| src_configure() { |
| local build_cfg="$(get_build_cfg)" |
| local old_defconfig="$(cros-workon_get_build_dir)/cros-old-defconfig" |
| |
| elog "Using kernel config: ${CHROMEOS_KERNEL_CONFIG}" |
| |
| cp -f "${CHROMEOS_KERNEL_CONFIG}" "${build_cfg}" || die |
| kmake olddefconfig |
| |
| cp -a "${build_cfg}" "${old_defconfig}" || die |
| } |
| |
| src_install() { |
| dodir /boot/kdump |
| kmake INSTALL_PATH="${D}/boot/kdump" INSTALL_MOD_PATH="${D}" \ |
| INSTALL_MOD_STRIP=1 install |
| local version |
| version=$(kmake -s --no-print-directory kernelrelease) |
| ln -sf "vmlinuz-${version}" "${D}/boot/kdump/vmlinuz" || die |
| |
| # We also strips the symbol table /boot/kdump/System.map-* at: |
| # overlay-lakitu/scripts/board_specific_setup.sh |
| } |