mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
app-emulation/virtualbox-modules: fix build with kernel 6.9+
Closes: https://bugs.gentoo.org/937445 Signed-off-by: Viorel Munteanu <ceamac@gentoo.org>
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
https://www.virtualbox.org/ticket/22033
|
||||
https://bugs.gentoo.org/937445
|
||||
|
||||
--- a/vboxdrv/r0drv/linux/memobj-r0drv-linux.c
|
||||
+++ b/vboxdrv/r0drv/linux/memobj-r0drv-linux.c
|
||||
@@ -114,6 +114,14 @@
|
||||
# define LNX_MM_UP_WRITE(a_pMm) up_write(&(a_pMm)->mmap_sem)
|
||||
#endif
|
||||
|
||||
+/*
|
||||
+ * p.._large alias for p.._leaf is gone in 6.9
|
||||
+ */
|
||||
+#if RTLNX_VER_MIN(6,9,0)
|
||||
+# define p4d_large p4d_leaf
|
||||
+# define pmd_large pmd_leaf
|
||||
+# define pud_large pud_leaf
|
||||
+#endif
|
||||
|
||||
/*********************************************************************************************************************************
|
||||
* Structures and Typedefs *
|
||||
--- a/vboxnetflt/linux/VBoxNetFlt-linux.c
|
||||
+++ b/vboxnetflt/linux/VBoxNetFlt-linux.c
|
||||
@@ -926,7 +926,10 @@ static void vboxNetFltLinuxSkBufToSG(PVB
|
||||
for (i = 0; i < skb_shinfo(pBuf)->nr_frags; i++)
|
||||
{
|
||||
skb_frag_t *pFrag = &skb_shinfo(pBuf)->frags[i];
|
||||
-# if RTLNX_VER_MIN(5,4,0) || RTLNX_SUSE_MAJ_PREREQ(15, 2)
|
||||
+# if RTLNX_VER_MIN(6,9,0)
|
||||
+ pSG->aSegs[iSeg].cb = pFrag->len;
|
||||
+ pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->offset;
|
||||
+# elif RTLNX_VER_MIN(5,4,0) || RTLNX_SUSE_MAJ_PREREQ(15, 2)
|
||||
pSG->aSegs[iSeg].cb = pFrag->bv_len;
|
||||
pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->bv_offset;
|
||||
# else /* < KERNEL_VERSION(5, 4, 0) */
|
||||
@@ -947,7 +950,10 @@ static void vboxNetFltLinuxSkBufToSG(PVB
|
||||
for (i = 0; i < skb_shinfo(pFragBuf)->nr_frags; i++)
|
||||
{
|
||||
skb_frag_t *pFrag = &skb_shinfo(pFragBuf)->frags[i];
|
||||
-# if RTLNX_VER_MIN(5,4,0) || RTLNX_SUSE_MAJ_PREREQ(15, 2)
|
||||
+# if RTLNX_VER_MIN(6,9,0)
|
||||
+ pSG->aSegs[iSeg].cb = pFrag->len;
|
||||
+ pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->offset;
|
||||
+# elif RTLNX_VER_MIN(5,4,0) || RTLNX_SUSE_MAJ_PREREQ(15, 2)
|
||||
pSG->aSegs[iSeg].cb = pFrag->bv_len;
|
||||
pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->bv_offset;
|
||||
# else /* < KERNEL_VERSION(5, 4, 0) */
|
||||
@@ -0,0 +1,39 @@
|
||||
# Copyright 2022-2024 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
# XXX: the tarball here is just the kernel modules split out of the binary
|
||||
# package that comes from VirtualBox-*.run
|
||||
# XXX: update: now it is split from virtualbox-*-Debian~bullseye_amd64.deb
|
||||
|
||||
EAPI=8
|
||||
|
||||
inherit linux-mod-r1
|
||||
|
||||
MY_P="vbox-kernel-module-src-${PV}"
|
||||
DESCRIPTION="Kernel Modules for Virtualbox"
|
||||
HOMEPAGE="https://www.virtualbox.org/"
|
||||
SRC_URI="https://dev.gentoo.org/~ceamac/${CATEGORY}/${PN}/${MY_P}.tar.xz"
|
||||
S="${WORKDIR}"
|
||||
|
||||
LICENSE="GPL-2"
|
||||
SLOT="0/$(ver_cut 1-2)"
|
||||
KEYWORDS="~amd64"
|
||||
|
||||
CONFIG_CHECK="~!SPINLOCK JUMP_LABEL"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/${PN}-7.0.14-kernel-6.6-warning.patch
|
||||
"${FILESDIR}"/${PN}-7.0.14-kernel-6.9.patch
|
||||
)
|
||||
|
||||
src_compile() {
|
||||
local modlist=( {vboxdrv,vboxnetflt,vboxnetadp}=misc )
|
||||
local modargs=( KERN_DIR="${KV_OUT_DIR}" KERN_VER="${KV_FULL}" )
|
||||
linux-mod-r1_src_compile
|
||||
}
|
||||
|
||||
src_install() {
|
||||
linux-mod-r1_src_install
|
||||
insinto /usr/lib/modules-load.d/
|
||||
newins "${FILESDIR}"/virtualbox.conf-r1 virtualbox.conf
|
||||
}
|
||||
Reference in New Issue
Block a user