diff options
Diffstat (limited to 'sys-block/dellmgr/files/dellmgr-r1')
-rwxr-xr-x | sys-block/dellmgr/files/dellmgr-r1 | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sys-block/dellmgr/files/dellmgr-r1 b/sys-block/dellmgr/files/dellmgr-r1 new file mode 100755 index 000000000000..6857bc221823 --- /dev/null +++ b/sys-block/dellmgr/files/dellmgr-r1 @@ -0,0 +1,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" "${@}" |