summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfram Schlich <wschlich@gentoo.org>2008-12-01 16:12:41 +0000
committerWolfram Schlich <wschlich@gentoo.org>2008-12-01 16:12:41 +0000
commit30d6aba71cb5285940f0f7ca998e00d4c099a99b (patch)
tree6bbf61c8450e1778d706f6d947ed0f68b62483a6 /sys-block/megamgr/files
parentadd support for newer kernels (see bug #233295) (diff)
downloadgentoo-2-30d6aba71cb5285940f0f7ca998e00d4c099a99b.tar.gz
gentoo-2-30d6aba71cb5285940f0f7ca998e00d4c099a99b.tar.bz2
gentoo-2-30d6aba71cb5285940f0f7ca998e00d4c099a99b.zip
add support for newer kernels (see bug #233295)
(Portage version: 2.2_rc13/cvs/Linux 2.6.24-gentoo-r5-1 i686)
Diffstat (limited to 'sys-block/megamgr/files')
-rwxr-xr-xsys-block/megamgr/files/megamgr-r124
1 files changed, 24 insertions, 0 deletions
diff --git a/sys-block/megamgr/files/megamgr-r1 b/sys-block/megamgr/files/megamgr-r1
new file mode 100755
index 000000000000..37b129a6dbd2
--- /dev/null
+++ b/sys-block/megamgr/files/megamgr-r1
@@ -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 megamgr binary
+"${0%/*}/megamgr.bin" "${@}"