From 5e7b517cfafbbd020d7bf16ddbc8b7db2af39580 Mon Sep 17 00:00:00 2001 From: Alfred Wingate Date: Mon, 9 May 2022 14:15:57 +0300 Subject: [PATCH 1/3] sys-kernel/xanmod-kernel: initial import Signed-off-by: Alfred Wingate --- sys-kernel/xanmod-kernel/Manifest | 6 ++ sys-kernel/xanmod-kernel/metadata.xml | 8 ++ .../xanmod-kernel/xanmod-kernel-5.17.5.ebuild | 97 +++++++++++++++++++ 3 files changed, 111 insertions(+) create mode 100644 sys-kernel/xanmod-kernel/Manifest create mode 100644 sys-kernel/xanmod-kernel/metadata.xml create mode 100644 sys-kernel/xanmod-kernel/xanmod-kernel-5.17.5.ebuild diff --git a/sys-kernel/xanmod-kernel/Manifest b/sys-kernel/xanmod-kernel/Manifest new file mode 100644 index 0000000..553341d --- /dev/null +++ b/sys-kernel/xanmod-kernel/Manifest @@ -0,0 +1,6 @@ +DIST genpatches-5.17-7.base.tar.xz 557368 BLAKE2B 7d9668f583167cb46a87a451416a69e1f1042bff745cca1394e83649580f920fd18aa030f558975f9ac4e256f70336ffd3b238616fd58697f9370753d7753d22 SHA512 3164fe7a6907bc7ceaf48dbc474c8d3807aa7499cb2a706995d3c27da89a19b34990d9b981d5d0e583ce23973a9a4dd2ad251d44c1f8d539dfd6e64d93416d28 +DIST genpatches-5.17-7.extras.tar.xz 3796 BLAKE2B 6921f442b3c5a3d1f5d437504668488c96879cfcbbfc096275afccab4664d01a0748b0a72e4bbcc1f1564829eeb8346402a14120d79a7be923cf08c0ecacf385 SHA512 8049dfa5390180a9d0cad7d18ea13cf2620e9883d733d8d5e2a09c11b26e4afd8ae28f81872e7e16bd6107205f0bf17edb475b390384fb4989d688b7b49630ae +DIST gentoo-kernel-config-g1.tar.gz 4283 BLAKE2B 44dd51ec45ebc71bffcd6d85a2fefba053f7bce8035057f0bbe928e24816ad4ba03c9bf67dcfcd6d6d1833c0a2ea93e0fd486c2093664dc41ccce316e1e60588 SHA512 3a45f28df9d457df0fe0d185da8b10f4e35f49dad75075e041e8cf3cf6972fecc8145cd557b0bf3a8dea20ddffae0194f88e61c1e5098fa0a5ca301d40aeea2e +DIST kernel-x86_64-fedora.config.5.17.5 219028 BLAKE2B a8a3e2f31315d6aaf19c6771db94a3549379fd48a33b29b00d0311a36325ba8e9f124b5962a447aa8bf63b01f714298f4fca7ff071db165f183ce9023e2b4cf2 SHA512 8c7937310b8e9cbaefe4d6910595df373edfea5a56e439671583c98a752eb5d9029bcb32178ea6b09e6847e55e71dd9ab94e0adb149626ce04c8a9e8f6d7a145 +DIST linux-5.17.tar.xz 128399340 BLAKE2B 82dc4a45cc25c781ac67aa6ed1e4c369544154960f41c4634d47621f381159687a227054976d078524cda28884d395a15f7542fe44ca74ce98ca6ff54a81d6d0 SHA512 89f0a7ca69d20a539d4b612a7028a30a5e98b402e4b6b88516f14237e5da4b626d7929eab8b40fccc90766e8f3bae87e9858a19077ffad20d8204acf18794f5b +DIST patch-5.17.5-xanmod1.xz 745504 BLAKE2B 2c17607c0eab5afa0266b1272785cb57b83628f3860ab391766f5068514526ad009892ecaef7157f328669d5b3acea5527f3bafb44d0e67f573a83a47a41fbab SHA512 7d6df43d8a7e11e287b22b80355465d8f24fabf42d6f3cd41567cfa98489b40d6a336c392453961c85f85161532df5781f5422a1b8922500e2441c62f7062058 diff --git a/sys-kernel/xanmod-kernel/metadata.xml b/sys-kernel/xanmod-kernel/metadata.xml new file mode 100644 index 0000000..e090665 --- /dev/null +++ b/sys-kernel/xanmod-kernel/metadata.xml @@ -0,0 +1,8 @@ + + + + + Use selection of hardening options recommended by Kernel Self Protection Project + Build initramfs along with the kernel. + + diff --git a/sys-kernel/xanmod-kernel/xanmod-kernel-5.17.5.ebuild b/sys-kernel/xanmod-kernel/xanmod-kernel-5.17.5.ebuild new file mode 100644 index 0000000..fb03de9 --- /dev/null +++ b/sys-kernel/xanmod-kernel/xanmod-kernel-5.17.5.ebuild @@ -0,0 +1,97 @@ +# Copyright 2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit kernel-build toolchain-funcs + +MY_P=linux-${PV%.*} +# https://dev.gentoo.org/~mpagano/genpatches/index.html +GENPATCHES_P=genpatches-${PV%.*}-$(( ${PV##*.} + 2 )) +CONFIG_VER=5.17.5 +# Commit hash from https://src.fedoraproject.org/rpms/kernel +CONFIG_HASH=f20aa9d1023a1912c5ef522d47b7deab27fae207 +# Tag from https://github.com/mgorny/gentoo-kernel-config +GENTOO_CONFIG_VER=g1 + +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 + https://github.com/xanmod/linux/releases/download/${PV}-xanmod1/patch-${PV}-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 + amd64? ( + https://src.fedoraproject.org/rpms/kernel/raw/${CONFIG_HASH}/f/kernel-x86_64-fedora.config + -> kernel-x86_64-fedora.config.${CONFIG_VER} + ) +" +S=${WORKDIR}/${MY_P} + +LICENSE="GPL-2" +KEYWORDS="-* ~amd64" +IUSE="debug hardened" + +RDEPEND=" + !sys-kernel/xanmod-kernel-bin:${SLOT} +" +BDEPEND=" + debug? ( dev-util/pahole ) +" +PDEPEND=" + >=virtual/dist-kernel-${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" | xargs rm || die + + local PATCHES=( + # meh, genpatches have no directory + "${WORKDIR}"/*.patch + "${WORKDIR}"/patch-${PV}-xanmod1 + ) + default + + # prepare the default config + case ${ARCH} in + amd64) + cp "${DISTDIR}/kernel-x86_64-fedora.config.${CONFIG_VER}" .config || die + ;; + *) + die "Unsupported arch ${ARCH}" + ;; + esac + + rm "${S}/localversion" || die + local myversion="-xanmod1-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[@]}" +} From 976d7707d4a715424649f943975e0ce662564315 Mon Sep 17 00:00:00 2001 From: Alfred Wingate Date: Tue, 10 May 2022 19:47:28 +0300 Subject: [PATCH 2/3] virtual/dist-kernel: initial import Signed-off-by: Alfred Wingate --- virtual/dist-kernel/dist-kernel-5.17.5.ebuild | 21 +++++++++++++++++++ virtual/dist-kernel/metadata.xml | 5 +++++ 2 files changed, 26 insertions(+) create mode 100644 virtual/dist-kernel/dist-kernel-5.17.5.ebuild create mode 100644 virtual/dist-kernel/metadata.xml diff --git a/virtual/dist-kernel/dist-kernel-5.17.5.ebuild b/virtual/dist-kernel/dist-kernel-5.17.5.ebuild new file mode 100644 index 0000000..ad0ed82 --- /dev/null +++ b/virtual/dist-kernel/dist-kernel-5.17.5.ebuild @@ -0,0 +1,21 @@ +# Copyright 2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="Virtual to depend on any Distribution Kernel" +HOMEPAGE="" +SRC_URI="" + +LICENSE="" +SLOT="0/${PV}" +KEYWORDS="~amd64" + +RDEPEND=" + || ( + ~sys-kernel/gentoo-kernel-${PV} + ~sys-kernel/gentoo-kernel-bin-${PV} + ~sys-kernel/vanilla-kernel-${PV} + ~sys-kernel/xanmod-kernel-${PV} + ~sys-kernel/xanmod-kernel-bin-${PV} + )" diff --git a/virtual/dist-kernel/metadata.xml b/virtual/dist-kernel/metadata.xml new file mode 100644 index 0000000..30295e1 --- /dev/null +++ b/virtual/dist-kernel/metadata.xml @@ -0,0 +1,5 @@ + + + + + From 6fc93e248dbce44103d923626fdf8b09c8bcdda8 Mon Sep 17 00:00:00 2001 From: Alfred Wingate Date: Tue, 10 May 2022 19:47:48 +0300 Subject: [PATCH 3/3] virtual/linux-sources: initial import Signed-off-by: Alfred Wingate --- virtual/linux-sources/linux-sources-3.ebuild | 30 ++++++++++++++++++++ virtual/linux-sources/metadata.xml | 8 ++++++ 2 files changed, 38 insertions(+) create mode 100644 virtual/linux-sources/linux-sources-3.ebuild create mode 100644 virtual/linux-sources/metadata.xml diff --git a/virtual/linux-sources/linux-sources-3.ebuild b/virtual/linux-sources/linux-sources-3.ebuild new file mode 100644 index 0000000..b056b25 --- /dev/null +++ b/virtual/linux-sources/linux-sources-3.ebuild @@ -0,0 +1,30 @@ +# Copyright 2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="Virtual for Linux kernel sources" + +SLOT="0" +KEYWORDS="~amd64" +IUSE="firmware" + +RDEPEND=" + firmware? ( sys-kernel/linux-firmware ) + || ( + sys-kernel/gentoo-sources + sys-kernel/vanilla-sources + sys-kernel/git-sources + sys-kernel/mips-sources + sys-kernel/pf-sources + sys-kernel/rt-sources + sys-kernel/zen-sources + sys-kernel/raspberrypi-sources + sys-kernel/liquorix-sources + sys-kernel/zen-sources + sys-kernel/xanmod-sources + sys-kernel/gentoo-kernel + sys-kernel/gentoo-kernel-bin + sys-kernel/vanilla-kernel + sys-kernel/xanmod-kernel + )" diff --git a/virtual/linux-sources/metadata.xml b/virtual/linux-sources/metadata.xml new file mode 100644 index 0000000..2b27732 --- /dev/null +++ b/virtual/linux-sources/metadata.xml @@ -0,0 +1,8 @@ + + + + + Install linux kernel firmware + + +