public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Viorel Munteanu" <ceamac@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/virtualbox-modules/files/, app-emulation/virtualbox-modules/
Date: Mon,  3 Apr 2023 06:13:34 +0000 (UTC)	[thread overview]
Message-ID: <1680502363.16f171d9bbc6820a7e417ec75413fe4c2bc631d1.ceamac@gentoo> (raw)

commit:     16f171d9bbc6820a7e417ec75413fe4c2bc631d1
Author:     Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
AuthorDate: Mon Apr  3 06:11:57 2023 +0000
Commit:     Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
CommitDate: Mon Apr  3 06:12:43 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=16f171d9

app-emulation/virtualbox-modules: fix compilation with kernel 6.3

Bug: https://bugs.gentoo.org/903638
Signed-off-by: Viorel Munteanu <ceamac <AT> gentoo.org>

 .../virtualbox-modules-7.0.6-kernel-6.3.patch      | 27 ++++++++++
 .../virtualbox-modules-6.1.42-r1.ebuild            | 61 ++++++++++++++++++++++
 .../virtualbox-modules-7.0.6-r1.ebuild             | 61 ++++++++++++++++++++++
 3 files changed, 149 insertions(+)

diff --git a/app-emulation/virtualbox-modules/files/virtualbox-modules-7.0.6-kernel-6.3.patch b/app-emulation/virtualbox-modules/files/virtualbox-modules-7.0.6-kernel-6.3.patch
new file mode 100644
index 000000000000..3ea343791773
--- /dev/null
+++ b/app-emulation/virtualbox-modules/files/virtualbox-modules-7.0.6-kernel-6.3.patch
@@ -0,0 +1,27 @@
+Linux: vboxdrv: Introduce initial support for kernel 6.3.x series, bugref:10381.
+https://www.virtualbox.org/changeset/98867/vbox
+
+Index: trunk/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
+===================================================================
+--- a/vboxdrv/r0drv/linux/memobj-r0drv-linux.c
++++ b/vboxdrv/r0drv/linux/memobj-r0drv-linux.c
+@@ -1402,5 +1402,9 @@
+             {
+                 flush_dcache_page(pMemLnx->apPages[rc]);
++#if RTLNX_VER_MIN(6,3,0)
++                vm_flags_set(papVMAs[rc], VM_DONTCOPY | VM_LOCKED);
++#else
+                 papVMAs[rc]->vm_flags |= VM_DONTCOPY | VM_LOCKED;
++#endif
+             }
+ 
+@@ -1873,5 +1877,8 @@
+                     /* Thes flags help making 100% sure some bad stuff wont happen (swap, core, ++).
+                      * See remap_pfn_range() in mm/memory.c */
+-#if    RTLNX_VER_MIN(3,7,0)
++
++#if    RTLNX_VER_MIN(6,3,0)
++                    vm_flags_set(vma, VM_DONTEXPAND | VM_DONTDUMP);
++#elif  RTLNX_VER_MIN(3,7,0)
+                     vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
+ #else

diff --git a/app-emulation/virtualbox-modules/virtualbox-modules-6.1.42-r1.ebuild b/app-emulation/virtualbox-modules/virtualbox-modules-6.1.42-r1.ebuild
new file mode 100644
index 000000000000..3258677a03ed
--- /dev/null
+++ b/app-emulation/virtualbox-modules/virtualbox-modules-6.1.42-r1.ebuild
@@ -0,0 +1,61 @@
+# Copyright 2022-2023 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 toolchain-funcs
+
+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"
+
+BUILD_TARGETS="all"
+MODULE_NAMES="vboxdrv(misc:${S}) vboxnetflt(misc:${S}) vboxnetadp(misc:${S})"
+MODULESD_VBOXDRV_ENABLED="yes"
+MODULESD_VBOXNETADP_ENABLED="no"
+MODULESD_VBOXNETFLT_ENABLED="no"
+
+PATCHES=(
+	"${FILESDIR}"/virtualbox-modules-7.0.6-kernel-6.3.patch
+)
+
+pkg_setup() {
+	linux-mod_pkg_setup
+	BUILD_PARAMS="CC=\"$(tc-getBUILD_CC)\" KERN_DIR=${KV_DIR} KERN_VER=${KV_FULL} O=${KV_OUT_DIR} V=1 KBUILD_VERBOSE=1"
+	if linux_chkconfig_present CC_IS_CLANG; then
+		ewarn "Warning: building ${PN} with a clang-built kernel is experimental."
+
+		BUILD_PARAMS+=' CC=${CHOST}-clang'
+		if linux_chkconfig_present LD_IS_LLD; then
+			BUILD_PARAMS+=' LD=ld.lld'
+			if linux_chkconfig_present LTO_CLANG_THIN; then
+				# kernel enables cache by default leading to sandbox violations
+				BUILD_PARAMS+=' ldflags-y=--thinlto-cache-dir= LDFLAGS_MODULE=--thinlto-cache-dir='
+			fi
+		fi
+	fi
+}
+
+src_install() {
+	linux-mod_src_install
+	insinto /usr/lib/modules-load.d/
+	newins "${FILESDIR}"/virtualbox.conf-r1 virtualbox.conf
+}
+
+pkg_postinst() {
+	# Remove vboxpci.ko from current running kernel
+	# This module is obsolete, removed in december 2019, so it may be missing.  No || die
+	# TODO: consider removing this line in the near future
+	find /lib/modules/${KV_FULL}/misc -type f -name "vboxpci.ko" -delete
+	linux-mod_pkg_postinst
+}

