2 # Test for blacklist usage.
9 MODULE_DIR
=tests
/tmp
/lib
/modules
/$MODTEST_UNAME
10 mkdir
-p $MODULE_DIR/kernel
11 ln tests
/data
/$BITNESS/alias
/alias-
$BITNESS.ko \
14 SIZE
=`wc -c < tests/data/$BITNESS/alias/alias-$BITNESS.ko`
16 echo "/lib/modules/$MODTEST_UNAME/kernel/alias-$BITNESS.ko:" > $MODULE_DIR/modules.dep
17 echo "/lib/modules/$MODTEST_UNAME/kernel/foo.ko:" >> $MODULE_DIR/modules.dep
18 cp tests
/data
/$BITNESS/complex
/complex_a-
$BITNESS.ko
$MODULE_DIR/kernel
/foo.ko
19 SIZE2
=`wc -c < $MODULE_DIR/kernel/foo.ko`
21 # First, alias found in modules.alias works.
22 echo "alias bar alias-$BITNESS" > $MODULE_DIR/modules.
alias
23 [ "`modprobe bar 2>&1`" = "INIT_MODULE: $SIZE " ]
25 # Blacklist makes it fail.
26 mkdir
-p tests
/tmp
/etc
/modprobe.d
27 echo "blacklist alias-$BITNESS" > tests
/tmp
/etc
/modprobe.d
/modprobe.conf
28 [ "`modprobe bar 2>&1`" = "FATAL: Module bar not found." ]
30 # Blacklist doesn't effect other aliases.
31 echo "alias bar foo" >> $MODULE_DIR/modules.
alias
32 [ "`modprobe bar 2>&1`" = "INIT_MODULE: $SIZE2 " ]
35 echo "blacklist foo" >> tests
/tmp
/etc
/modprobe.d
/modprobe.conf
36 [ "`modprobe bar 2>&1`" = "FATAL: Module bar not found." ]
38 # Remove blacklist, all works.
39 rm -f tests
/tmp
/etc
/modprobe.d
/modprobe.conf
40 RESULT
="`modprobe bar 2>&1`"
41 [ "$RESULT" = "INIT_MODULE: $SIZE
42 INIT_MODULE: $SIZE2 " ] ||
[ "$RESULT" = "INIT_MODULE: $SIZE2
43 INIT_MODULE: $SIZE " ]