LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-31-2019, 04:24 PM   #1
metageek
Member
 
Registered: Jun 2007
Location: Farmington, CT
Distribution: Slackware64
Posts: 142

Rep: Reputation: 28
VirtualBox fails to build drivers for kernel 4.4.172


I just upgraded to the new kernel release 4.4.172 (for slackware64 14.2) and now VirtualBox is unable to build the kernel drivers.

I tried just rebuiling using the VirtualBox I had already installed (Version 5.1.14 r112924), and I get this error:

tail /var/log/vbox-install.log:
Code:
  if [ "-pg" = "-pg" ]; then if [ /tmp/vbox.0/r0drv/linux/threadctxhooks-r0drv-linux.o != "scripts/mod/empty.o" ]; then ./scripts/recordmcount  "/tmp/vbox.0/r0drv/linux/threadctxhooks-r0drv-linux.o"; fi; fi;
  if [ "-pg" = "-pg" ]; then if [ /tmp/vbox.0/r0drv/linux/time-r0drv-linux.o != "scripts/mod/empty.o" ]; then ./scripts/recordmcount  "/tmp/vbox.0/r0drv/linux/time-r0drv-linux.o"; fi; fi;
  if [ "-pg" = "-pg" ]; then if [ /tmp/vbox.0/SUPDrvTracer.o != "scripts/mod/empty.o" ]; then ./scripts/recordmcount  "/tmp/vbox.0/SUPDrvTracer.o"; fi; fi;
  if [ "-pg" = "-pg" ]; then if [ /tmp/vbox.0/SUPDrvGip.o != "scripts/mod/empty.o" ]; then ./scripts/recordmcount  "/tmp/vbox.0/SUPDrvGip.o"; fi; fi;
  if [ "-pg" = "-pg" ]; then if [ /tmp/vbox.0/r0drv/linux/timer-r0drv-linux.o != "scripts/mod/empty.o" ]; then ./scripts/recordmcount  "/tmp/vbox.0/r0drv/linux/timer-r0drv-linux.o"; fi; fi;
  if [ "-pg" = "-pg" ]; then if [ /tmp/vbox.0/SUPDrv.o != "scripts/mod/empty.o" ]; then ./scripts/recordmcount  "/tmp/vbox.0/SUPDrv.o"; fi; fi;
Makefile:1436: recipe for target '_module_/tmp/vbox.0' failed
make[1]: *** [_module_/tmp/vbox.0] Error 2
Makefile:303: recipe for target 'vboxdrv' failed
make: *** [vboxdrv] Error 2
I then dowloaded the latest VirtualBox 6.0.4 r128413 (released Jan 28) but get exactly the same error... any ideas?
 
Old 01-31-2019, 04:31 PM   #2
metageek
Member
 
Registered: Jun 2007
Location: Farmington, CT
Distribution: Slackware64
Posts: 142

Original Poster
Rep: Reputation: 28
I forgot to mention that I am using the binary versions from Oracle, not the SBo package
 
Old 01-31-2019, 04:40 PM   #3
montagdude
Senior Member
 
Registered: Apr 2016
Distribution: Slackware
Posts: 1,389

Rep: Reputation: 1037Reputation: 1037Reputation: 1037Reputation: 1037Reputation: 1037Reputation: 1037Reputation: 1037Reputation: 1037
Take a look at this post:

https://www.linuxquestions.org/quest...ml#post5956080
 
1 members found this post helpful.
Old 01-31-2019, 06:50 PM   #4
cesarion76
Member
 
Registered: Nov 2009
Location: Rosario, Argentina
Distribution: Slackware
Posts: 55

Rep: Reputation: 3
Same problem and message here. Unable to build the driver. I'm using the latest virtulabox from Oracle and slackware64 multilib 14.2
 
Old 02-01-2019, 04:17 AM   #5
mimochodem
LQ Newbie
 
Registered: Feb 2019
Posts: 1

Rep: Reputation: Disabled
Hi,

This is my first post to Slackware community, so hello to everyone and please excuse me if something goes wrong!

I'm using Slackbuild's virtualbox build on 14.2 and after upgrade to kernel 4.4.172 it has stopped working.
I've tried to rebuild virtualbox-kernel package but with no success.

Thanks to montagdude's link above and bormant's fix there I was able to fix the Slackbuild's script.
I've built successfuly Slackbuild's 5.0.40 virtualbox-kernel package on 4.4.172 kernel and I'm running it without troubles at the moment.

If anyone interested, I attach my patches here.

kernel-4.4-build-168-and-newer.diff :

Code:
--- memobj-r0drv-linux.c.orig   2019-02-01 09:08:53.000000000 +0100
+++ memobj-r0drv-linux.c        2019-02-01 09:21:42.058771069 +0100
@@ -1087,7 +1087,7 @@
                                 pTask->mm,              /* Whose pages. */
                                 R3Ptr,                  /* Where from. */
                                 cPages,                 /* How many pages. */
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 168)
                                 fWrite ? FOLL_WRITE |   /* Write to memory. */
                                          FOLL_FORCE     /* force write access. */
                                        : 0,             /* Write to memory. */
