modindex: getopt_long returns int not char (fix ppc64 bug)
[mit.git] / tests / test-modprobe / 22recursiveinstall.sh
blob0c98e1a43aed31a86bc800a325a853cc729b5551
1 #! /bin/sh
3 BITNESS=32
5 rm -rf tests/tmp/*
7 # Create inputs
8 MODULE_DIR=tests/tmp/lib/modules/$MODTEST_UNAME
9 mkdir -p $MODULE_DIR
10 ln tests/data/$BITNESS/normal/export_nodep-$BITNESS.ko \
11 tests/data/$BITNESS/normal/noexport_dep-$BITNESS.ko \
12 $MODULE_DIR
14 # Now create modules.dep
15 cat > $MODULE_DIR/modules.dep <<EOF
16 noexport_dep-$BITNESS.ko: export_nodep-$BITNESS.ko
17 export_nodep-$BITNESS.ko:
18 EOF
20 # Insertion
21 SIZE_EXPORT_NODEP=`wc -c < tests/data/$BITNESS/normal/export_nodep-$BITNESS.ko`
22 SIZE_NOEXPORT_DEP=`wc -c < tests/data/$BITNESS/normal/noexport_dep-$BITNESS.ko`
24 # Empty /sys/module/
25 mkdir -p tests/tmp/sys/module
27 # Check it pulls in both.
28 [ "`modprobe noexport_dep-$BITNESS 2>&1`" = "INIT_MODULE: $SIZE_EXPORT_NODEP
29 INIT_MODULE: $SIZE_NOEXPORT_DEP " ]
31 # Check it's happy if we tell it dep is already instealled
32 mkdir -p tests/tmp/sys/module
33 mkdir -p tests/tmp/sys/module/export_nodep_$BITNESS
34 echo "live" >tests/tmp/sys/module/export_nodep_$BITNESS/initstate
36 [ "`modprobe noexport_dep-$BITNESS 2>&1`" = "INIT_MODULE: $SIZE_NOEXPORT_DEP " ]
38 # If there's an install command, it will be done.
39 # Clean up sysfs (so we don't think it's loaded)
40 rm -rf tests/tmp/sys
42 mkdir -p tests/tmp/etc/modprobe.d
43 echo "install export_nodep-$BITNESS COMMAND" > tests/tmp/etc/modprobe.d/modprobe.conf
44 [ "`modprobe noexport_dep-$BITNESS 2>&1`" = "SYSTEM: COMMAND
45 INIT_MODULE: $SIZE_NOEXPORT_DEP " ]
47 # If it's in /sys/module, install command WONT be done.
48 mkdir -p tests/tmp/sys/module
49 mkdir -p tests/tmp/sys/module/export_nodep_$BITNESS
50 echo "live" >tests/tmp/sys/module/export_nodep_$BITNESS/initstate
52 [ "`modprobe noexport_dep-$BITNESS 2>&1`" = "INIT_MODULE: $SIZE_NOEXPORT_DEP " ]
54 # Do dependencies even if install command.
55 # clean up sysfs (so we don't think it's loaded)
56 rm -rf tests/tmp/sys
58 echo "install noexport_dep-$BITNESS COMMAND" > tests/tmp/etc/modprobe.d/modprobe.conf
60 [ "`modprobe noexport_dep-$BITNESS 2>&1`" = "INIT_MODULE: $SIZE_EXPORT_NODEP
61 SYSTEM: COMMAND" ]