xref: /openbmc/linux/Documentation/admin-guide/aoe/autoload.sh (revision 0898782247ae533d1f4e47a06bc5d4870931b284)
1*83bbf6e1SMauro Carvalho Chehab#!/bin/sh
2*83bbf6e1SMauro Carvalho Chehab# set aoe to autoload by installing the
3*83bbf6e1SMauro Carvalho Chehab# aliases in /etc/modprobe.d/
4*83bbf6e1SMauro Carvalho Chehab
5*83bbf6e1SMauro Carvalho Chehabf=/etc/modprobe.d/aoe.conf
6*83bbf6e1SMauro Carvalho Chehab
7*83bbf6e1SMauro Carvalho Chehabif test ! -r $f || test ! -w $f; then
8*83bbf6e1SMauro Carvalho Chehab	echo "cannot configure $f for module autoloading" 1>&2
9*83bbf6e1SMauro Carvalho Chehab	exit 1
10*83bbf6e1SMauro Carvalho Chehabfi
11*83bbf6e1SMauro Carvalho Chehab
12*83bbf6e1SMauro Carvalho Chehabgrep major-152 $f >/dev/null
13*83bbf6e1SMauro Carvalho Chehabif [ $? = 1 ]; then
14*83bbf6e1SMauro Carvalho Chehab	echo alias block-major-152 aoe >> $f
15*83bbf6e1SMauro Carvalho Chehab	echo alias char-major-152 aoe >> $f
16*83bbf6e1SMauro Carvalho Chehabfi
17*83bbf6e1SMauro Carvalho Chehab
18