make-fbdev-blacklist 1.07 KB
Newer Older
1
2
3
#!/bin/sh
# This script should be run before building the package every time a new
# kernel is released.
4
5
6
7
8
9
#
# You should pass the name of the modules directory for a 486 flavour
# kernel, as that has the most framebuffer modules.
#
# Also, obsolete modules should not be removed from the list until after
# at least one stable release.
10
11
12

set -e

13
14
15
16
17
18
if [ $# = 0 ]; then
  MODULES_DIR=/lib/modules/$(uname -r)
else
  MODULES_DIR="$1"
fi

19
20
21
22
23
BL='fbdev-blacklist.conf'

if [ -e extra/$BL ]; then cd extra; fi

{
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
29
30
31
32
33
  name="$(basename $file .ko)"
  case $name in
    lxfb)
      # This is needed for text consoles on OLPC XO-1, and it used to be
      # built-in anyway.
      ;;
Marco d'Itri's avatar
Marco d'Itri committed
34
    viafb) ;; # Needed by OLPC XO-1.5
35
36
37
38
39
    *)
      /sbin/modinfo $file | grep -q '^alias: *pci:' \
	&& echo blacklist $name || true
      ;;
  esac
40
41
42
43
44
45
46
47
48
done
} > $BL.tmp

if diff --unified=0 $BL $BL.tmp; then
  rm $BL.tmp
else
  printf "\n\n\n$BL.tmp has changes!\n\n\n\n"
fi