summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAnssi Hannula <anssi@mageia.org>2012-04-05 02:49:39 +0000
committerAnssi Hannula <anssi@mageia.org>2012-04-05 02:49:39 +0000
commit904fa5196c05a4ec59f4bc29ed1246e7409498f0 (patch)
tree38fda7077e576b745df5833cec94845bac2a8f0e /tools
parent9ef0abf9ef2baa444a481422ddeec037c7c819ba (diff)
downloaddrakx-kbd-mouse-x11-904fa5196c05a4ec59f4bc29ed1246e7409498f0.tar
drakx-kbd-mouse-x11-904fa5196c05a4ec59f4bc29ed1246e7409498f0.tar.gz
drakx-kbd-mouse-x11-904fa5196c05a4ec59f4bc29ed1246e7409498f0.tar.bz2
drakx-kbd-mouse-x11-904fa5196c05a4ec59f4bc29ed1246e7409498f0.tar.xz
drakx-kbd-mouse-x11-904fa5196c05a4ec59f4bc29ed1246e7409498f0.zip
display_driver_helper: factor get_hw_display_modaliases out of get_active_kms_drivers
Diffstat (limited to 'tools')
-rw-r--r--tools/display_driver_helper11
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/display_driver_helper b/tools/display_driver_helper
index 5fb6c74..7fe63c5 100644
--- a/tools/display_driver_helper
+++ b/tools/display_driver_helper
@@ -340,13 +340,18 @@ get_initrd_kms_drivers() {
zcat "$initrd" | cpio -t --quiet | sed -nr "s,.*/($kms_drivers)\.ko.*$,\1,p"
}
-get_active_kms_drivers() {
- local kms_drivers=
+get_hw_display_modaliases() {
for device in $(grep -l 0x03 /sys/bus/pci/devices/0000\:0*/class); do
[ -e "$device" ] || continue
device="$(dirname $device)"
[ -f "$device/modalias" ] || continue
- modalias="$(cat "$device/modalias")"
+ cat "$device/modalias"
+ done
+}
+
+get_active_kms_drivers() {
+ local kms_drivers=
+ for modalias in $(get_hw_display_modaliases); do
for modulename in $(/sbin/modprobe -Rq "$modalias"); do
IS_KMS=
check_driver "$modulename" "$modalias" || continue