diff --git a/sys-kernel/xanmod-rt-kernel/Manifest b/sys-kernel/xanmod-rt-kernel/Manifest new file mode 100644 index 0000000..1a66121 --- /dev/null +++ b/sys-kernel/xanmod-rt-kernel/Manifest @@ -0,0 +1,5 @@ +DIST genpatches-6.1-44.base.tar.xz 2683644 BLAKE2B d0264b6d6456fb2e6a67c1240cd3fbb95eef61701bf953df6e25e37a12fb12702b57f66e30ac757f28d9d1bcd0f2fbc38775d5b73922504084ff95f9fda1d78f SHA512 e3777a612facad029782fe63abc702af06197521fcf90f4c80311fd7ad94739209573c7de910dfaeafd88948c2c3f3d29bb27f4fa1069475295b6f5b29e14116 +DIST genpatches-6.1-44.extras.tar.xz 3812 BLAKE2B bd5605700d0b55036d186eca82031f1d38883fbb3e2e98f0b44269c914f5a2912c026bebfdfd3fdcd563b97d3167fb9908bd0e29422b02e9314392b3ad2281c5 SHA512 e274c0e50fc476bc071fc4d77623b75cdfdda51951f541f56bc4f8ab53da17e67f615c37d35c93290d20b51d3ab2eb923a8e147daec4c59d3d1c87d3e803beb0 +DIST gentoo-kernel-config-g7.tar.gz 4625 BLAKE2B 72ba0d038ee34ca5eb26d43bd373735aef3a50d02b414993ea05485e49d83d46df98a6cb0f6f3170a8ec0c99b557432fd9a11cbb92ff7c2837625a7f4469831e SHA512 2d74a8ca9f5402b4290ed93cd3ddba04a7f2ff42c8d8d3f2cbbe22fc20daa0fca119368daa8af39b7a26b1b99e4e3187c3c5d95886a651675ad94ff98d686628 +DIST linux-6.1.tar.xz 134728520 BLAKE2B ae60257860b2bd1bd708d183f0443afc60ebbd2b3d535c45e44c2e541bd0928530a3b62de6385dd4e4726ebbedcc0a871d4f3ffb4105b9f1f6d8ed7467f5688e SHA512 6ed2a73c2699d0810e54753715635736fc370288ad5ce95c594f2379959b0e418665cd71bc512a0273fe226fe90074d8b10d14c209080a6466498417a4fdda68 +DIST patch-6.1.38-rt12-xanmod1.xz 2139372 BLAKE2B 6c9cfc207fc6cb478ee5aa0b958fa697a5fd0028cf3ee690c05bb9a923723d478022c25591534f4f03f6c26584b98226f7ebdcee48c5bda7ddf7cce285800b1d SHA512 1d93313e8d38e5201de201ec84bd39de5c8184bb807d7edacda2fa92e72c0b65d672b3614d1d1cf0b1577cb7d8c777814396590d01640365c39894895b779c16 diff --git a/sys-kernel/xanmod-rt-kernel/metadata.xml b/sys-kernel/xanmod-rt-kernel/metadata.xml new file mode 100644 index 0000000..1c41bba --- /dev/null +++ b/sys-kernel/xanmod-rt-kernel/metadata.xml @@ -0,0 +1,12 @@ + + + + + Build initramfs along with the kernel. + + + xanmod/linux + xanmod/linux + xanmod + + diff --git a/sys-kernel/xanmod-rt-kernel/xanmod-rt-kernel-6.1.38_p12.ebuild b/sys-kernel/xanmod-rt-kernel/xanmod-rt-kernel-6.1.38_p12.ebuild new file mode 100644 index 0000000..15ec228 --- /dev/null +++ b/sys-kernel/xanmod-rt-kernel/xanmod-rt-kernel-6.1.38_p12.ebuild @@ -0,0 +1,104 @@ +# Copyright 2022-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit kernel-build + +MY_P=linux-${PV%.*} +MY_PV="${PV%_p*}" + +GENPATCHES_P=genpatches-${MY_PV%.*}-$(( ${MY_PV##*.} + 6 )) +GENTOO_CONFIG_VER=g7 + +RT_PATCHSET="${PV/*_p}" + +DESCRIPTION="Linux kernel built with XanMod and Gentoo patches" +HOMEPAGE="https://www.kernel.org/ https://xanmod.org/" +SRC_URI=" + https://cdn.kernel.org/pub/linux/kernel/v$(ver_cut 1).x/${MY_P}.tar.xz + mirror://sourceforge/xanmod/patch-${MY_PV}-rt${RT_PATCHSET}-xanmod1.xz + https://dev.gentoo.org/~mpagano/dist/genpatches/${GENPATCHES_P}.base.tar.xz + https://dev.gentoo.org/~mpagano/dist/genpatches/${GENPATCHES_P}.extras.tar.xz + https://github.com/mgorny/gentoo-kernel-config/archive/${GENTOO_CONFIG_VER}.tar.gz + -> gentoo-kernel-config-${GENTOO_CONFIG_VER}.tar.gz +" +S=${WORKDIR}/${MY_P} + +LICENSE="GPL-2" +KEYWORDS="-* ~amd64" +IUSE="debug" + +RDEPEND=" + !sys-kernel/xanmod-kernel-bin:${SLOT} +" +BDEPEND=" + debug? ( dev-util/pahole ) +" +PDEPEND=" + >=virtual/dist-kernel-${MY_PV} +" + +QA_FLAGS_IGNORED=" + usr/src/linux-.*/scripts/gcc-plugins/.*.so + usr/src/linux-.*/vmlinux +" + +src_prepare() { + # Remove linux-stable patches (see 0000_README) + find "${WORKDIR}" -maxdepth 1 -name "1[0-4][0-9][0-9]*.patch" -exec rm {} + || die + + local PATCHES=( + # meh, genpatches have no directory + "${WORKDIR}"/patch-${MY_PV}-rt${RT_PATCHSET}-xanmod1 + "${WORKDIR}"/*.patch + ) + default + + # prepare the default config + case ${ARCH} in + amd64) + cp "${S}/CONFIGS/xanmod/gcc/config_x86-64-v1" .config || die + ;; + *) + die "Unsupported arch ${ARCH}" + ;; + esac + + rm "${S}"/localversion* || die + local myversion="-rt${RT_PATCHSET}-xanmod1-dist" + 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 + ) + + kernel-build_merge_configs "${merge_configs[@]}" +} + +# lazy workaround +kernel-install_pkg_preinst() { + debug-print-function ${FUNCNAME} "${@}" + + local dir_ver=${PV}${KV_LOCALVERSION} + local kernel_dir=${ED}/usr/src/linux-${dir_ver} + local relfile=${kernel_dir}/include/config/kernel.release + [[ ! -d ${kernel_dir} ]] && + die "Kernel directory ${kernel_dir} not installed!" + [[ ! -f ${relfile} ]] && + die "Release file ${relfile} not installed!" + local release + release="$(<"${relfile}")" || die + + if [[ -L ${EROOT}/lib && ${EROOT}/lib -ef ${EROOT}/usr/lib ]]; then + # Adjust symlinks for merged-usr. + rm "${ED}/lib/modules/${release}"/{build,source} || die + dosym "../../../src/linux-${dir_ver}" "/usr/lib/modules/${release}/build" + dosym "../../../src/linux-${dir_ver}" "/usr/lib/modules/${release}/source" + fi +} diff --git a/virtual/dist-kernel/dist-kernel-6.1.38.ebuild b/virtual/dist-kernel/dist-kernel-6.1.38.ebuild index ad0ed82..b9a20a4 100644 --- a/virtual/dist-kernel/dist-kernel-6.1.38.ebuild +++ b/virtual/dist-kernel/dist-kernel-6.1.38.ebuild @@ -18,4 +18,5 @@ RDEPEND=" ~sys-kernel/vanilla-kernel-${PV} ~sys-kernel/xanmod-kernel-${PV} ~sys-kernel/xanmod-kernel-bin-${PV} + ~sys-kernel/xanmod-rt-kernel-${PV} )"