virtualbox-kernel-4.4-build-168-and-newer.SlackBuild.diff :

Code:
--- virtualbox-kernel.SlackBuild.orig   2019-02-01 09:52:39.608772205 +0100
+++ virtualbox-kernel.SlackBuild        2019-02-01 09:31:56.000000000 +0100
@@ -65,6 +65,9 @@
  \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

+# patch for kernel 4.4 build 168 and newer.
+patch -d vboxdrv/r0drv/linux -i $CWD/kernel-4.4-build-168-and-newer.diff
+
 if ! [ "${HARDENING:-yes}" = "yes" ]; then
   sed -i "s/ -DVBOX_WITH_HARDENING//g" \
    {vboxdrv,vboxnetadp,vboxnetflt,vboxpci}/Makefile
Just put it to Slackbuild's virtualbox-kernel build directory (where the virtualbox-kernel.SlackBuild is) and patch the build script with:

Code:
patch -i virtualbox-kernel-4.4-build-168-and-newer.SlackBuild.diff
then run the build script as usual:

Code:
./virtualbox-kernel.SlackBuild
Have a nice day!

Last edited by mimochodem; 02-01-2019 at 04:23 AM. Reason: spelling error
 
4 members found this post helpful.
Old 02-01-2019, 07:03 AM   #6
trasherdk
LQ Newbie
 
Registered: Dec 2016
Posts: 2

Rep: Reputation: Disabled
After downloading VirtualBox-6.0.4 source from Oracle, I've been searching for
the file location to apply the patch.

I've also downloaded, and run VirtualBox-6.0.4-128413-Linux_amd64.run

Searching the file: VirtualBox-6.0.4/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
and the file: /usr/src/vboxhost-6.0.4/vboxdrv/r0drv/linux/memobj-r0drv-linux.c

Neither file contain the "if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)" line.

What's going on here?

Anyway. I found 3 of "if GET_USER_PAGES_API >= KERNEL_VERSION(4, 9, 0)"
and changing those to "if GET_USER_PAGES_API >= KERNEL_VERSION(4, 4, 168)"
made the drivers compile
 
2 members found this post helpful.
Old 02-01-2019, 08:53 AM   #7
metageek
Member
 
Registered: Jun 2007
Location: Farmington, CT
Distribution: Slackware64
Posts: 142

Original Poster
Rep: Reputation: 28
With the Oracle binary for VirtualBox 5.1.14-112924 the patch from https://www.linuxquestions.org/quest...ml#post5956080 works.

I installed the binary and after it failed compiling the drivers, I applied the patch:

Code:
--- memobj-r0drv-linux.c.orig   2019-02-01 09:08:53.000000000 +0100
+++ memobj-r0drv-linux.c        2019-02-01 09:21:42.058771069 +0100
@@ -1087,7 +1087,7 @@
                                 pTask->mm,              /* Whose pages. */
                                 R3Ptr,                  /* Where from. */
                                 cPages,                 /* How many pages. */
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 168)
                                 fWrite ? FOLL_WRITE |   /* Write to memory. */
                                          FOLL_FORCE     /* force write access. */
                                        : 0,             /* Write to memory. */
Code:
cd /opt/VirtualBox/src/vboxhost/vboxdrv/r0drv/linux
patch < patch1
But this does not work with the most recent VirtualBox 6.0.4-128413. For that one I followed the hack suggested by trasherdk and that worked. But since I don't really understand the code or the kernel change, I would prefer a more authoritative solution!
 
Old 02-01-2019, 09:32 AM   #8
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 14.2 + Multilib
Posts: 1,477

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
Originally Posted by mimochodem View Post
Hi,

This is my first post to Slackware community, so hello to everyone and please excuse me if something goes wrong!

I'm using Slackbuild's virtualbox build on 14.2 and after upgrade to kernel 4.4.172 it has stopped working.
I've tried to rebuild virtualbox-kernel package but with no success.

Thanks to montagdude's link above and bormant's fix there I was able to fix the Slackbuild's script.
I've built successfuly Slackbuild's 5.0.40 virtualbox-kernel package on 4.4.172 kernel and I'm running it without troubles at the moment.

If anyone interested, I attach my patches here.

kernel-4.4-build-168-and-newer.diff :

Code:
--- memobj-r0drv-linux.c.orig   2019-02-01 09:08:53.000000000 +0100
+++ memobj-r0drv-linux.c        2019-02-01 09:21:42.058771069 +0100
@@ -1087,7 +1087,7 @@
                                 pTask->mm,              /* Whose pages. */
                                 R3Ptr,                  /* Where from. */
                                 cPages,                 /* How many pages. */
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 168)
                                 fWrite ? FOLL_WRITE |   /* Write to memory. */
                                          FOLL_FORCE     /* force write access. */
                                        : 0,             /* Write to memory. */
virtualbox-kernel-4.4-build-168-and-newer.SlackBuild.diff :

Code:
--- virtualbox-kernel.SlackBuild.orig   2019-02-01 09:52:39.608772205 +0100
+++ virtualbox-kernel.SlackBuild        2019-02-01 09:31:56.000000000 +0100
@@ -65,6 +65,9 @@
  \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

