Accepting request 1169265 from home:lwfinger:branches:Virtualization

- Fix build error on Factory;Staging due to libxml 2.12.6. Added file
  libxml21206.patch.
  Added file kernel-6.9.patch to fix builds on kernel 6.9.

OBS-URL: https://build.opensuse.org/request/show/1169265
OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=734
This commit is contained in:
Larry Finger 2024-04-19 16:40:59 +00:00 committed by Git OBS Bridge
parent 593b34655b
commit 507edc9de0
9 changed files with 162 additions and 80 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:305d6bad823577256fc6d60b4da48f3438292dd7811d50cc7554820b173c3e7d
size 153526747
oid sha256:823c905f80e8df02ff0a5ba56e7e4c3a2ade6daa214201cb8e4b636cf5db2574
size 151963329

View File

@ -108,4 +108,3 @@ Index: VirtualBox-7.0.14/src/VBox/Additions/linux/sharedfolders/regops.c
up_read(&pTask->mm->mmap_sem);
if (cPagesLocked == cPages) {
size_t cbRet = (cPages << PAGE_SHIFT) - offPg0;

75
kernel-6.9.patch Normal file
View File

@ -0,0 +1,75 @@
Index: VirtualBox-7.0.14/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
+++ VirtualBox-7.0.14/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
@@ -938,8 +938,13 @@ static void vboxNetFltLinuxSkBufToSG(PVB
{
skb_frag_t *pFrag = &skb_shinfo(pBuf)->frags[i];
# if 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;
+# if RTLNX_VER_MIN(6,9,0)
+ pSG->aSegs[iSeg].cb = pFrag->len;
+ pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->offset;
+# else
+ pSG->aSegs[iSeg].cb = pFrag->bv_len;
+ pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->bv_offset;
+#endif
# else /* < KERNEL_VERSION(5, 4, 0) */
pSG->aSegs[iSeg].cb = pFrag->size;
pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->page_offset;
@@ -959,8 +964,13 @@ static void vboxNetFltLinuxSkBufToSG(PVB
{
skb_frag_t *pFrag = &skb_shinfo(pFragBuf)->frags[i];
# if RTLNX_VER_MIN(5,4,0) || RTLNX_SUSE_MAJ_PREREQ(15, 2)
- pSG->aSegs[iSeg].cb = pFrag->bv_len;
+# if RTLNX_VER_MIN(6,9,0)
+ pSG->aSegs[iSeg].cb = pFrag->len;
+ pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->offset;
+#else
+ pSG->aSegs[iSeg].cb = pFrag->bv_len;
pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->bv_offset;
+#endif
# else /* < KERNEL_VERSION(5, 4, 0) */
pSG->aSegs[iSeg].cb = pFrag->size;
pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->page_offset;
Index: VirtualBox-7.0.14/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
+++ VirtualBox-7.0.14/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
@@ -1174,7 +1174,11 @@ RTDECL(struct page *) rtR0MemObjLinuxVir
u.Four = *p4d_offset(&u.Global, ulAddr);
if (RT_UNLIKELY(p4d_none(u.Four)))
return NULL;
+# if RTLNX_VER_MIN(6,9,0)
+ if (p4d_page(u.Four))
+#else
if (p4d_large(u.Four))
+#endif
{
pPage = p4d_page(u.Four);
AssertReturn(pPage, NULL);
@@ -1190,7 +1194,11 @@ RTDECL(struct page *) rtR0MemObjLinuxVir
if (RT_UNLIKELY(pud_none(u.Upper)))
return NULL;
# if RTLNX_VER_MIN(2,6,25)
+# if RTLNX_VER_MIN(6,9,0)
+ if (pud_page(u.Upper))
+#else
if (pud_large(u.Upper))
+#endif
{
pPage = pud_page(u.Upper);
AssertReturn(pPage, NULL);
@@ -1206,7 +1214,11 @@ RTDECL(struct page *) rtR0MemObjLinuxVir
if (RT_UNLIKELY(pmd_none(u.Middle)))
return NULL;
#if RTLNX_VER_MIN(2,6,0)
+# if RTLNX_VER_MIN(6,9,0)
+ if (pmd_page(u.Middle))
+#else
if (pmd_large(u.Middle))
+#endif
{
pPage = pmd_page(u.Middle);
AssertReturn(pPage, NULL);

68
libxml21206.patch Normal file
View File

@ -0,0 +1,68 @@
Index: VirtualBox-7.0.14/src/VBox/Runtime/r3/xml.cpp
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Runtime/r3/xml.cpp
+++ VirtualBox-7.0.14/src/VBox/Runtime/r3/xml.cpp
@@ -1856,11 +1856,10 @@ static void xmlParserBaseGenericError(vo
va_end(args);
}
-static void xmlParserBaseStructuredError(void *pCtx, xmlErrorPtr error) RT_NOTHROW_DEF
+static void xmlStructuredErrorFunc(void *userData, const xmlError *error) RT_NOTHROW_DEF
{
- NOREF(pCtx);
- /* we expect that there is always a trailing NL */
- LogRel(("XML error at '%s' line %d: %s", error->file, error->line, error->message));
+ NOREF(userData);
+ NOREF(error);
}
XmlParserBase::XmlParserBase()
@@ -1870,7 +1869,7 @@ XmlParserBase::XmlParserBase()
throw std::bad_alloc();
/* per-thread so it must be here */
xmlSetGenericErrorFunc(NULL, xmlParserBaseGenericError);
- xmlSetStructuredErrorFunc(NULL, xmlParserBaseStructuredError);
+// xmlSetStructuredErrorFunc(NULL, xmlStructuredErrorFunc);
}
XmlParserBase::~XmlParserBase()
@@ -1931,7 +1930,7 @@ void XmlMemParser::read(const void *pvBu
pcszFilename,
NULL, // encoding = auto
options)))
- throw XmlError(xmlCtxtGetLastError(m_ctxt));
+ throw XmlError((xmlErrorPtr)xmlCtxtGetLastError(m_ctxt));
doc.refreshInternals();
}
@@ -2191,7 +2190,7 @@ void XmlFileParser::read(const RTCString
pcszFilename,
NULL, // encoding = auto
options)))
- throw XmlError(xmlCtxtGetLastError(m_ctxt));
+ throw XmlError((xmlErrorPtr)xmlCtxtGetLastError(m_ctxt));
doc.refreshInternals();
}
Index: VirtualBox-7.0.14/src/libs/libxml2-2.12.6/include/vboxconfig.h
===================================================================
--- VirtualBox-7.0.14.orig/src/libs/libxml2-2.12.6/include/vboxconfig.h
+++ VirtualBox-7.0.14/src/libs/libxml2-2.12.6/include/vboxconfig.h
@@ -387,7 +387,7 @@
#define PACKAGE_TARNAME ""
/* Define to the version of this package. */
-#define PACKAGE_VERSION "2.6.30"
+#define PACKAGE_VERSION "2.12.6"
/* Define to 1 if the C compiler supports function prototypes. */
#define PROTOTYPES 1
@@ -399,7 +399,7 @@
#undef SUPPORT_IP6
/* Version number of package */
-#define VERSION "2.6.30"
+#define VERSION "2.12.6"
/* Determine what socket length (socklen_t) data type is */
#if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2)

View File

@ -25,74 +25,6 @@ Index: VirtualBox-7.0.14/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec
Summary: Oracle VM VirtualBox
Name: %NAME%
Index: VirtualBox-7.0.14/src/libs/libxml2-2.9.14/libxml.spec.in
===================================================================
--- VirtualBox-7.0.14.orig/src/libs/libxml2-2.9.14/libxml.spec.in
+++ VirtualBox-7.0.14/src/libs/libxml2-2.9.14/libxml.spec.in
@@ -1,3 +1,4 @@
+%global with_python2 0
%global with_python3 1
Summary: Library providing XML and HTML support
@@ -8,7 +9,9 @@ License: MIT
Group: Development/Libraries
Source: https://download.gnome.org/sources/libxml2/@LIBXML_MAJOR_VERSION@.@LIBXML_MINOR_VERSION@/libxml2-%{version}.tar.xz
BuildRoot: %{_tmppath}/%{name}-%{version}-root
+%if 0%{?with_python2}
BuildRequires: python-devel
+%endif
%if 0%{?with_python3}
BuildRequires: python3-devel
%endif # with_python3
@@ -75,7 +78,6 @@ to read, modify and write XML and HTML f
this includes parsing and validation even with complex DTDs, either
at parse time or later once the document has been modified.
-%if 0%{?with_python3}
%package -n python3-%{name}
Summary: Python 3 bindings for the libxml2 library
Group: Development/Libraries
@@ -92,7 +94,6 @@ This library allows to manipulate XML fi
to read, modify and write XML and HTML files. There is DTDs support
this includes parsing and validation even with complex DTDs, either
at parse time or later once the document has been modified.
-%endif # with_python3
%prep
%setup -q
@@ -110,11 +111,14 @@ find doc -type f -exec chmod 0644 \{\} \
%install
rm -fr %{buildroot}
+%if 0%{?with_python2}
+make clean
+%configure --with-python=python
make install DESTDIR=%{buildroot}
-
+%endif # with_python2
%if 0%{?with_python3}
make clean
-%configure --with-python=%{__python3}
+%configure --with-python=python3
make install DESTDIR=%{buildroot}
%endif # with_python3
@@ -177,6 +181,7 @@ rm -fr %{buildroot}
%{_libdir}/*a
+%if 0%{?with_python2}
%files -n python-%{name}
%defattr(-, root, root)
@@ -188,6 +193,7 @@ rm -fr %{buildroot}
%doc python/tests/*.py
%doc doc/*.py
%doc doc/python.html
+%endif
%if 0%{?with_python3}
%files -n python3-%{name}
Index: VirtualBox-7.0.14/src/libs/xpcom18a4/python/src/ErrorUtils.cpp
===================================================================
--- VirtualBox-7.0.14.orig/src/libs/xpcom18a4/python/src/ErrorUtils.cpp

View File

@ -53,7 +53,7 @@ if [ "$?" -ne 0 ] ; then
exit 1
fi
depmod -a
modprobe -av vboxsf vboxguest vboxvideo
modprobe -av vboxguest vboxvideo
cd ../..
rm -rf additions
popd > /dev/null 2>&1

View File

@ -4,6 +4,5 @@
%{kernel_module_directory}/%2-%1/extra/vboxdrv.ko
%{kernel_module_directory}/%2-%1/extra/vboxnetadp.ko
%{kernel_module_directory}/%2-%1/extra/vboxnetflt.ko
%{kernel_module_directory}/%2-%1/extra/vboxsf.ko
%{kernel_module_directory}/%2-%1/extra/vboxguest.ko
%{kernel_module_directory}/%2-%1/extra/vboxvideo.ko

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Apr 19 04:36:59 UTC 2024 - Larry Finger <Larry.Finger@gmail.com>
- Fix build error on Factory;Staging due to libxml 2.12.6. Added file
libxml21206.patch.
Added file kernel-6.9.patch to fix builds on kernel 6.9.
-------------------------------------------------------------------
Mon Apr 1 16:12:39 UTC 2024 - Javier de San Pedro <dev.rpm@javispedro.com>

View File

@ -163,6 +163,8 @@ Patch40: fixes_for_leap.patch
Patch41: fixes_for_leap15.6.patch
Patch42: kernel-6.8.patch
Patch43: fixes_for_vboxconfig.patch
Patch44: kernel-6.9.patch
Patch45: libxml21206.patch
#
# Common BuildRequires for both virtualbox and virtualbox-kmp
BuildRequires: %{kernel_module_package_buildreqs}
@ -481,6 +483,8 @@ This package contains the kernel-modules that VirtualBox uses to create or run v
%endif
%patch -P 42 -p1
%patch -P 43 -p1
%patch -P 44 -p1
%patch -P 45 -p1
### Documents for virtualbox main package ###
%if %{main_package}
@ -547,7 +551,6 @@ EOF
cat >> vbox-guest-tools.conf << EOF
g vboxguest - - - -
g vboxsf - - - -
%if 0%{?suse_version} <= 1500
g vboxvideo - - - -
%endif
@ -1101,10 +1104,10 @@ rm -rf src/libs/{libpng-*,libxml2-*,libxslt-*,zlib-*,boost-*}
# build kernel modules for guest and host (check novel-kmp package as example)
# host modules : vboxdrv,vboxnetflt,vboxnetadp
# guest modules : vboxguest,vboxsf,vboxvideo
# guest modules : vboxguest,vboxvideo
echo "build kernel modules"
for vbox_module in kmp_host/vbox{drv,netflt,netadp} \
kmp_additions/vbox{guest,sf,video}; do
kmp_additions/vbox{guest,video}; do
#get the module name from path
module_name=$(basename "$vbox_module")
@ -1130,9 +1133,8 @@ for vbox_module in kmp_host/vbox{drv,netflt,netadp} \
$PWD/modules_build_dir/$flavor/$module_name
SYMBOLS="$PWD/modules_build_dir/$flavor/vboxdrv/Module.symvers"
fi
# copy vboxguest (for guest) module symbols which are used by vboxsf and vboxvideo km's:
if [ "$module_name" = "vboxsf" -o \
"$module_name" = "vboxvideo" ] ; then
# copy vboxguest (for guest) module symbols which are used by vboxvideo km's:
if [ "$module_name" = "vboxvideo" ] ; then
cp $PWD/modules_build_dir/$flavor/vboxguest/Module.symvers \
$PWD/modules_build_dir/$flavor/$module_name
SYMBOLS="$PWD/modules_build_dir/$flavor/vboxguest/Module.symvers"
@ -1147,7 +1149,7 @@ done
export INSTALL_MOD_PATH=%{buildroot}
export INSTALL_MOD_DIR=extra
#to install modules we use here similar steps like in build phase, go through all the modules :
for module_name in vbox{drv,netflt,netadp,guest,sf,video}
for module_name in vbox{drv,netflt,netadp,guest,video}
do
#and through all flavors
for flavor in %{flavors_to_build}; do