Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright 2025 The Flatcar Maintainers
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit coreos-kernel systemd

DESCRIPTION="HyperV guest support daemons"
KEYWORDS="amd64 arm64"

src_configure() {
:
}

src_compile() {
emake \
-C "${KV_DIR}/tools/hv" \
ARCH="${CHOST%%-*}" \
CROSS_COMPILE="${CHOST}-" \
OUTPUT="${S}/" \
V=1
}

src_install() {
local HV_DAEMON
for HV_DAEMON in hv_{kvp,vss}_daemon $(usex !arm64 hv_fcopy_uio_daemon ""); do
dobin "${HV_DAEMON}"
systemd_dounit "${FILESDIR}/${HV_DAEMON}.service"
systemd_enable_service "multi-user.target" "${HV_DAEMON}.service"
done
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,6 @@
# Revision of the source ebuild, e.g. -r1. default is ""
: ${COREOS_SOURCE_REVISION:=}

COREOS_SOURCE_VERSION="${PV}${COREOS_SOURCE_REVISION}"

# $COREOS_KERNEL_SOURCE_NAME is the kernel source name to be used for
# $KERNEL_DIR, e.g. linux-4.19.0-coreos. This comes from upstream, so
# Flatcar should not change it.
#
# On the other hand, $COREOS_SOURCE_NAME is the kernel name to be used for
# $KV_OUT_DIR in individual coreos-kernel*.ebuild files. That one needs to
# have a flatcar-specific name. We cannot define another variable like
# $FLATCAR_SOURCE_NAME, because it will then be rewritten by upstream changes
# that set $COREOS_SOURCE_NAME by default. In the Gentoo world, the ebuild
# for each new version has a totally new file name. So it's hard to replace
# a new $COREOS_SOURCE_NAME variable for every new ebuild.
# $COREOS_SOURCE_NAME should be a name without a revision suffix (e.g. "-r1"),
# because $KV_FULL would not include such a suffix.
COREOS_KERNEL_SOURCE_NAME="linux-${PV/_rc/-rc}-coreos${COREOS_SOURCE_REVISION}"
COREOS_SOURCE_NAME="linux-${PV/_rc/-rc}-flatcar"

[[ ${EAPI} != [78] ]] && die "Only EAPI 7 and 8 are supported"

inherit linux-info toolchain-funcs
Expand All @@ -36,18 +18,16 @@ SRC_URI=""
IUSE=""

BDEPEND="dev-util/pahole"
DEPEND="=sys-kernel/coreos-sources-${COREOS_SOURCE_VERSION}"
DEPEND="=sys-kernel/coreos-sources-${PV}${COREOS_SOURCE_REVISION}"

# Do not analyze or strip installed files
RESTRICT="binchecks strip"

# The build tools are OK and shouldn't trip up multilib-strict.
QA_MULTILIB_PATHS="usr/lib/modules/.*/build/scripts/kconfig/.*"

# Use source installed by coreos-sources
# KERNEL_DIR must find the kernel source tree under /usr/src/linux-*-coreos,
# not /usr/src/linux-*-flatcar, which does not exist at all.
KERNEL_DIR="${SYSROOT}/usr/src/${COREOS_KERNEL_SOURCE_NAME}"
# Force linux-info to detect version-matched source installed by coreos-sources
KERNEL_DIR="${ESYSROOT}/usr/src/linux-${PV/_rc/-rc}-coreos${COREOS_SOURCE_REVISION}"

# Search for an apropriate config in ${FILESDIR}. The config should reflect
# the kernel version but partial matching is allowed if the config is
Expand Down Expand Up @@ -117,7 +97,7 @@ kmake() {
if gcc-specs-pie; then
kernel_cflags="-nopie -fstack-check=no ${kernel_cflags}"
fi
emake "--directory=${KERNEL_DIR}" \
emake "--directory=${KV_DIR}" \
ARCH="${kernel_arch}" \
CROSS_COMPILE="${CHOST}-" \
KBUILD_OUTPUT="${S}/build" \
Expand Down Expand Up @@ -219,17 +199,17 @@ setup_keys() {
coreos-kernel_pkg_pretend() {
[[ "${MERGE_TYPE}" == binary ]] && return

if [[ -f "${KERNEL_DIR}/.config" || -d "${KERNEL_DIR}/include/config" ]]
if [[ -f "${KV_DIR}/.config" || -d "${KV_DIR}/include/config" ]]
then
die "Source is not clean! Run make mrproper in ${KERNEL_DIR}"
die "Source is not clean! Run make mrproper in ${KV_DIR}"
fi
}

coreos-kernel_pkg_setup() {
[[ "${MERGE_TYPE}" == binary ]] && return

# tc-arch-kernel requires a call to get_version from linux-info.eclass
get_version || die "Failed to detect kernel version in ${KERNEL_DIR}"
get_version || die "Failed to detect kernel version in ${KV_DIR}"
}

coreos-kernel_src_unpack() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,10 @@ DEPEND="
"

src_prepare() {
# Fail early if we didn't detect the build installed by coreos-modules
[[ -n "${KV_OUT_DIR}" ]] || die "Failed to detect modules build tree"

default

# KV_OUT_DIR points to the minimal build tree installed by coreos-modules
# Pull in the config and public module signing key
KV_OUT_DIR="${ESYSROOT}/lib/modules/${COREOS_SOURCE_NAME#linux-}/build"
cp -v "${KV_OUT_DIR}/.config" build/ || die
validate_sig_key

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ src_install() {
# Replace the broken /lib/modules/${KV_FULL}/build symlink with a copy of
# the files needed to build out-of-tree modules.
rm "${ED}/usr/${build}" || die
kmake run-command KBUILD_RUN_COMMAND="${KERNEL_DIR}/scripts/package/install-extmod-build ${ED}/usr/${build}"
kmake run-command KBUILD_RUN_COMMAND="${KV_DIR}/scripts/package/install-extmod-build ${ED}/usr/${build}"

# Install the original config because the above doesn't.
insinto "/usr/${build}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@ ETYPE="sources"
K_BASE_VER="5.15"

inherit kernel-2
EXTRAVERSION="-flatcar"
detect_version

# Replace the -coreos suffix with -flatcar. Don't simply reset the whole
# variable because it may have additional numbers before the suffix. This
# doesn't affect the sources directory, which is still suffixed with -coreos,
# but it does affect the Makefile that is used in the build.
EXTRAVERSION="${EXTRAVERSION/-coreos/-flatcar}"

DESCRIPTION="Full sources for the CoreOS Linux kernel"
HOMEPAGE="http://www.kernel.org"
if [[ "${PV%%_rc*}" != "${PV}" ]]; then
Expand All @@ -35,13 +40,12 @@ IUSE=""
# patchlevel revision. We mustn't apply our patches first, it fails when the
# local patches overlap with the upstream patch.
UNIPATCH_LIST="
${PATCH_DIR}/z0001-kbuild-derive-relative-path-for-srctree-from-CURDIR.patch \
${PATCH_DIR}/z0002-pahole-support-reproducible-builds.patch \
${PATCH_DIR}/z0003-Revert-x86-boot-Remove-the-bugger-off-message.patch \
${PATCH_DIR}/z0004-efi-add-an-efi_secure_boot-flag-to-indicate-secure-b.patch \
${PATCH_DIR}/z0005-efi-lock-down-the-kernel-if-booted-in-secure-boot-mo.patch \
${PATCH_DIR}/z0006-mtd-disable-slram-and-phram-when-locked-down.patch \
${PATCH_DIR}/z0007-arm64-add-kernel-config-option-to-lock-down-when.patch \
${PATCH_DIR}/z0008-tools-hv-fix-cross-compilation-for-ARM64.patch \
${PATCH_DIR}/z0009-block-add-partition-uuid-into-uevent.patch \
${PATCH_DIR}/z0001-kbuild-derive-relative-path-for-srctree-from-CURDIR.patch
${PATCH_DIR}/z0002-pahole-support-reproducible-builds.patch
${PATCH_DIR}/z0003-Revert-x86-boot-Remove-the-bugger-off-message.patch
${PATCH_DIR}/z0004-efi-add-an-efi_secure_boot-flag-to-indicate-secure-b.patch
${PATCH_DIR}/z0005-efi-lock-down-the-kernel-if-booted-in-secure-boot-mo.patch
${PATCH_DIR}/z0006-mtd-disable-slram-and-phram-when-locked-down.patch
${PATCH_DIR}/z0007-arm64-add-kernel-config-option-to-lock-down-when.patch
${PATCH_DIR}/z0009-block-add-partition-uuid-into-uevent.patch
"

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2688,7 +2688,7 @@ mv "${srcdir}"/[0-9]*.patch .
for f in [0-9]*.patch; do
mv "$f" "z$f"
done
ls z[0-9]*.patch | sed -e 's/^/\t${PATCH_DIR}\//g' -e 's/$/ \\/g' >> \
ls z[0-9]*.patch | sed -e 's/^/\t${PATCH_DIR}\//g' >> \
"../../${new_ebuild}"
popd >/dev/null

Expand Down