summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnssi Hannula <anssi@mageia.org>2011-12-02 21:32:31 +0000
committerAnssi Hannula <anssi@mageia.org>2011-12-02 21:32:31 +0000
commitdbdf6b34e7bfa52f61835af2326fbb05ff88c8cf (patch)
treebb078cf7308ae2c9bd8e56dbcb56b125d3dc51e3
parent986723d0a8d0baffa98051475d66aa8586350c58 (diff)
downloaddrakx-kbd-mouse-x11-dbdf6b34e7bfa52f61835af2326fbb05ff88c8cf.tar
drakx-kbd-mouse-x11-dbdf6b34e7bfa52f61835af2326fbb05ff88c8cf.tar.gz
drakx-kbd-mouse-x11-dbdf6b34e7bfa52f61835af2326fbb05ff88c8cf.tar.bz2
drakx-kbd-mouse-x11-dbdf6b34e7bfa52f61835af2326fbb05ff88c8cf.tar.xz
drakx-kbd-mouse-x11-dbdf6b34e7bfa52f61835af2326fbb05ff88c8cf.zip
display_driver_helper: use modprobe --resolve-alias
Adapt display_driver_helper to use the new modprobe --resolve-alias instead of manually parsing --dry-run --verbose output.
-rw-r--r--NEWS3
-rw-r--r--tools/display_driver_helper14
2 files changed, 5 insertions, 12 deletions
diff --git a/NEWS b/NEWS
index f2a527c..77488ef 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+- display_driver_helper: use the new modprobe --resolve-alias instead
+ of manually parsing --dry-run output
+
Version 0.98 - 07 November 2011
- display_driver_helper: allow automatic loading of the implicit driver
on systems without xorg.conf if the presence of other files indicates
diff --git a/tools/display_driver_helper b/tools/display_driver_helper
index 3285bfd..bcf9e91 100644
--- a/tools/display_driver_helper
+++ b/tools/display_driver_helper
@@ -249,15 +249,7 @@ load_driver() {
local modulename
local load_default=1
- # NOTE: UPDATE when module-init-tools is upgraded to get better performance
- # modprobe has -R option:
- #for modulename in $(/home/anssi/module-init-tools-3.12/build/modprobe -Rq "$1"); do
- # modprobe does not have -R option:
- for mod in $(/sbin/modprobe -biqvn "$1"); do
- [ "$mod" = "insmod" ] && continue
- modulename="${mod##*/}"
- modulename="${modulename%%.*}"
-
+ for modulename in $(/sbin/modprobe -Rq "$1"); do
check_driver "$modulename"
case $? in
1) # a driver which needs handling by this script matches
@@ -327,9 +319,7 @@ get_active_kms_drivers() {
device="$(dirname $device)"
[ -f "$device/modalias" ] || continue
modalias="$(cat "$device/modalias")"
- for mod in $(/sbin/modprobe --first-time -biqvn "$modalias" 2>&1); do
- modulename="${mod##*/}"
- modulename="${modulename%%.*}"
+ for modulename in $(/sbin/modprobe -Rq "$modalias"); do
IS_KMS=
check_driver "$modulename" || continue
[ -n "$IS_KMS" ] && echo $modulename