Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e0b70af

Browse files
Linux: Disable modules loading: Fix for kernels older than 2.5.52, bugref:8409.
svn:sync-xref-src-repo-rev: r171050
1 parent 5d1cbf5 commit e0b70af

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

‎include/VBox/VBoxLnxModInline.h‎

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $Id: VBoxLnxModInline.h 110684 2025-08-11 17:18:47Z klaus.espenlaub@oracle.com $ */
1+
/* $Id: VBoxLnxModInline.h 111490 2025-10-24 12:40:53Z vadim.galitsyn@oracle.com $ */
22
/** @file
33
* A common code for VirtualBox Linux kernel modules.
44
*/
@@ -37,11 +37,25 @@
3737
# include <linux/module.h>
3838
# include <linux/types.h>
3939

40+
# if RTLNX_VER_MIN(2,5,52)
41+
4042
/** Disable automatic module loading. */
43+
# define VBOX_MOD_DISABLED g_fDisabled
44+
# define VBOX_MOD_NAME module_name(THIS_MODULE)
4145
static int g_fDisabled = -1;
42-
MODULE_PARM_DESC(disabled, "Disable automatic module loading");
4346
module_param_named(disabled, g_fDisabled, int, 0400);
4447

48+
# else /* < 2.5.52 */
49+
50+
# define VBOX_MOD_DISABLED disabled
51+
# define VBOX_MOD_NAME THIS_MODULE->name
52+
static int disabled = -1;
53+
MODULE_PARM(disabled, "i");
54+
55+
# endif
56+
57+
MODULE_PARM_DESC(disabled, "Disable automatic module loading");
58+
4559
/**
4660
* Check if module loading was explicitly disabled.
4761
*
@@ -52,12 +66,11 @@ module_param_named(disabled, g_fDisabled, int, 0400);
5266
*/
5367
static inline bool vbox_mod_should_load(void)
5468
{
55-
bool fShouldLoad = (g_fDisabled != 1);
69+
bool fShouldLoad = (VBOX_MOD_DISABLED != 1);
5670

5771
/* Print message into dmesg log if module loading was disabled. */
5872
if (!fShouldLoad)
59-
printk(KERN_WARNING "%s: automatic module loading disabled in kernel command line\n",
60-
module_name(THIS_MODULE));
73+
printk(KERN_WARNING "%s: automatic module loading disabled in kernel command line\n", VBOX_MOD_NAME);
6174

6275
return fShouldLoad;
6376
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /