Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # set aoe to autoload by installing the |
Lucas De Marchi | 970e248 | 2012-03-30 13:37:16 -0700 | [diff] [blame] | 3 | # aliases in /etc/modprobe.d/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | |
Lucas De Marchi | 970e248 | 2012-03-30 13:37:16 -0700 | [diff] [blame] | 5 | f=/etc/modprobe.d/aoe.conf |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | |
| 7 | if test ! -r $f || test ! -w $f; then |
| 8 | echo "cannot configure $f for module autoloading" 1>&2 |
| 9 | exit 1 |
| 10 | fi |
| 11 | |
| 12 | grep major-152 $f >/dev/null |
| 13 | if [ $? = 1 ]; then |
| 14 | echo alias block-major-152 aoe >> $f |
| 15 | echo alias char-major-152 aoe >> $f |
| 16 | fi |
| 17 | |