blob: 6857bc22182343f5da818baa21e745356605e5a8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#!/bin/sh
# Get the major number of the megadev ioctl device node
megadev_major=$(egrep '[[:space:]]megadev$' /proc/devices 2>/dev/null | awk '{print $1}' 2>/dev/null)
megadev_node=/dev/megadev0
# MegaRAID device node major number found
if [ -z "${megadev_major}" ]; then
echo "ERROR: failed to determine device node major number"
exit 1
fi
if [ -e "${megadev_node}" ]; then
if ! rm -f "${megadev_node}"; then
echo "ERROR: failed to remove existing device node ${megadev_node}"
exit 1
fi
fi
if ! mknod "${megadev_node}" c "${megadev_major}" 0; then
echo "ERROR: failed to create device node ${megadev_node}"
exit 1
fi
# Start the real dellmgr binary
"${0##*/}/dellmgr.bin" "${@}"
|