diff --git a/app-emulation/virtualbox-modules/virtualbox-modules-7.0.6-r1.ebuild b/app-emulation/virtualbox-modules/virtualbox-modules-7.0.6-r1.ebuild
new file mode 100644
index 000000000000..e4544d662bf5
--- /dev/null
+++ b/app-emulation/virtualbox-modules/virtualbox-modules-7.0.6-r1.ebuild
@@ -0,0 +1,61 @@
+# Copyright 2022-2023 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 toolchain-funcs
+
+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-3"
+SLOT="0/$(ver_cut 1-2)"
+KEYWORDS="~amd64"
+
+BUILD_TARGETS="all"
+MODULE_NAMES="vboxdrv(misc:${S}) vboxnetflt(misc:${S}) vboxnetadp(misc:${S})"
+MODULESD_VBOXDRV_ENABLED="yes"
+MODULESD_VBOXNETADP_ENABLED="no"
+MODULESD_VBOXNETFLT_ENABLED="no"
+
+PATCHES=(
+	"${FILESDIR}"/virtualbox-modules-7.0.6-kernel-6.3.patch
+)
+
+pkg_setup() {
+	linux-mod_pkg_setup
+	BUILD_PARAMS="CC=\"$(tc-getBUILD_CC)\" KERN_DIR=${KV_DIR} KERN_VER=${KV_FULL} O=${KV_OUT_DIR} V=1 KBUILD_VERBOSE=1"
+	if linux_chkconfig_present CC_IS_CLANG; then
+		ewarn "Warning: building ${PN} with a clang-built kernel is experimental."
+
+		BUILD_PARAMS+=' CC=${CHOST}-clang'
+		if linux_chkconfig_present LD_IS_LLD; then
+			BUILD_PARAMS+=' LD=ld.lld'
+			if linux_chkconfig_present LTO_CLANG_THIN; then
+				# kernel enables cache by default leading to sandbox violations
+				BUILD_PARAMS+=' ldflags-y=--thinlto-cache-dir= LDFLAGS_MODULE=--thinlto-cache-dir='
+			fi
+		fi
+	fi
+}
+
+src_install() {
+	linux-mod_src_install
+	insinto /usr/lib/modules-load.d/
+	newins "${FILESDIR}"/virtualbox.conf-r1 virtualbox.conf
+}
+
+pkg_postinst() {
+	# Remove vboxpci.ko from current running kernel
+	# This module is obsolete, removed in december 2019, so it may be missing.  No || die
+	# TODO: consider removing this line in the near future
+	find /lib/modules/${KV_FULL}/misc -type f -name "vboxpci.ko" -delete
+	linux-mod_pkg_postinst
+}


             reply	other threads:[~2023-04-03  6:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-03  6:13 Viorel Munteanu [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-07-24  6:43 [gentoo-commits] repo/gentoo:master commit in: app-emulation/virtualbox-modules/files/, app-emulation/virtualbox-modules/ Viorel Munteanu
2025-06-06  7:49 Viorel Munteanu
2024-08-10  6:48 Viorel Munteanu
2024-01-25 15:50 Viorel Munteanu
2021-03-09 17:27 Lars Wendler
2021-02-22 19:53 Louis Sautier
2019-09-24 19:56 Thomas Deutschmann
2018-04-11  7:54 Lars Wendler
2017-11-27 23:00 Guilherme Amadio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1680502363.16f171d9bbc6820a7e417ec75413fe4c2bc631d1.ceamac@gentoo \
    --to=ceamac@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox