testing libre dist-kernel

This commit is contained in:
projectmoon 2021-11-24 14:01:53 +00:00
parent 03c663ad59
commit f6eafe8605
2 changed files with 113 additions and 0 deletions

View File

@ -0,0 +1,7 @@
DIST gentoo-kernel-config-5.10.42.tar.gz 3992 BLAKE2B b04f585ccc823c25baafea011a5df9e4ed79f5537fb0c47726bb54d3f6197627b078a6f8510707a68edd9308f7ede84ca3f9bff78e64e06c9ea3d53db496c10f SHA512 5d42e1ac694441acb8ea13fa3e80615bd18f0932a37f50c3d34c8c2f95ef4dfa6541407ddcad802b4fb13468e0e85d8cd09ac37d3612260f9a81d081cb4b6713
DIST kernel-aarch64-fedora.config.5.10.12 223184 BLAKE2B a0246dac2f7a4ad6a55b611538d24382ac87a8960077811a859c9595ac67f961b4bccb7e139a89abc7c0e26e80832da5c94211fc658082f2e7dde984f14dd29d SHA512 7d803b347b136331db1ad6e22e0445fe0224c3e26cd7c034cbe9794915d457b492e05f77664865079874ec001351553652646e2e08d0fee31e30b841b0008f52
DIST kernel-i686-fedora.config.5.10.12 205412 BLAKE2B 92c715b7e2cd7dd74da7970c05981f520597d3e403ce82c8cf4eee31c9f1f50b638792a6bdb256ef5bfdc99f1bcd594e819e8f44dc6febb2ad9a854bad817f2b SHA512 69d8db11723ae1b40fdedfaace74d15bb63198cdb0485e0a1e5eba95b31217110c93a93e39cc7370cf45f1d3a8bc7f75ec096d6db5ea9ecb28ac6b56702ebb10
DIST kernel-ppc64le-fedora.config.5.10.12 192105 BLAKE2B 889141debb0656a358a3381bae14b5216b982acdfce0bc758f9445c16647807a68a788fb290199c2a1a23627bda1ef4c9405b3f5ac2a4176d1d2b55c71fb7db9 SHA512 3ab0f1401d9f50a61477c71369dede438f575d9d2c3a2f5c2cf36d624c2b59a938efca9c981b075511b3860c983eaaf5e5a9f877d659277f09ceba45edd43770
DIST kernel-x86_64-fedora.config.5.10.12 206357 BLAKE2B 0eda9d4f3f973336cabd67c1ac78f100aabde926354743e8dcb7ff84496f0de49210d45f99bc850a2096078b0b4687aa7fd965d999248559506004f2b29dac0c SHA512 b12f43d3c1a52a4915cd73db98874ce9ae6c425672c0f1c19ed1b1101341c868ebf1c9620bef5449752ec0d7342c1ce38fb77779d0f89b9267096a605ebf7a26
DIST linux-libre-5.10-gnu1.tar.xz 114244540 BLAKE2B 0c096f64c83004c66dd6dac2c8df93fdcf20bf81d39f1cc184733f9c70de0f6d3fb063e3c5116f345c7290741a6512ef4f96e03666bba2392f65117fd583672c SHA512 4bf48611e8a217931c2347f1aa3257da5ba210f263fb35edef43e935fd3fcab5333fc884198fe6ab180cc11ed11dd48b71dff4071b85f18830a6bf9e1c2cf97f
DIST patch-5.10-gnu1-5.10.81-gnu1.xz 2385096 BLAKE2B 4f7ce2d15b900001190ea8f8435c47c81f7b97c653c286f7d49042d34b7dcbabf81373245f83c37eb39448d2a7b2e224a85bbde85e947303c924660c7387c9db SHA512 b7fa9883a61a2426130c0770497c07044224b955a4c5aeb2286a1118b7a162b171dd158e1fdb506cbdec75cff41fc18e032699a72ecc8017c6c51e804be77a23

View File

