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 497c3e7

Browse files
Additions: Linux: Fix check if kernel module is loaded for old guest which do not utilize sysfs.
svn:sync-xref-src-repo-rev: r171080
1 parent 4f159c3 commit 497c3e7

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

‎src/VBox/Additions/linux/installer/vboxadd.sh‎

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#! /bin/sh
2-
# $Id: vboxadd.sh 110684 2025-08-11 17:18:47Z klaus.espenlaub@oracle.com $
2+
# $Id: vboxadd.sh 111518 2025-10-29 15:18:27Z vadim.galitsyn@oracle.com $
33
## @file
4-
# Linux Additions kernel module init script ($Revision: 110684 $)
4+
# Linux Additions kernel module init script ($Revision: 111518 $)
55
#
66

77
#
@@ -176,7 +176,11 @@ VBOX_REVISION="r`"$VBOXCONTROL" --version | cut -d r -f2`"
176176
running_module()
177177
{
178178
mod="1ドル"
179-
[ -d "/sys/module/$mod" ]
179+
if [ -d "/sys/module" ]; then
180+
[ -d "/sys/module/$mod" ]
181+
else
182+
lsmod | grep "$mod" >/dev/null 2>&1
183+
fi
180184
}
181185

182186
# Returns the version string of a currently running kernel module.
@@ -205,12 +209,19 @@ running_module_version()
205209
check_running_module_version()
206210
{
207211
mod=1ドル
208-
expected="$VBOX_VERSION $VBOX_REVISION"
209212

210-
[ -n "$mod" ] || return
211-
[ -n "$expected" ] || return
213+
if [ -d "/sys/module" ]; then
214+
215+
expected="$VBOX_VERSION $VBOX_REVISION"
216+
217+
[ -n "$mod" ] || return
218+
[ -n "$expected" ] || return
212219

213-
[ "$expected" = "$(running_module_version "$mod")" ] || return
220+
[ "$expected" = "$(running_module_version "$mod")" ] || return
221+
222+
else
223+
running_module "$mod"
224+
fi
214225
}
215226

216227
do_vboxguest_non_udev()

0 commit comments

Comments
(0)

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