301 |
zcat "$initrd" | cpio -t --quiet | sed -nr "s,.*/($kms_drivers)\.ko.*$,\1,p" |
zcat "$initrd" | cpio -t --quiet | sed -nr "s,.*/($kms_drivers)\.ko.*$,\1,p" |
302 |
} |
} |
303 |
|
|
|
# Check that the initrd doesn't contain disabled modules |
|
|
check_initrd() { |
|
|
local initrd="$1" |
|
|
local initrd_drivers="$(get_initrd_kms_drivers "$initrd")" |
|
|
for driver in $initrd_drivers; do |
|
|
check_driver "$driver" || return 1 |
|
|
done |
|
|
for driver2 in $(get_active_kms_drivers); do |
|
|
for driver in $initrd_drivers; do |
|
|
[ "$driver" = "$driver2" ] && continue 2 |
|
|
done |
|
|
# An enabled module for present hardware was not in initrd |
|
|
return 1 |
|
|
done |
|
|
return 0 |
|
|
} |
|
|
|
|
304 |
get_active_kms_drivers() { |
get_active_kms_drivers() { |
305 |
local kms_drivers= |
local kms_drivers= |
306 |
for device in $(grep -l 0x03 /sys/bus/pci/devices/0000\:0*/class); do |
for device in $(grep -l 0x03 /sys/bus/pci/devices/0000\:0*/class); do |
370 |
As --check-loaded, and consider ambiguous cases (e.g. nvidia where |
As --check-loaded, and consider ambiguous cases (e.g. nvidia where |
371 |
we can't detect if the loaded driver has the correct version) as |
we can't detect if the loaded driver has the correct version) as |
372 |
failure. |
failure. |
|
|
|
|
--check-initrd INITRD |
|
|
Check that INITRD doesn't contain disabled KMS drivers. |
|
373 |
EOF |
EOF |
374 |
} |
} |
375 |
|
|
433 |
--get-initrd-kms-drivers) |
--get-initrd-kms-drivers) |
434 |
get_initrd_kms_drivers "$2" |
get_initrd_kms_drivers "$2" |
435 |
;; |
;; |
|
--check-initrd) |
|
|
check_initrd "$2" |
|
|
;; |
|
436 |
--check-loaded) |
--check-loaded) |
437 |
check_loaded |
check_loaded |
438 |
;; |
;; |