diff --git a/sys-kernel/asahi-kernel/Manifest b/sys-kernel/asahi-kernel/Manifest index 0ba0cc06..ea9f2df4 100644 --- a/sys-kernel/asahi-kernel/Manifest +++ b/sys-kernel/asahi-kernel/Manifest @@ -3,3 +3,4 @@ DIST gentoo-kernel-config-g11.tar.gz 5077 BLAKE2B dc17ded74f79baddd703a78084113b DIST kernel-aarch64-16k-fedora.config-6.6.3-414-gentoo 272164 BLAKE2B 27de91eb46c467015d18eac1fe3c96c71112caae73c9818ee4a5c476f57732e7a7b1fd18feaf008e61d1fc775e1b1cb32b32c0fdda3b3ebfeb8e6f7e79a34e6d SHA512 e4196f46f92e5c8d0e681d42fe6392ac2a150530a71e189d7abeff877c76a0a86c4619d794f181ea784f12ad0a1d1f6d639bbcd4209396436b03b5baa4d6998b DIST kernel-aarch64-16k-fedora.config-6.8.7-402-gentoo 279185 BLAKE2B 84ce67080186723d9a8a47141d7a66e031fc39f6f02ac55352f34e05e7d5a288354c046fb87a8c21b04870736ec0d813173a05cefa7a24598d07fd30393b36a7 SHA512 ff8e0ac754ade12fcdfe96fa98318c8b42e21da3ed165ed28808752212f0507a0d94e4a0b54ee992a307577e02a10696d3a0cd2d74cfa9840eb634bbbd3217fe DIST linux-asahi-6.8.6-4.tar.gz 235255308 BLAKE2B 47b789a1cd0284d722937001ce934ef4ed0eab3f25dbc6f1add5fdf2aac58c60b2c9b24f71d34f2f1cc7044c1bca50fa0cab2d2d6f2d7acc0789c0ae05be778d SHA512 a3b2041754ae7b73a8612b3623683229788744652037983bc092f77dc9371938a82f4641a93e4f909d5cd4b0ea25d77714ffe05f686ff92a96efbe23e3dfe4c6 +DIST linux-asahi-6.8.8-2.tar.gz 235265018 BLAKE2B cf543955971865d65c048b7021a8bf4d9711294afd49e4ce31bf3e4761dea8724950a52a7b6b852645760e0abb1ca2abe1ac6c3feafbcb933a53e56dcc4044e4 SHA512 101566de3777517d151effcdd2e38b6a5d5961754734cdabfae7c359bbf0f35e2c7a4ecb912d4c300adb3f09ecaa31eafaf076d849171e0e5244ec29a0bf30a4 diff --git a/sys-kernel/asahi-kernel/asahi-kernel-6.8.8_p2.ebuild b/sys-kernel/asahi-kernel/asahi-kernel-6.8.8_p2.ebuild new file mode 100644 index 00000000..3a51fcfa --- /dev/null +++ b/sys-kernel/asahi-kernel/asahi-kernel-6.8.8_p2.ebuild @@ -0,0 +1,131 @@ +# Copyright 2023-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="8" +K_SECURITY_UNSUPPORTED="1" +ETYPE="sources" +#K_WANT_GENPATCHES="base extras experimental" +#K_GENPATCHES_VER="5" +K_NODRYRUN="1" + +inherit kernel-build + +if [[ ${PV} != ${PV/_rc} ]] ; then + # $PV is expected to be of following form: 6.0_rc5_p1 + MY_TAG="$(ver_cut 6)" + MY_P="asahi-$(ver_rs 2 - $(ver_cut 1-4))-${MY_TAG}" +else + # $PV is expected to be of following form: 5.19.0_p1 + MY_TAG="$(ver_cut 5)" + if [[ "$(ver_cut 3)" == "0" ]] ; then + MY_P="asahi-$(ver_cut 1-2)-${MY_TAG}" + else + MY_P="asahi-$(ver_cut 1-3)-${MY_TAG}" + fi +fi +CONFIG_VER=6.8.7-402-gentoo +GENTOO_CONFIG_VER=g11 +FEDORA_CONFIG_DISTGIT="copr-dist-git.fedorainfracloud.org/cgit/@asahi/kernel" +# FEDORA_CONFIG_DISTGIT="copr-dist-git.fedorainfracloud.org/cgit/ngompa/fedora-asahi-dev" +FEDORA_CONFIG_SHA1=647ffd915dc8351fd69790ee708b1ae8638ccc95 + +DESCRIPTION="Asahi Linux kernel sources" +HOMEPAGE="https://asahilinux.org" +KERNEL_URI="https://github.com/AsahiLinux/linux/archive/refs/tags/${MY_P}.tar.gz -> linux-${MY_P}.tar.gz" +SRC_URI="${KERNEL_URI} + https://github.com/projg2/gentoo-kernel-config/archive/${GENTOO_CONFIG_VER}.tar.gz + -> gentoo-kernel-config-${GENTOO_CONFIG_VER}.tar.gz + https://${FEDORA_CONFIG_DISTGIT}/kernel.git/plain/kernel-aarch64-16k-fedora.config?id=${FEDORA_CONFIG_SHA1} + -> kernel-aarch64-16k-fedora.config-${CONFIG_VER} +" + +S="${WORKDIR}/linux-${MY_P}" + +LICENSE="GPL-2" +KEYWORDS="~arm64" + +IUSE="debug" + +# Rust is non-negotiable for the dist kernel +DEPEND=" + ${DEPEND} + virtual/rust + || ( + >=dev-lang/rust-bin-1.76[rust-src,rustfmt] + >=dev-lang/rust-1.76[rust-src,rustfmt] + ) + dev-util/bindgen + debug? ( dev-util/pahole ) +" + +PDEPEND=" + ~virtual/dist-kernel-${PV} +" + +QA_FLAGS_IGNORED=" + usr/src/linux-.*/scripts/gcc-plugins/.*.so + usr/src/linux-.*/vmlinux + usr/src/linux-.*/arch/powerpc/kernel/vdso.*/vdso.*.so.dbg +" + +PATCHES=( + "${FILESDIR}/${PN}-$(ver_cut 1-2)-enable-speakers.patch" +) + +src_prepare() { + default + + # prepare the default config + cp "${DISTDIR}/kernel-aarch64-16k-fedora.config-${CONFIG_VER}" ".config" || die + + # ensure a consistant version across kernel and gentoo + # this passes the ${PV}-as-release check in kernel-install_pkg_preinst() + # override "-asahi" in localversion.05-asahi with "_pX" to override the + # kernel's base varsion to gentoo's ${PV} + echo "-p${MY_TAG}" > localversion.05-asahi + # use CONFIG_LOCALVERSION to provide "asahi" and "dist" annotations. + local myversion="-asahi-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 + ) + + # deselect all non APPLE arm64 ARCHs + merge_configs+=( + "${FILESDIR}"/linux-$(ver_cut 1-2)_arm64_deselect_non_apple_arch.config + ) + # adjust base config for Apple silicon systems + merge_configs+=( + "${FILESDIR}"/linux-$(ver_cut 1-2)_arch_apple_overrides.config + ) + + kernel-build_merge_configs "${merge_configs[@]}" +} + +src_install() { + # call kernel-build's scr_install + kernel-build_src_install + + # symlink installed *.dtbs back into kernel "source" directory + local dir_ver=${PV}${KV_LOCALVERSION} + local kernel_dir=/usr/src/linux-${dir_ver} + local relfile=${ED}${kernel_dir}/include/config/kernel.release + local module_ver + module_ver=$(<"${relfile}") || die + + for dtb in /boot/dtbs/${module_ver}/apple/*.dtb; do + dosym ${dtb} /${kernel_dir}/arch/arm64/boot/dts/apple/$(basename ${dtb}) + done +} + +pkg_postinst() { + einfo "For more information about Asahi Linux please visit ${HOMEPAGE}," + einfo "or consult the Wiki at https://github.com/AsahiLinux/docs/wiki." + kernel-build_pkg_postinst +} diff --git a/virtual/dist-kernel/dist-kernel-6.8.8_p2.ebuild b/virtual/dist-kernel/dist-kernel-6.8.8_p2.ebuild new file mode 100644 index 00000000..321b24d4 --- /dev/null +++ b/virtual/dist-kernel/dist-kernel-6.8.8_p2.ebuild @@ -0,0 +1,12 @@ +# Copyright 2021-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="Virtual to depend on any Distribution Kernel" +SLOT="0/${PVR}" +KEYWORDS="~arm64" + +RDEPEND=" + ~sys-kernel/asahi-kernel-${PV} +"