3 # module-load-test: Try to load all the available modules in the
4 # system. This will surely crash the kernel.
6 # Luiz Fernando N. Capitulino
7 # <lcapitulino@gmail.com>
9 DMESG_BEFORE_LOAD
=dmesg-before-load.txt
10 DMESG_AFTER_LOAD
=dmesg-after-module-load.txt
11 DMESG_AFTER
=dmesg-after-unload.txt
12 LOAD_ERRORS
=load-errors.txt
13 MODULE_LIST
=modules.txt
14 MODULES_DIR
=/lib
/modules
/$
(uname
-r)/kernel
22 echo "-> loading modules"
24 for mod
in $modules; do
26 modprobe
$mod 2> $LOAD_ERRORS
30 echo "-> loaded $count modules"
42 for file in $
(find $MODULES_DIR -iname '*.ko.gz'); do
43 module
=$
(basename $file |
sed 's/\.ko\.gz//')
44 echo $module >> $MODULE_LIST
45 MODULES
="$MODULES $module"
49 get_dmesg
$DMESG_BEFORE_LOAD
50 load_modules
"$MODULES"
51 get_dmesg
$DMESG_AFTER_LOAD
53 # FIXME: Write unload part