diff options
Diffstat (limited to 'app-emulation/vendor-reset')
4 files changed, 105 insertions, 0 deletions
diff --git a/app-emulation/vendor-reset/Manifest b/app-emulation/vendor-reset/Manifest index 27dfd868f609..8e507190d5a5 100644 --- a/app-emulation/vendor-reset/Manifest +++ b/app-emulation/vendor-reset/Manifest @@ -1,6 +1,9 @@ AUX modload.conf 13 BLAKE2B 1e774873c1bf09ca1f3ec2c006b1938e3aa07187dd5a7f926369d6d1bc2c21bfe52f2cbb632f64174485896c8691ac4cbd10e988b7db7a2a9ada7fdccda1a22d SHA512 7a4bf9c95af41bf11e5a720f6258d62822f553c6f349dbe93cf23743b851d830340d268954252d6f058ea2fa823006a63afd45875e7b9108d5d2a6a1a316ff6d +AUX vendor-reset-0.1.1-allow-correct-compilation-with-clang.patch 893 BLAKE2B 9e068228d633c26a7b115ddb1ae24476d3672cfb2a1fb31ab98509eb09623d08e82b33f860d7ce32072a0961344757607219f36a91a466524c02da7eec522824 SHA512 18507cd4b5b137db8792e37e69154dc873737c0916f24f06e73171c54c12cd8250c6dbc15803a008121be193a37593a2c2b0fd8260d827acff00306909893e9a +AUX vendor-reset-0.1.1-fix-build-on-kernel-6.8.patch 1019 BLAKE2B e9be6b89cb34a3cb7b8c7111a0bfb0cd8f021d916875219b085ae6613d26170bbce2fd3989cdfe0acb9a3d9dbba7cdfb2c7aa375467322bb73c21bf3fdc94afd SHA512 5ab6524c8bd87794d62ac36f660f3183c2cb1d13ef92c9c782329093923b160a6a8e8364ed69766783a959d639c3b9f00d182454592dfd080dfd6acbf70f4b82 DIST vendor-reset-0.1.1_pre20221205.tar.gz 12725340 BLAKE2B 5f2e34b74e83c8f48daad8d2c714872ab23f50cb0fad6b5c7920476b43c2fbfcf5543e923c506dfb2d8c33846e8fdd08c7d20b30fcc053f2c191d813872b44c5 SHA512 87a3c64d917e6a44308115480f14956f65a9f84fef70de29feebe3fcd7d522b59a3dbcb5fc9a340ac9b7a3612a29ed696b4f52648f86a0d877b915c97c5a4cc9 EBUILD vendor-reset-0.1.1_pre20221205-r1.ebuild 928 BLAKE2B fa65e286c8059ba093412992cb8994c6f7e06693265e6cb517105ac0db2f90affb3ce6d4a64ba5ed0bfbf763766b082bbac95ac38b5358e8e958fc41997ff387 SHA512 6f51644140be34052653e0b292a2403551e4779e4eda0d2ef7622658144b57bbf58ac83da2764bad2a2db2680ca01da2e3abf619ccc363aa548930984033dc00 +EBUILD vendor-reset-0.1.1_pre20221205-r2.ebuild 1068 BLAKE2B 55b3a487acebdf9357fc78fd871c7ec42611324edf77d1514a9e8fce4f7ef1e8af8956889a6862f64831ec38082bfc5f14c9b399925be1562e8928d67a5a6e3d SHA512 b710f611b2f8b1ecef4a9b857e22e10b36441b86016230c0bec487189b9f899040a3e2e529d3df17eed76ccb19c7ce0911a8360cc482f85738f84777cf2f3785 EBUILD vendor-reset-0.1.1_pre20221205.ebuild 984 BLAKE2B f5a660655ce81ef2c5c232dad1e1e5335e5471ed4bdf54d8770bb3c37669d780957d8a71a72d56d140721340e8f10dbafcd8728584c313432f73d8cd4435486c SHA512 f23a90ab0ef5d2c3d61e5173c04b8ab7b32d19a52f8df9e0b422960aae366f1bf094a7f5982bddb581b810d71e0116eb47e092cbfa83373e51899d0d60b615eb EBUILD vendor-reset-9999.ebuild 891 BLAKE2B 7bcd1d0527806486d53d81e4a2bf8a4221e73ec639dda09cab8ad09ee2c10a2ae0c5bf4225ce76a40f7c9c70ce06698129dba3ece2b3398af4dc0a93729b1909 SHA512 84e9d9358cf6408e93e4c41343e22be72fd22e581e893cb7e3caee3fcb4ddbb5dd1761d45d12a81c1a6ed8b0309454bab104c8c21112feca01e9ed8777751321 MISC metadata.xml 327 BLAKE2B 288b1a0df2469ed01bf576308ddc36c5843b4682333d6e42f0c3603d5bf43cbd6dd9b21cb07020476b9de92445611d04b2c1d5dd54624ed096f166607154137e SHA512 4ceef67a10bc25ed93bd76aaf1ac133b92a362ea0cf030bce21a14f921c3afc868e53e876bde2af91615b1142b3113c2e45a0a3c9a0abe1775c553118e5fbc3d diff --git a/app-emulation/vendor-reset/files/vendor-reset-0.1.1-allow-correct-compilation-with-clang.patch b/app-emulation/vendor-reset/files/vendor-reset-0.1.1-allow-correct-compilation-with-clang.patch new file mode 100644 index 000000000000..32ae298d4049 --- /dev/null +++ b/app-emulation/vendor-reset/files/vendor-reset-0.1.1-allow-correct-compilation-with-clang.patch @@ -0,0 +1,23 @@ +https://github.com/gnif/vendor-reset/commit/084881c6e9e11bdadaf05798e669568848e698a3.patch +From: =?UTF-8?q?Marcus=20K=C3=B6hler?= <khler.marcus@gmail.com> +Date: Mon, 25 Dec 2023 21:43:41 +0100 +Subject: [PATCH] Allow correct compilation with Clang/LLVM +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Marcus Köhler <khler.marcus@gmail.com> +--- a/src/hook.c ++++ b/src/hook.c +@@ -30,7 +30,11 @@ static bool hook_installed = false; + static int (*orig_pci_dev_specific_reset)(struct pci_dev *dev, int probe); + + /* TCO breaks the hook, we must disable it for this function */ ++#if defined(__GNUC__) && !defined(__llvm__) + __attribute__((optimize("-fno-optimize-sibling-calls"))) ++#elif defined(__clang__) ++__attribute__((disable_tail_calls)) ++#endif + static int hooked_pci_dev_specific_reset(struct pci_dev *dev, int probe) + { + int ret; diff --git a/app-emulation/vendor-reset/files/vendor-reset-0.1.1-fix-build-on-kernel-6.8.patch b/app-emulation/vendor-reset/files/vendor-reset-0.1.1-fix-build-on-kernel-6.8.patch new file mode 100644 index 000000000000..d99212c9ee27 --- /dev/null +++ b/app-emulation/vendor-reset/files/vendor-reset-0.1.1-fix-build-on-kernel-6.8.patch @@ -0,0 +1,35 @@ +https://github.com/gnif/vendor-reset/commit/f72619e468846e0bab4426f5e71b069f88c33a11.patch +From: Sakari <20642596+sakarie9@users.noreply.github.com> +Date: Thu, 14 Mar 2024 10:59:15 +0800 +Subject: [PATCH] Fix build on kernel 6.8+ + +--- a/src/amd/amdgpu/atom.c ++++ b/src/amd/amdgpu/atom.c +@@ -28,6 +28,7 @@ + #include <linux/sched.h> + #include <linux/slab.h> + #include <linux/delay.h> ++#include <linux/version.h> + #include <asm/unaligned.h> + + //#include <drm/drm_util.h> +@@ -39,6 +40,10 @@ + #include "atom-names.h" + #include "atom-bits.h" + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0) ++#define strscpy strlcpy ++#endif ++ + #define ATOM_COND_ABOVE 0 + #define ATOM_COND_ABOVEOREQUAL 1 + #define ATOM_COND_ALWAYS 2 +@@ -1424,7 +1429,7 @@ struct atom_context *amdgpu_atom_parse(struct card_info *card, void *bios) + if (*str != '\0') + { + pr_info("ATOM BIOS: %s\n", str); +- strlcpy(ctx->vbios_version, str, sizeof(ctx->vbios_version)); ++ strscpy(ctx->vbios_version, str, sizeof(ctx->vbios_version)); + } + + return ctx; diff --git a/app-emulation/vendor-reset/vendor-reset-0.1.1_pre20221205-r2.ebuild b/app-emulation/vendor-reset/vendor-reset-0.1.1_pre20221205-r2.ebuild new file mode 100644 index 000000000000..f34969845915 --- /dev/null +++ b/app-emulation/vendor-reset/vendor-reset-0.1.1_pre20221205-r2.ebuild @@ -0,0 +1,44 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit linux-mod-r1 + +if [[ ${PV} == *9999* ]]; then + EGIT_REPO_URI="https://github.com/gnif/vendor-reset.git" + EGIT_BRANCH="master" + inherit git-r3 +else + KEYWORDS="~amd64" + EGIT_COMMIT="4b466e92a2d9f76ce1082cde982c7be0be91e248" + SRC_URI="https://github.com/gnif/vendor-reset/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz" +fi + +DESCRIPTION="Linux kernel vendor specific hardware reset module" +HOMEPAGE="https://github.com/gnif/vendor-reset" + +LICENSE="GPL-2" +SLOT="0" + +S="${WORKDIR}/${PN}-${EGIT_COMMIT}" + +CONFIG_CHECK="FTRACE KPROBES PCI_QUIRKS KALLSYMS FUNCTION_TRACER" + +PATCHES=( + "${FILESDIR}/${PN}-0.1.1-allow-correct-compilation-with-clang.patch" + "${FILESDIR}/${PN}-0.1.1-fix-build-on-kernel-6.8.patch" +) + +src_compile() { + local modlist=( vendor-reset ) + local modargs=( KDIR="${KV_OUT_DIR}" ) + linux-mod-r1_src_compile +} + +src_install() { + linux-mod-r1_src_install + + insinto /etc/modules-load.d/ + newins "${FILESDIR}"/modload.conf vendor-reset.conf +} |