commit: 8ce24674798743136ef0a089602e8cb9d25494b0 Author: Viorel Munteanu <ceamac <AT> gentoo <DOT> org> AuthorDate: Thu May 29 08:26:14 2025 +0000 Commit: Viorel Munteanu <ceamac <AT> gentoo <DOT> org> CommitDate: Thu May 29 08:46:16 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8ce24674
app-emulation/virtualbox-guest-modules: support kernel 6.15 Add initial support for kernel 6.15, backported from virtualbox-7.2.0_beta1 Bug: https://bugs.gentoo.org/956675 Signed-off-by: Viorel Munteanu <ceamac <AT> gentoo.org> ...irtualbox-guest-modules-7.1.8-kernel-6.15.patch | 170 +++++++++++++++++++++ .../virtualbox-guest-modules-7.0.26-r1.ebuild | 48 ++++++ .../virtualbox-guest-modules-7.1.8-r1.ebuild | 48 ++++++ 3 files changed, 266 insertions(+) diff --git a/app-emulation/virtualbox-guest-modules/files/virtualbox-guest-modules-7.1.8-kernel-6.15.patch b/app-emulation/virtualbox-guest-modules/files/virtualbox-guest-modules-7.1.8-kernel-6.15.patch new file mode 100644 index 000000000000..03a627a938d2 --- /dev/null +++ b/app-emulation/virtualbox-guest-modules/files/virtualbox-guest-modules-7.1.8-kernel-6.15.patch @@ -0,0 +1,170 @@ +Add initial support for kernel 6.15.0. +Patch obtained by comparing sources from 7.1.8 and 7.2.0_BETA1 where upstream added support. +https://bugs.gentoo.org/956675 + +--- a/vboxguest/Makefile-footer.gmk ++++ b/vboxguest/Makefile-footer.gmk +@@ -115,6 +115,7 @@ VBOXMOD_EXT := ko + + # build defs + EXTRA_CFLAGS += $(VBOXMOD_CFLAGS) $(addprefix -I,$(KERN_INCL) $(VBOXMOD_INCL)) $(VBOXMOD_0_KFLAGS) $(KDEBUG) ++ccflags-y += $(EXTRA_CFLAGS) + $(VBOXMOD_0_TARGET)-y := $(VBOXMOD_OBJS) + obj-m += $(VBOXMOD_0_TARGET).o + +--- a/vboxguest/r0drv/linux/timer-r0drv-linux.c ++++ b/vboxguest/r0drv/linux/timer-r0drv-linux.c +@@ -422,7 +422,11 @@ static void rtTimerLnxStopSubTimer(PRTTIMERLNXSUBTIMER pSubTimer, bool fHighRes) + } + else + #endif ++# if RTLNX_VER_MIN(6,15,0) ++ timer_delete(&pSubTimer->u.Std.LnxTimer); ++#else + del_timer(&pSubTimer->u.Std.LnxTimer); ++#endif + + rtTimerLnxSetState(&pSubTimer->enmState, RTTIMERLNXSTATE_STOPPED); + } +@@ -470,7 +474,11 @@ static void rtTimerLnxDestroyIt(PRTTIMER pTimer) + hrtimer_cancel(&pTimer->aSubTimers[iCpu].u.Hr.LnxTimer); + else + #endif ++# if RTLNX_VER_MIN(6,15,0) ++ timer_delete_sync(&pTimer->aSubTimers[iCpu].u.Std.LnxTimer); ++#else + del_timer_sync(&pTimer->aSubTimers[iCpu].u.Std.LnxTimer); ++#endif + } + + /* +@@ -1626,8 +1634,13 @@ RTDECL(int) RTTimerCreateEx(PRTTIMER *ppTimer, uint64_t u64NanoInterval, uint32_ + #ifdef RTTIMER_LINUX_WITH_HRTIMER + if (pTimer->fHighRes) + { ++#if RTLNX_VER_MIN(6,15,0) ++ hrtimer_setup(&pTimer->aSubTimers[iCpu].u.Hr.LnxTimer, ++ rtTimerLinuxHrCallback, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); ++#else + hrtimer_init(&pTimer->aSubTimers[iCpu].u.Hr.LnxTimer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); + pTimer->aSubTimers[iCpu].u.Hr.LnxTimer.function = rtTimerLinuxHrCallback; ++#endif + } + else + #endif +--- a/vboxsf/Makefile-footer.gmk ++++ b/vboxsf/Makefile-footer.gmk +@@ -115,6 +115,7 @@ VBOXMOD_EXT := ko + + # build defs + EXTRA_CFLAGS += $(VBOXMOD_CFLAGS) $(addprefix -I,$(KERN_INCL) $(VBOXMOD_INCL)) $(VBOXMOD_0_KFLAGS) $(KDEBUG) ++ccflags-y += $(EXTRA_CFLAGS) + $(VBOXMOD_0_TARGET)-y := $(VBOXMOD_OBJS) + obj-m += $(VBOXMOD_0_TARGET).o + +--- a/vboxsf/dirops.c ++++ b/vboxsf/dirops.c +@@ -1088,7 +1088,9 @@ static int vbsf_inode_create(struct inode *parent, struct dentry *dentry, int mo + * @param mode file mode + * @returns 0 on success, Linux error code otherwise + */ +-#if RTLNX_VER_MIN(6,3,0) || RTLNX_RHEL_RANGE(9,6, 9,99) || defined(DOXYGEN_RUNNING) ++#if RTLNX_VER_MIN(6,15,0) ++static struct dentry *vbsf_inode_mkdir(struct mnt_idmap *idmap, struct inode *parent, struct dentry *dentry, umode_t mode) ++#elif RTLNX_VER_MIN(6,3,0) || RTLNX_RHEL_RANGE(9,6, 9,99) || defined(DOXYGEN_RUNNING) + static int vbsf_inode_mkdir(struct mnt_idmap *idmap, struct inode *parent, struct dentry *dentry, umode_t mode) + #elif RTLNX_VER_MIN(5,12,0) + static int vbsf_inode_mkdir(struct user_namespace *ns, struct inode *parent, struct dentry *dentry, umode_t mode) +@@ -1098,14 +1100,22 @@ static int vbsf_inode_mkdir(struct inode *parent, struct dentry *dentry, umode_t + static int vbsf_inode_mkdir(struct inode *parent, struct dentry *dentry, int mode) + #endif + { ++ int rc; ++ + TRACE(); + AssertMsg(!(mode & S_IFMT) || (mode & S_IFMT) == S_IFDIR, ("0%o\n", mode)); +- return vbsf_create_worker(parent, dentry, (mode & ~S_IFMT) | S_IFDIR, +- SHFL_CF_ACT_CREATE_IF_NEW +- | SHFL_CF_ACT_FAIL_IF_EXISTS +- | SHFL_CF_ACCESS_READWRITE +- | SHFL_CF_DIRECTORY, +- false /*fStashHandle*/, false /*fDoLookup*/, NULL /*phHandle*/, NULL /*fCreated*/); ++ ++ rc = vbsf_create_worker(parent, dentry, (mode & ~S_IFMT) | S_IFDIR, ++ SHFL_CF_ACT_CREATE_IF_NEW ++ | SHFL_CF_ACT_FAIL_IF_EXISTS ++ | SHFL_CF_ACCESS_READWRITE ++ | SHFL_CF_DIRECTORY, ++ false /*fStashHandle*/, false /*fDoLookup*/, NULL /*phHandle*/, NULL /*fCreated*/); ++#if RTLNX_VER_MIN(6,15,0) ++ return ERR_PTR(rc); ++#else ++ return rc; ++#endif + } + + +--- a/vboxvideo/Makefile-footer.gmk ++++ b/vboxvideo/Makefile-footer.gmk +@@ -115,6 +115,7 @@ VBOXMOD_EXT := ko + + # build defs + EXTRA_CFLAGS += $(VBOXMOD_CFLAGS) $(addprefix -I,$(KERN_INCL) $(VBOXMOD_INCL)) $(VBOXMOD_0_KFLAGS) $(KDEBUG) ++ccflags-y += $(EXTRA_CFLAGS) + $(VBOXMOD_0_TARGET)-y := $(VBOXMOD_OBJS) + obj-m += $(VBOXMOD_0_TARGET).o + +--- a/vboxvideo/vbox_fb.c ++++ b/vboxvideo/vbox_fb.c +@@ -260,7 +260,7 @@ static struct fb_info *drm_fb_helper_alloc_fbi(struct drm_fb_helper *helper) + } + #endif + +-static int vboxfb_create(struct drm_fb_helper *helper, ++int vboxfb_create(struct drm_fb_helper *helper, + struct drm_fb_helper_surface_size *sizes) + { + struct vbox_fbdev *fbdev = +@@ -407,9 +407,11 @@ static int vboxfb_create(struct drm_fb_helper *helper, + return 0; + } + ++#if RTLNX_VER_MAX(6,15,0) + static struct drm_fb_helper_funcs vbox_fb_helper_funcs = { + .fb_probe = vboxfb_create, + }; ++#endif + + #if RTLNX_VER_MAX(4,3,0) && !RTLNX_RHEL_MAJ_PREREQ(7,3) + static void drm_fb_helper_unregister_fbi(struct drm_fb_helper *fb_helper) +@@ -478,7 +480,9 @@ int vbox_fbdev_init(struct drm_device *dev) + vbox->fbdev = fbdev; + spin_lock_init(&fbdev->dirty_lock); + +-#if RTLNX_VER_MIN(6,3,0) || RTLNX_RHEL_RANGE(8,9, 8,99) || RTLNX_RHEL_RANGE(9,3, 9,99) ++#if RTLNX_VER_MIN(6,15,0) ++ drm_fb_helper_prepare(dev, &fbdev->helper, 32, NULL); ++#elif RTLNX_VER_MIN(6,3,0) || RTLNX_RHEL_RANGE(8,9, 8,99) || RTLNX_RHEL_RANGE(9,3, 9,99) + drm_fb_helper_prepare(dev, &fbdev->helper, 32, &vbox_fb_helper_funcs); + #elif RTLNX_VER_MIN(3,17,0) || RTLNX_RHEL_MIN(7,2) + drm_fb_helper_prepare(dev, &fbdev->helper, &vbox_fb_helper_funcs); +--- a/vboxvideo/vbox_mode.c ++++ b/vboxvideo/vbox_mode.c +@@ -653,12 +653,13 @@ static int vbox_get_modes(struct drm_connector *connector) + return num_modes; + } + +-#if RTLNX_VER_MAX(3,14,0) && !RTLNX_RHEL_MAJ_PREREQ(7,1) +-static int vbox_mode_valid(struct drm_connector *connector, ++#if RTLNX_VER_MIN(6,15,0) ++static enum drm_mode_status vbox_mode_valid(struct drm_connector *connector, const struct drm_display_mode *mode) ++#elif RTLNX_VER_MIN(3,14,0) || RTLNX_RHEL_MAJ_PREREQ(7,1) ++static enum drm_mode_status vbox_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) + #else +-static enum drm_mode_status vbox_mode_valid(struct drm_connector *connector, ++static int vbox_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) + #endif +- struct drm_display_mode *mode) + { + return MODE_OK; + } diff --git a/app-emulation/virtualbox-guest-modules/virtualbox-guest-modules-7.0.26-r1.ebuild b/app-emulation/virtualbox-guest-modules/virtualbox-guest-modules-7.0.26-r1.ebuild new file mode 100644 index 000000000000..97d7f8a7b25c --- /dev/null +++ b/app-emulation/virtualbox-guest-modules/virtualbox-guest-modules-7.0.26-r1.ebuild @@ -0,0 +1,48 @@ +# Copyright 2022-2025 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-guest-kernel-module-src-${PV}" +DESCRIPTION="Kernel Modules for Virtualbox Guest Additions" +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 ~x86" + +PATCHES=( + "${FILESDIR}"/${PN}-6.1.36-log-use-c99.patch + "${FILESDIR}"/${PN}-7.1.8-kernel-6.15.patch +) + +CONFIG_CHECK="~DRM_TTM ~DRM_VMWGFX" +WARNING_DRM_TTM="DRM_TTM is needed for running the vboxvideo driver." +WARNING_DRM_VMWGFX="DRM_VMWGFX is the recommended driver for VMSVGA." + +src_compile() { + local modlist=( {vboxguest,vboxsf}=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 /etc/modprobe.d # 485996 + newins - vboxsf.conf <<-EOF + # modprobe.d configuration file for VBOXSF + + # Internal Aliases - Do not edit + # ------------------------------ + alias fs-vboxsf vboxsf + EOF +} diff --git a/app-emulation/virtualbox-guest-modules/virtualbox-guest-modules-7.1.8-r1.ebuild b/app-emulation/virtualbox-guest-modules/virtualbox-guest-modules-7.1.8-r1.ebuild new file mode 100644 index 000000000000..97d7f8a7b25c --- /dev/null +++ b/app-emulation/virtualbox-guest-modules/virtualbox-guest-modules-7.1.8-r1.ebuild @@ -0,0 +1,48 @@ +# Copyright 2022-2025 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-guest-kernel-module-src-${PV}" +DESCRIPTION="Kernel Modules for Virtualbox Guest Additions" +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 ~x86" + +PATCHES=( + "${FILESDIR}"/${PN}-6.1.36-log-use-c99.patch + "${FILESDIR}"/${PN}-7.1.8-kernel-6.15.patch +) + +CONFIG_CHECK="~DRM_TTM ~DRM_VMWGFX" +WARNING_DRM_TTM="DRM_TTM is needed for running the vboxvideo driver." +WARNING_DRM_VMWGFX="DRM_VMWGFX is the recommended driver for VMSVGA." + +src_compile() { + local modlist=( {vboxguest,vboxsf}=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 /etc/modprobe.d # 485996 + newins - vboxsf.conf <<-EOF + # modprobe.d configuration file for VBOXSF + + # Internal Aliases - Do not edit + # ------------------------------ + alias fs-vboxsf vboxsf + EOF +}
