libre kernel based on vanilla kernel ebuild
This commit is contained in:
parent
0332e59f40
commit
ebbe9c4dd0
|
@ -1,4 +1,5 @@
|
|||
DIST gentoo-kernel-config-5.10.42.tar.gz 3992 BLAKE2B b04f585ccc823c25baafea011a5df9e4ed79f5537fb0c47726bb54d3f6197627b078a6f8510707a68edd9308f7ede84ca3f9bff78e64e06c9ea3d53db496c10f SHA512 5d42e1ac694441acb8ea13fa3e80615bd18f0932a37f50c3d34c8c2f95ef4dfa6541407ddcad802b4fb13468e0e85d8cd09ac37d3612260f9a81d081cb4b6713
|
||||
DIST gentoo-kernel-config-5.15.5.tar.gz 4128 BLAKE2B e30fff372b0112cc05723463cb4e93de79b5b643483796402eb88a7e704706a4033af2dbab9424cf14b1d894b57fc053b969f5fbfa15cf74e30e3d045703918f SHA512 5e8c6945da5e9cfb8d20663910fc38ee36813067e1679e17bbf1dfc6fc0aa9125f1fc949d81937b297215925004e0ebfb3b55c7e707184b5ffcf23d28882113d
|
||||
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
|
||||
|
|
|
@ -0,0 +1,119 @@
|
|||
# Copyright 2020-2021 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
inherit kernel-build toolchain-funcs verify-sig
|
||||
|
||||
BASE_VER="$(ver_cut 1).$(ver_cut 2)"
|
||||
RESTRICT="mirror"
|
||||
# https://koji.fedoraproject.org/koji/packageinfo?packageID=8
|
||||
CONFIG_VER=5.10.12
|
||||
CONFIG_HASH=836165dd2dff34e4f2c47ca8f9c803002c1e6530
|
||||
GENTOO_CONFIG_VER=5.15.5
|
||||
|
||||
DESCRIPTION="Linux kernel built from vanilla upstream sources"
|
||||
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://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}
|
||||
)"
|
||||
|
||||
# Set workdir to full package version, as linux-libre has only the base
|
||||
# version (eg. 5.10 for 5.10.88) as the source folder.
|
||||
MY_P=linux-${PV%.*}
|
||||
S=${WORKDIR}/${MY_P}
|
||||
|
||||
LICENSE="GPL-2"
|
||||
KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86"
|
||||
IUSE="debug hardened"
|
||||
REQUIRED_USE="arm? ( savedconfig )"
|
||||
|
||||
BDEPEND="
|
||||
debug? ( dev-util/pahole )"
|
||||
PDEPEND="
|
||||
>=virtual/dist-kernel-${PV}"
|
||||
|
||||
src_unpack() {
|
||||
default
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
|
||||
local biendian=false
|
||||
|
||||
# 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
|
||||
biendian=true
|
||||
;;
|
||||
ppc)
|
||||
# assume powermac/powerbook defconfig
|
||||
# we still package.use.force savedconfig
|
||||
cp "${WORKDIR}"/linux-*/arch/powerpc/configs/pmac32_defconfig .config || die
|
||||
;;
|
||||
ppc64)
|
||||
cp "${DISTDIR}/kernel-ppc64le-fedora.config.${CONFIG_VER}" .config || die
|
||||
biendian=true
|
||||
;;
|
||||
x86)
|
||||
cp "${DISTDIR}/kernel-i686-fedora.config.${CONFIG_VER}" .config || die
|
||||
;;
|
||||
*)
|
||||
die "Unsupported arch ${ARCH}"
|
||||
;;
|
||||
esac
|
||||
|
||||
local myversion="-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
|
||||
|
||||
# this covers ppc64 and aarch64_be only for now
|
||||
if [[ ${biendian} == true && $(tc-endian) == big ]]; then
|
||||
merge_configs+=( "${dist_conf_path}/big-endian.config" )
|
||||
fi
|
||||
|
||||
kernel-build_merge_configs "${merge_configs[@]}"
|
||||
}
|
Loading…
Reference in New Issue