| 1 | #!/bin/sh |
| 2 | # This script should be run before building the package every time a new |
| 3 | # kernel is released. |
| 4 | # |
| 5 | # You should pass the name of the modules directory for a 486 flavour |
| 6 | # kernel, as that has the most framebuffer modules. |
| 7 | # |
| 8 | # Also, obsolete modules should not be removed from the list until after |
| 9 | # at least one stable release. |
| 10 | |
| 11 | set -e |
| 12 | |
| 13 | if [ $# = 0 ]; then |
| 14 | MODULES_DIR=/lib/modules/$(uname -r) |
| 15 | else |
| 16 | MODULES_DIR="$1" |
| 17 | fi |
| 18 | |
| 19 | BL='fbdev-blacklist.conf' |
| 20 | |
| 21 | if [ -e extra/$BL ]; then cd extra; fi |
| 22 | |
| 23 | { |
| 24 | printf "# This file blacklists most old-style PCI framebuffer drivers.\n\n" |
| 25 | |
| 26 | find "$MODULES_DIR"/kernel/drivers/video -type f | sort | \ |
| 27 | while read file; do |
| 28 | name="$(basename $file .ko)" |
| 29 | case $name in |
| 30 | lxfb) |
| 31 | # This is needed for text consoles on OLPC XO-1, and it used to be |
| 32 | # built-in anyway. |
| 33 | ;; |
| 34 | viafb) |
| 35 | # Needed by OLPC XO-1.5. |
| 36 | ;; |
| 37 | hyperv_fb) |
| 38 | # Needed for graphical support on Hyper-V platforms, see LP: #1359933. |
| 39 | ;; |
| 40 | *) |
| 41 | /sbin/modinfo $file | grep -q '^alias: *pci:' \ |
| 42 | && echo blacklist $name || true |
| 43 | ;; |
| 44 | esac |
| 45 | done |
| 46 | } > $BL.tmp |
| 47 | |
| 48 | if diff --unified=0 $BL $BL.tmp; then |
| 49 | rm $BL.tmp |
| 50 | else |
| 51 | printf "\n\n\n$BL.tmp has changes!\n\n\n\n" |
| 52 | fi |