+# patch for kernel 4.4 build 168 and newer.
+patch -d vboxdrv/r0drv/linux -i $CWD/kernel-4.4-build-168-and-newer.diff
+
 if ! [ "${HARDENING:-yes}" = "yes" ]; then
   sed -i "s/ -DVBOX_WITH_HARDENING//g" \
    {vboxdrv,vboxnetadp,vboxnetflt,vboxpci}/Makefile
Just put it to Slackbuild's virtualbox-kernel build directory (where the virtualbox-kernel.SlackBuild is) and patch the build script with:

Code:
patch -i virtualbox-kernel-4.4-build-168-and-newer.SlackBuild.diff
then run the build script as usual:

Code:
./virtualbox-kernel.SlackBuild
Have a nice day!

Quick question ...

should there not be an # endif line in the patch to close the +# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 168) line ?

And a heads up:

I referenced your patch on this bugzilla thread: https://bugzilla.kernel.org/show_bug.cgi?id=202365

-- kjh
 
Old 02-01-2019, 10:13 AM   #9
phenixia2003
Member
 
Registered: May 2006
Location: France
Distribution: Slackware
Posts: 845

Rep: Reputation: 712Reputation: 712Reputation: 712Reputation: 712Reputation: 712Reputation: 712Reputation: 712
Hello,

Quote:
Originally Posted by kjhambrick View Post
Quick question ...

should there not be an # endif line in the patch to close the +# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 168) line ?
No, because the #endif is already in the source file (memobj-r0drv-linux.c). The patch only includes the changes and some (default to 3) lines before and after the context. Guess that the "# endif" would be visible (in the lines after the context) in the patch if "diff" was run with --context=10.

--
SeB
 
Old 02-01-2019, 10:20 AM   #10
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 14.2 + Multilib
Posts: 1,477

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Thanks SeB !

I missed that -# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0) was replaced by +# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 168)

-- kjh

Last edited by kjhambrick; 02-01-2019 at 10:21 AM.
 
Old 02-01-2019, 10:27 AM   #11
cesarion76
Member
 
Registered: Nov 2009
Location: Rosario, Argentina
Distribution: Slackware
Posts: 55

Rep: Reputation: 3
Hi this worked with latest Oracle binary distribution and kernel 4.4.172

https://slackblogs.blogspot.com/2019...plication.html

PS: Edited to not create confusion. Thanks @willysr

Last edited by cesarion76; 02-01-2019 at 12:55 PM.
 
2 members found this post helpful.
Old 02-01-2019, 11:08 AM   #12
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 3,934

Rep: Reputation: 1185Reputation: 1185Reputation: 1185Reputation: 1185Reputation: 1185Reputation: 1185Reputation: 1185Reputation: 1185Reputation: 1185
it was for binary distribution, not from source compilation
 
3 members found this post helpful.
Old 02-03-2019, 04:54 PM   #13
bormant
Member
 
Registered: Jan 2008
Posts: 321

Rep: Reputation: 181Reputation: 181
Since 4.4.168+ breaks LTS API maybe it is good time to go to 4.14.x (or at least 4.9.x).
 
Old 02-03-2019, 07:41 PM   #14
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 3,934

Rep: Reputation: 1185Reputation: 1185Reputation: 1185Reputation: 1185Reputation: 1185Reputation: 1185Reputation: 1185Reputation: 1185Reputation: 1185
There's no way kernel gets upgraded in -stable for major version.
 
1 members found this post helpful.
Old 02-04-2019, 02:51 AM   #15
bormant
Member
 
Registered: Jan 2008
Posts: 321

Rep: Reputation: 181Reputation: 181
Quote:
There's no way kernel gets upgraded in -stable for major version.
willysr,
it has been upgraded to version with changed API. De facto minor or major kernel version have to be changed for those istead of patchlevel increment in 4.4.168+. While 4.4.172 has 4.4 version, 3rd party software uses conditional compile paths for 4.9 to conform "new 4.4" API now.
And when breaking changes is already here why not to use 4.9 or 4.14 -- for those 3rd party software knows about those API and conditional compile paths.
And if numbers is the only true target not content may be 4.14 kernel in testing/ is a good enough for now.

Code:
( cd /var/log/packages ; ls kernel-* )
kernel-generic-4.14.97-x86_64-1  kernel-headers-4.4.172-x86-1  kernel-modules-4.14.97-x86_64-1

Last edited by bormant; 02-04-2019 at 03:48 AM.
 
  


Reply

Tags
kernel, virtualbox


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Kernel 4.4.172 on Slack64 and Nvidia camorri Slackware 45 02-19-2019 07:44 PM
RSA host key for 172.17.5.60 has changed ssharma_02 Red Hat 3 11-15-2006 10:55 AM
Read Error from 172.21.1.2 aarajthomas Linux - General 0 02-23-2006 11:02 PM
172.28.196.5 sent an invalid ICMP error teddy_t3 Linux - Networking 1 06-14-2004 05:39 PM
wdb Error: Can't open display: 172.16.1.28:0 murugesan Linux - Networking 4 02-19-2004 05:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration