modprobe,depmod: deprecate "include", sort config files, warn if they miss .conf
[mit.git] / tests / test-modprobe / 27cmdline-install-remove.sh
blobfadaa28378eb0c8378dcb2313fc84e4ac1d06148
1 #! /bin/sh
3 BITNESS=32
5 rm -rf tests/tmp/*
7 MODULE_DIR=tests/tmp/lib/modules/$MODTEST_UNAME
8 mkdir -p $MODULE_DIR
9 ln tests/data/$BITNESS/normal/noexport_nodep-$BITNESS.ko \
10 $MODULE_DIR
12 # Set up modules.dep file.
13 echo "# A comment" > $MODULE_DIR/modules.dep
14 echo "/lib/modules/$MODTEST_UNAME/noexport_nodep-$BITNESS.ko:" >> $MODULE_DIR/modules.dep
16 # Set up modprobe.conf file: one at end, one with text either side.
17 mkdir -p tests/tmp/etc/modprobe.d
18 echo "options noexport_nodep-$BITNESS file-options" > tests/tmp/etc/modprobe.d/modprobe.conf
19 echo "install noexport_nodep-$BITNESS modprobe --ignore-install noexport_nodep-$BITNESS \$CMDLINE_OPTS" >> tests/tmp/etc/modprobe.d/modprobe.conf
20 echo "install othertarget echo \$CMDLINE_OPTS otheropts" >> tests/tmp/etc/modprobe.d/modprobe.conf
22 # With quoted args
23 [ "`./modprobe noexport_nodep-$BITNESS 'foo="bar baz"' 2>&1`" = "SYSTEM: modprobe --ignore-install noexport_nodep-$BITNESS foo=\"bar baz\"" ]
24 # With unquoted args
25 [ "`./modprobe noexport_nodep-$BITNESS foo=\"bar baz\" 2>&1`" = "SYSTEM: modprobe --ignore-install noexport_nodep-$BITNESS foo=\"bar baz\"" ]
27 # Same with other target.
28 [ "`./modprobe othertarget 'foo="bar baz"' 2>&1`" = "SYSTEM: echo foo=\"bar baz\" otheropts" ]
29 # With unquoted args
30 [ "`./modprobe othertarget foo=\"bar baz\" 2>&1`" = "SYSTEM: echo foo=\"bar baz\" otheropts" ]