Accepting request 1113057 from Virtualization
- Convert to systemd-sysusers (forwarded request 1112996 from gmbr3) OBS-URL: https://build.opensuse.org/request/show/1113057 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/virtualbox?expand=0&rev=264
This commit is contained in:
commit
1180c5cf6b
@ -116,3 +116,121 @@ Index: VirtualBox-7.0.10/include/VBox/VBoxGuest.h
|
|||||||
} u;
|
} u;
|
||||||
} VBGLIOCLOG, RT_FAR *PVBGLIOCLOG;
|
} VBGLIOCLOG, RT_FAR *PVBGLIOCLOG;
|
||||||
/** @} */
|
/** @} */
|
||||||
|
Index: VirtualBox-7.0.10/src/VBox/Additions/linux/sharedfolders/regops.c
|
||||||
|
===================================================================
|
||||||
|
--- VirtualBox-7.0.10.orig/src/VBox/Additions/linux/sharedfolders/regops.c
|
||||||
|
+++ VirtualBox-7.0.10/src/VBox/Additions/linux/sharedfolders/regops.c
|
||||||
|
@@ -1,4 +1,4 @@
|
||||||
|
-/* $Id: regops.c $ */
|
||||||
|
+/* $Id: regops.c 100799 2023-08-04 18:04:14Z vboxsync $ */
|
||||||
|
/** @file
|
||||||
|
* vboxsf - VBox Linux Shared Folders VFS, regular file inode and file operations.
|
||||||
|
*/
|
||||||
|
@@ -58,6 +58,14 @@
|
||||||
|
# define SEEK_END 2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+#if RTLNX_VER_MIN(6,4,0)
|
||||||
|
+# define VBOX_ITER_IOV_ADDR(a_iter) iter_iov_addr(a_iter)
|
||||||
|
+#elif RTLNX_VER_MIN(3,19,0)
|
||||||
|
+# define VBOX_ITER_IOV_ADDR(a_iter) (a_iter->kvec->iov_base + a_iter->iov_offset)
|
||||||
|
+#else
|
||||||
|
+# define VBOX_ITER_IOV_ADDR(a_iter) (a_iter->iov->iov_base + a_iter->iov_offset)
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
#if RTLNX_VER_MAX(3,16,0)
|
||||||
|
# define iter_is_iovec(a_pIter) ( !((a_pIter)->type & ITER_KVEC) )
|
||||||
|
#elif RTLNX_VER_MAX(3,19,0)
|
||||||
|
@@ -96,6 +104,14 @@
|
||||||
|
# define VBSF_GET_ITER_IOV(_iter) iter->iov
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+/** @def VBOX_IOV_ITER_IS_KVEC
|
||||||
|
+ * Test if iov iter type is ITER_KVEC. */
|
||||||
|
+#if RTLNX_VER_MIN(4,20,0)
|
||||||
|
+# define VBOX_IOV_ITER_IS_KVEC(a_iter) iov_iter_is_kvec(a_iter)
|
||||||
|
+#else
|
||||||
|
+# define VBOX_IOV_ITER_IS_KVEC(a_iter) (VBSF_GET_ITER_TYPE(iter) & ITER_KVEC)
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
|
||||||
|
/*********************************************************************************************************************************
|
||||||
|
* Structures and Typedefs *
|
||||||
|
@@ -254,7 +270,11 @@ static ssize_t vbsf_iov_iter_get_pages(s
|
||||||
|
size_t cPagesLocked;
|
||||||
|
|
||||||
|
down_read(&pTask->mm->mmap_sem);
|
||||||
|
- cPagesLocked = get_user_pages(pTask, pTask->mm, uPtrFrom, cPages, iter->v_write, 1 /*force*/, papPages, NULL);
|
||||||
|
+ cPagesLocked = get_user_pages(pTask, pTask->mm, uPtrFrom, cPages, iter->v_write, 1 /*force*/, papPages,
|
||||||
|
+# if RTLNX_VER_MAX(6, 5, 0)
|
||||||
|
+ NULL
|
||||||
|
+# endif
|
||||||
|
+ );
|
||||||
|
up_read(&pTask->mm->mmap_sem);
|
||||||
|
if (cPagesLocked == cPages) {
|
||||||
|
size_t cbRet = (cPages << PAGE_SHIFT) - offPg0;
|
||||||
|
@@ -367,8 +387,8 @@ static size_t copy_from_iter(uint8_t *pb
|
||||||
|
if (cbThisCopy > cbToCopy)
|
||||||
|
cbThisCopy = cbToCopy;
|
||||||
|
if (pSrcIter->type & ITER_KVEC)
|
||||||
|
- memcpy(pbDst, (void *)pSrcIter->iov->iov_base + pSrcIter->iov_offset, cbThisCopy);
|
||||||
|
- else if (copy_from_user(pbDst, pSrcIter->iov->iov_base + pSrcIter->iov_offset, cbThisCopy) != 0)
|
||||||
|
+ memcpy(pbDst, (void *)VBOX_ITER_IOV_ADDR(pSrcIter), cbThisCopy);
|
||||||
|
+ else if (copy_from_user(pbDst, VBOX_ITER_IOV_ADDR(pSrcIter), cbThisCopy) != 0)
|
||||||
|
break;
|
||||||
|
pbDst += cbThisCopy;
|
||||||
|
cbToCopy -= cbThisCopy;
|
||||||
|
@@ -406,8 +426,8 @@ static size_t copy_to_iter(uint8_t const
|
||||||
|
if (cbThisCopy > cbToCopy)
|
||||||
|
cbThisCopy = cbToCopy;
|
||||||
|
if (pDstIter->type & ITER_KVEC)
|
||||||
|
- memcpy((void *)pDstIter->iov->iov_base + pDstIter->iov_offset, pbSrc, cbThisCopy);
|
||||||
|
- else if (copy_to_user(pDstIter->iov->iov_base + pDstIter->iov_offset, pbSrc, cbThisCopy) != 0) {
|
||||||
|
+ memcpy((void *)VBOX_ITER_IOV_ADDR(pDstIter), pbSrc, cbThisCopy);
|
||||||
|
+ else if (copy_to_user(VBOX_ITER_IOV_ADDR(pDstIter), pbSrc, cbThisCopy) != 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
pbSrc += cbThisCopy;
|
||||||
|
@@ -1462,12 +1482,16 @@ DECLINLINE(int) vbsf_lock_user_pages(uin
|
||||||
|
ssize_t cPagesLocked = get_user_pages_unlocked(current, current->mm, uPtrFrom, cPages, papPages,
|
||||||
|
fWrite ? FOLL_WRITE | FOLL_FORCE : FOLL_FORCE);
|
||||||
|
# elif RTLNX_VER_MIN(4,0,0)
|
||||||
|
- ssize_t cPagesLocked = get_user_pages_unlocked(current, current->mm, uPtrFrom, cPages, fWrite, 1 /*force*/, papPages);
|
||||||
|
-# else
|
||||||
|
+ ssize_t cPagesLocked = get_user_pages_unlocked(current, current->mm, uPtrFrom, cPages, fWrite, 1 /*force*/, papPages);
|
||||||
|
+ # else
|
||||||
|
struct task_struct *pTask = current;
|
||||||
|
ssize_t cPagesLocked;
|
||||||
|
down_read(&pTask->mm->mmap_sem);
|
||||||
|
- cPagesLocked = get_user_pages(pTask, pTask->mm, uPtrFrom, cPages, fWrite, 1 /*force*/, papPages, NULL);
|
||||||
|
+ cPagesLocked = get_user_pages(pTask, pTask->mm, uPtrFrom, cPages, fWrite, 1 /*force*/, papPages,
|
||||||
|
+# if RTLNX_VER_MAX(6, 5, 0)
|
||||||
|
+ NULL
|
||||||
|
+#endif
|
||||||
|
+ );
|
||||||
|
up_read(&pTask->mm->mmap_sem);
|
||||||
|
# endif
|
||||||
|
*pfLockPgHack = false;
|
||||||
|
@@ -2152,7 +2176,8 @@ static int vbsf_iter_lock_pages(struct i
|
||||||
|
int rc = 0;
|
||||||
|
|
||||||
|
Assert(iov_iter_count(iter) + pStash->cb > 0);
|
||||||
|
- if (!(VBSF_GET_ITER_TYPE(iter) & ITER_KVEC)) {
|
||||||
|
+ if (!VBOX_IOV_ITER_IS_KVEC(iter))
|
||||||
|
+ {
|
||||||
|
/*
|
||||||
|
* Do we have a stashed page?
|
||||||
|
*/
|
||||||
|
@@ -2309,11 +2334,7 @@ static int vbsf_iter_lock_pages(struct i
|
||||||
|
cbSeg = iov_iter_single_seg_count(iter);
|
||||||
|
}
|
||||||
|
|
||||||
|
-# if RTLNX_VER_MIN(3,19,0)
|
||||||
|
- pbBuf = iter->kvec->iov_base + iter->iov_offset;
|
||||||
|
-# else
|
||||||
|
- pbBuf = iter->iov->iov_base + iter->iov_offset;
|
||||||
|
-# endif
|
||||||
|
+ pbBuf = VBOX_ITER_IOV_ADDR(iter);
|
||||||
|
offStart = (uintptr_t)pbBuf & PAGE_OFFSET_MASK;
|
||||||
|
if (!cPages)
|
||||||
|
offPage0 = offStart;
|
||||||
|
@ -2,7 +2,7 @@ Index: VirtualBox-7.0.10/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- VirtualBox-7.0.10.orig/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
|
--- VirtualBox-7.0.10.orig/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
|
||||||
+++ VirtualBox-7.0.10/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
|
+++ VirtualBox-7.0.10/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
|
||||||
@@ -89,6 +89,17 @@
|
@@ -89,6 +89,21 @@
|
||||||
#define VBOXNETFLT_OS_SPECFIC 1
|
#define VBOXNETFLT_OS_SPECFIC 1
|
||||||
#include "../VBoxNetFltInternal.h"
|
#include "../VBoxNetFltInternal.h"
|
||||||
|
|
||||||
@ -14,8 +14,12 @@ Index: VirtualBox-7.0.10/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.
|
|||||||
+# endif
|
+# endif
|
||||||
+
|
+
|
||||||
+#if !defined(skb_gso_segment)
|
+#if !defined(skb_gso_segment)
|
||||||
|
+#if defined(CONFIG_SUSE_VERSION) && (CONFIG_SUSE_VERSION == 15)
|
||||||
|
+//#include <config/net/mpls/gso.h>
|
||||||
|
+#else
|
||||||
+#include <net/gso.h>
|
+#include <net/gso.h>
|
||||||
+#endif
|
+#endif
|
||||||
|
+#endif
|
||||||
+
|
+
|
||||||
typedef struct VBOXNETFLTNOTIFIER {
|
typedef struct VBOXNETFLTNOTIFIER {
|
||||||
struct notifier_block Notifier;
|
struct notifier_block Notifier;
|
||||||
|
@ -811,7 +811,7 @@ Index: VirtualBox-7.0.10/src/VBox/Additions/linux/drm/vbox_drv.h
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- VirtualBox-7.0.10.orig/src/VBox/Additions/linux/drm/vbox_drv.h
|
--- VirtualBox-7.0.10.orig/src/VBox/Additions/linux/drm/vbox_drv.h
|
||||||
+++ VirtualBox-7.0.10/src/VBox/Additions/linux/drm/vbox_drv.h
|
+++ VirtualBox-7.0.10/src/VBox/Additions/linux/drm/vbox_drv.h
|
||||||
@@ -88,6 +88,12 @@
|
@@ -87,6 +87,12 @@
|
||||||
#else
|
#else
|
||||||
# define RTLNX_RHEL_MAX(a_iMajor, a_iMinor) (0)
|
# define RTLNX_RHEL_MAX(a_iMajor, a_iMinor) (0)
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,3 +1,14 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Sep 22 12:19:15 UTC 2023 - Callum Farmer <gmbr3@opensuse.org>
|
||||||
|
|
||||||
|
- Convert to systemd-sysusers
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Sep 20 22:06:33 UTC 2023 - Larry Finger <Larry.Finger@gmail.com>
|
||||||
|
|
||||||
|
- Fix problems wiith 6.5 kernels and shared folders. boo#1215463.
|
||||||
|
Fix build errors for Leap 15.4, 15.5, and 15.6 due to gso.h not found.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Fri Aug 18 18:18:19 UTC 2023 - Larry Finger <Larry.Finger@gmail.com>
|
Fri Aug 18 18:18:19 UTC 2023 - Larry Finger <Larry.Finger@gmail.com>
|
||||||
|
|
||||||
|
@ -217,6 +217,7 @@ BuildRequires: python3-devel
|
|||||||
BuildRequires: rpm
|
BuildRequires: rpm
|
||||||
BuildRequires: sed
|
BuildRequires: sed
|
||||||
BuildRequires: systemd-rpm-macros
|
BuildRequires: systemd-rpm-macros
|
||||||
|
BuildRequires: sysuser-tools
|
||||||
BuildRequires: update-desktop-files
|
BuildRequires: update-desktop-files
|
||||||
BuildRequires: which
|
BuildRequires: which
|
||||||
BuildRequires: xorg-x11-server
|
BuildRequires: xorg-x11-server
|
||||||
@ -247,7 +248,6 @@ BuildRequires: pkgconfig(xrandr)
|
|||||||
Requires: %{name}-kmp = %{version}
|
Requires: %{name}-kmp = %{version}
|
||||||
Requires(pre): %fillup_prereq
|
Requires(pre): %fillup_prereq
|
||||||
Requires(pre): permissions
|
Requires(pre): permissions
|
||||||
Requires(pre): shadow
|
|
||||||
Recommends: %{name}-gui = %{version}
|
Recommends: %{name}-gui = %{version}
|
||||||
# package i4l-vbox from source package i4l-base shares the directory /etc/vbox
|
# package i4l-vbox from source package i4l-base shares the directory /etc/vbox
|
||||||
# with us, but with different owner.
|
# with us, but with different owner.
|
||||||
@ -256,6 +256,7 @@ Conflicts: i4l-vbox
|
|||||||
Provides: %{name}-ose = %{version}
|
Provides: %{name}-ose = %{version}
|
||||||
Obsoletes: %{name}-ose < %{version}
|
Obsoletes: %{name}-ose < %{version}
|
||||||
%{?systemd_ordering}
|
%{?systemd_ordering}
|
||||||
|
%{?sysusers_requires}
|
||||||
%if 0%{?suse_version} > 1325
|
%if 0%{?suse_version} > 1325
|
||||||
BuildRequires: libboost_headers-devel
|
BuildRequires: libboost_headers-devel
|
||||||
%else
|
%else
|
||||||
@ -337,6 +338,7 @@ Obsoletes: xorg-x11-driver-virtualbox-ose < %{version}
|
|||||||
%if ! 0%{?suse_version} > 1325
|
%if ! 0%{?suse_version} > 1325
|
||||||
Requires(pre): net-tools-deprecated
|
Requires(pre): net-tools-deprecated
|
||||||
%endif
|
%endif
|
||||||
|
%{?sysusers_requires}
|
||||||
|
|
||||||
%description guest-tools
|
%description guest-tools
|
||||||
VirtualBox guest addition tools.
|
VirtualBox guest addition tools.
|
||||||
@ -530,6 +532,23 @@ echo "build VNC extension pack"
|
|||||||
sed -i 's/tar /tar --format=gnu /' src/VBox/ExtPacks/VNC/Makefile.kmk
|
sed -i 's/tar /tar --format=gnu /' src/VBox/ExtPacks/VNC/Makefile.kmk
|
||||||
kmk -C src/VBox/ExtPacks/VNC packing
|
kmk -C src/VBox/ExtPacks/VNC packing
|
||||||
|
|
||||||
|
######################################################
|
||||||
|
# system users and groups
|
||||||
|
cat >> vbox.conf << EOF
|
||||||
|
g vboxusers - - - -
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat >> vbox-guest-tools.conf << EOF
|
||||||
|
g vboxguest - - - -
|
||||||
|
g vboxsf - - - -
|
||||||
|
%if 0%{?suse_version} <= 1500
|
||||||
|
g vboxvideo - - - -
|
||||||
|
%endif
|
||||||
|
EOF
|
||||||
|
|
||||||
|
%sysusers_generate_pre vbox.conf vbox vbox.conf
|
||||||
|
%sysusers_generate_pre vbox-guest-tools.conf vbox-guest-tools vbox-guest-tools.conf
|
||||||
|
|
||||||
%install
|
%install
|
||||||
#################################
|
#################################
|
||||||
echo "create directory structure"
|
echo "create directory structure"
|
||||||
@ -735,6 +754,11 @@ done
|
|||||||
popd
|
popd
|
||||||
#
|
#
|
||||||
######################################################
|
######################################################
|
||||||
|
# system users and groups
|
||||||
|
|
||||||
|
install -Dm0644 vbox.conf %{buildroot}%{_sysusersdir}/vbox.conf
|
||||||
|
install -Dm0644 vbox-guest-tools.conf %{buildroot}%{_sysusersdir}/vbox-guest-tools.conf
|
||||||
|
######################################################
|
||||||
# run fdupes
|
# run fdupes
|
||||||
######################################################
|
######################################################
|
||||||
#run fdupes because we lost link for virtualbox/components directory
|
#run fdupes because we lost link for virtualbox/components directory
|
||||||
@ -750,18 +774,11 @@ popd
|
|||||||
# scriptlets - pre
|
# scriptlets - pre
|
||||||
######################################################
|
######################################################
|
||||||
|
|
||||||
%pre
|
%pre -f vbox.pre
|
||||||
getent group vboxusers >/dev/null || groupadd -r vboxusers
|
|
||||||
%service_add_pre vboxdrv.service
|
%service_add_pre vboxdrv.service
|
||||||
%service_add_pre vboxautostart-service.service
|
%service_add_pre vboxautostart-service.service
|
||||||
|
|
||||||
%pre guest-tools
|
%pre guest-tools -f vbox-guest-tools.pre
|
||||||
# Add groups for seamless mode and shared folders:
|
|
||||||
getent group vboxguest >/dev/null || groupadd -r vboxguest
|
|
||||||
getent group vboxsf >/dev/null || groupadd -r vboxsf
|
|
||||||
%if 0%{?suse_version} <= 1500
|
|
||||||
getent group vboxvideo >/dev/null || groupadd -r vboxvideo
|
|
||||||
%endif
|
|
||||||
%service_add_pre vboxadd-service.service
|
%service_add_pre vboxadd-service.service
|
||||||
|
|
||||||
%pre websrv
|
%pre websrv
|
||||||
@ -940,6 +957,7 @@ export DISABLE_RESTART_ON_UPDATE=yes
|
|||||||
%{_unitdir}/multi-user.target.wants/vboxweb-service.service
|
%{_unitdir}/multi-user.target.wants/vboxweb-service.service
|
||||||
%{_unitdir}/multi-user.target.wants/vboxdrv.service
|
%{_unitdir}/multi-user.target.wants/vboxdrv.service
|
||||||
%{_unitdir}/multi-user.target.wants/vboxautostart-service.service
|
%{_unitdir}/multi-user.target.wants/vboxautostart-service.service
|
||||||
|
%{_sysusersdir}/vbox.conf
|
||||||
%{_sbindir}/rcvboxdrv
|
%{_sbindir}/rcvboxdrv
|
||||||
%{_sbindir}/rcvboxautostart
|
%{_sbindir}/rcvboxautostart
|
||||||
%{_sbindir}/vboxconfig
|
%{_sbindir}/vboxconfig
|
||||||
@ -1006,6 +1024,7 @@ export DISABLE_RESTART_ON_UPDATE=yes
|
|||||||
%{_sysconfdir}/X11/xinit/xinitrc.d/98vboxadd-xclient
|
%{_sysconfdir}/X11/xinit/xinitrc.d/98vboxadd-xclient
|
||||||
%{_unitdir}/vboxclient.service
|
%{_unitdir}/vboxclient.service
|
||||||
%{_unitdir}/vboxservice.service
|
%{_unitdir}/vboxservice.service
|
||||||
|
%{_sysusersdir}/vbox-guest-tools.conf
|
||||||
%dir %{_sysconfdir}/xdg
|
%dir %{_sysconfdir}/xdg
|
||||||
%dir %{_sysconfdir}/xdg/autostart
|
%dir %{_sysconfdir}/xdg/autostart
|
||||||
%{_sysconfdir}/xdg/autostart/vboxclient.desktop
|
%{_sysconfdir}/xdg/autostart/vboxclient.desktop
|
||||||
|
Loading…
Reference in New Issue
Block a user