@ -0,0 +1,106 @@
# Copyright 2020-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit kernel-build toolchain-funcs
MY_P=linux-${PV%.*}
BASE_VER="$(ver_cut 1).$(ver_cut 2)"
GENPATCHES_P=genpatches-${PV%.*}-$(( ${PV##*.} + 7 ))
# https://koji.fedoraproject.org/koji/packageinfo?packageID=8
CONFIG_VER=5.10.12
CONFIG_HASH=836165dd2dff34e4f2c47ca8f9c803002c1e6530
GENTOO_CONFIG_VER=5.10.42
RESTRICT="mirror"
DESCRIPTION="Linux kernel built with Gentoo patches"
HOMEPAGE="https://www.kernel.org/"
SRC_URI+=" https://linux-libre.fsfla.org/pub/linux-libre/releases/${BASE_VER}-gnu1/linux-libre-${BASE_VER}-gnu1.tar.xz
https://linux-libre.fsfla.org/pub/linux-libre/releases/${PV}-gnu1/patch-${BASE_VER}-gnu1-${PV}-gnu1.xz
https://github.com/mgorny/gentoo-kernel-config/archive/v${GENTOO_CONFIG_VER}.tar.gz
-> gentoo-kernel-config-${GENTOO_CONFIG_VER}.tar.gz
amd64? (
https://src.fedoraproject.org/rpms/kernel/raw/${CONFIG_HASH}/f/kernel-x86_64-fedora.config
-> kernel-x86_64-fedora.config.${CONFIG_VER}
)
arm64? (
https://src.fedoraproject.org/rpms/kernel/raw/${CONFIG_HASH}/f/kernel-aarch64-fedora.config
-> kernel-aarch64-fedora.config.${CONFIG_VER}
)
ppc64? (
https://src.fedoraproject.org/rpms/kernel/raw/${CONFIG_HASH}/f/kernel-ppc64le-fedora.config
-> kernel-ppc64le-fedora.config.${CONFIG_VER}
)
x86? (
https://src.fedoraproject.org/rpms/kernel/raw/${CONFIG_HASH}/f/kernel-i686-fedora.config
-> kernel-i686-fedora.config.${CONFIG_VER}
)"
S=${WORKDIR}/${MY_P}
LICENSE="GPL-2"
KEYWORDS="amd64 ~arm arm64 ppc64 x86"
IUSE="debug hardened"
REQUIRED_USE="arm? ( savedconfig )"
RDEPEND="
!sys-kernel/gentoo-kernel-bin:${SLOT}"
BDEPEND="
debug? ( dev-util/pahole )"
PDEPEND="
>=virtual/dist-kernel-${PV}"
QA_FLAGS_IGNORED="usr/src/linux-.*/scripts/gcc-plugins/.*.so"
src_prepare() {
local PATCHES=(
"${WORKDIR}"/patch-${BASE_VER}-gnu1-${PV}-gnu1
)
default
# prepare the default config
case ${ARCH} in
amd64)
cp "${DISTDIR}/kernel-x86_64-fedora.config.${CONFIG_VER}" .config || die
;;
arm)
return
;;
arm64)
cp "${DISTDIR}/kernel-aarch64-fedora.config.${CONFIG_VER}" .config || die
;;
ppc64)
cp "${DISTDIR}/kernel-ppc64le-fedora.config.${CONFIG_VER}" .config || die
;;
x86)
cp "${DISTDIR}/kernel-i686-fedora.config.${CONFIG_VER}" .config || die
;;
*)
die "Unsupported arch ${ARCH}"
;;
esac
local myversion="-libre-dist"
use hardened && myversion+="-hardened"
echo "CONFIG_LOCALVERSION=\"${myversion}\"" > "${T}"/version.config || die
local dist_conf_path="${WORKDIR}/gentoo-kernel-config-${GENTOO_CONFIG_VER}"
local merge_configs=(
"${T}"/version.config
"${dist_conf_path}"/base.config
)
use debug || merge_configs+=(
"${dist_conf_path}"/no-debug.config
)
if use hardened; then
merge_configs+=( "${dist_conf_path}"/hardened-base.config )
tc-is-gcc && merge_configs+=( "${dist_conf_path}"/hardened-gcc-plugins.config )
if [[ -f "${dist_conf_path}/hardened-${ARCH}.config" ]]; then
merge_configs+=( "${dist_conf_path}/hardened-${ARCH}.config" )
fi
fi
kernel-build_merge_configs "${merge_configs[@]}"
}