diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-block/dellmgr/files |
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-block/dellmgr/files')
-rw-r--r-- | sys-block/dellmgr/files/dellmgr-r2 | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sys-block/dellmgr/files/dellmgr-r2 b/sys-block/dellmgr/files/dellmgr-r2 new file mode 100644 index 000000000000..907a1168e37f --- /dev/null +++ b/sys-block/dellmgr/files/dellmgr-r2 @@ -0,0 +1,24 @@ +#!/bin/sh + +# Get the major number of the megadev ioctl device node +megadev_major=$(egrep '[[:space:]]megadev(_legacy)?$' /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" "${@}" |