Permalink
Browse files

BUG: fix megacli 3.x kernel bugs, bump to 8.03.x, LSI needs to be mor…

…e agile, c'mon!
  • Loading branch information...
1 parent ff84626 commit 4a21b378234399fbd1e5c63dc038ea9875945336 @npinto committed Apr 25, 2012
View
5 sys-block/megacli/Manifest
@@ -1,7 +1,12 @@
+AUX fake-uname.c 437 RMD160 40b161ea51fcdaace5a1ae92b60024a619efbe78 SHA1 893a90adc769eb229f4b8e4d8823448a7a1bd05d SHA256 7e94c7375779fe9ad72692089c0e1e9a17055fafb9e3507e3da0b7d5efbbab47
AUX megacli-wrapper 102 RMD160 9135417a5df236c8bb6c40315e3d8fe036eca840 SHA1 f4f544e8c05b7edec122b3243fb8cb695a3b876f SHA256 af558f357388c8b47d2c2f70e188eb7f6092c557dca13170d35a9279e258944d
+AUX megacli-wrapper-fake-uname 154 RMD160 1fbf072d06f79301deb245197d04e0c8f906e98d SHA1 368254bee90f13ae8a7ec41eaa1764e46c88bb7e SHA256 69e51b302427dd554357fdd63d3321dce55bdb5005a5df78bd8b4a9d55767648
DIST 8.02.16_MegaCLI.zip 12244704 RMD160 c2db3a37721600f15224ec37f978511e0a76d675 SHA1 8f053a6101b2930d59b8ba72202aad4e62af7a47 SHA256 e22b615f6a10e4c305e65434153f8e15e779a2e245c08116ce5eca840c183d66
DIST 8.02.21_MegaCLI.zip 12939353 RMD160 704a8a9e1e049c2b5b1315d6b7034d81697fe47b SHA1 08cd8a10bceb8b1fdacc8bc54e259d8e1e27ae41 SHA256 e5fdaff341b3cd8c3b5bbe334f5e819f9eb167e141337ce92a47a73c3fd7ac0b
+DIST 8.03.08_MegaCLI.zip 2864409 RMD160 8c65674f64c33c616753a501cc9c4124bb79840f SHA1 8fbbb2ba3a5ec4fffb56daa3f35b2c66faea5b5d SHA256 9f8b9621ae0be97dc06791ca0b7faf0f4c2f5c3e002fde026d79c51e5de8fb6c
EBUILD megacli-8.02.16.ebuild 2166 RMD160 2fbe1b2c12d7a2854c0399a2e7766a7cfe279ee2 SHA1 d9b13ba5848dfe630d00158f55cde7204c6b0f8d SHA256 ab05b2be21b8267e2f880b05222749462fd786d844c4d2b7acc38bf648cb3799
+EBUILD megacli-8.02.21-r1.ebuild 2043 RMD160 e2b18b49c110d3588fd8ef07541b4193720009da SHA1 4ad463b718f0f53c5d39e4de39d3b8b3533fbbd5 SHA256 d2429d1170666908bbbcf306a001ed0aac91392c946e1185bcd085f10a7b580d
EBUILD megacli-8.02.21.ebuild 1857 RMD160 6f0f7301af97ddc1205b6a503222f46d9fe6b982 SHA1 4d5b3c2b62ae1a4460bdf36a93227f6fb6776ca9 SHA256 d44f6d5bd684da887703e6c4f9633dc7a91e87c2ae3ab9a77d64a61676ba4b07
+EBUILD megacli-8.03.08.ebuild 1856 RMD160 0fba6cb01cbdafa14aa5aa5be9c1b3034027523d SHA1 2df39082177ffdec19d6d522199303a773986bac SHA256 f43b566974869a2244815fd1f6af77cd3ffacc11388c9805b7ce429b80b80868
MISC ChangeLog 2417 RMD160 14e87ebeaf1f32b5d7eb7517e4f68f5fe76ff75f SHA1 43277aebe4b2bb8df22266e62a2252804619ffad SHA256 8f62940ee1fef62e4554932abcac147480158f1a7f7ad15373575538d8e01cfb
MISC metadata.xml 431 RMD160 1dc5a3f71b7eed24b64c6cf50dbdf6586d613526 SHA1 e31340fcbbed5bc34effe811dbfd519ca548f7c2 SHA256 0efa1b94d791f59e63f538c2048b9e82e3522ac6a2af6a17d1cd8209c468e7ea
View
22 sys-block/megacli/files/fake-uname.c
@@ -0,0 +1,22 @@
+#define _GNU_SOURCE
+#include <unistd.h>
+#include <sys/syscall.h>
+#include <sys/types.h>
+#include <sys/utsname.h>
+
+#include <stdio.h>
+#include <string.h>
+
+int uname(struct utsname *buf)
+{
+ int ret;
+
+ ret = syscall(SYS_uname, buf);
+
+ printf("uname release: \"%s\"\n", buf->release);
+ strcpy(buf->release, "2.6.40");
+ printf("uname release set to: \"%s\"\n", buf->release);
+ printf("uname version: \"%s\"\n", buf->version);
+
+ return ret;
+}
View
4 sys-block/megacli/files/megacli-wrapper-fake-uname
@@ -0,0 +1,4 @@
+#!/bin/sh
+export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/megacli/lib"
+export LD_PRELOAD=/opt/megacli/lib/libfake-uname.so
+exec /opt/megacli/megacli "$@"
View
79 sys-block/megacli/megacli-8.02.21-r1.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="4"
+
+inherit rpm
+
+DESCRIPTION="LSI Logic MegaRAID Command Line Interface management tool"
+HOMEPAGE="http://www.lsi.com/"
+SRC_URI="http://dl.dropbox.com/u/167753/lsi/${PV}_MegaCLI.zip"
+
+LICENSE="LSI"
+SLOT="0"
+# This package can never enter stable, it can't be mirrored and upstream
+# can remove the distfiles from their mirror anytime.
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="app-arch/unzip
+ app-admin/chrpath"
+
+S="${WORKDIR}"
+
+QA_PRESTRIPPED="/opt/megacli/megacli"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ unpack ./${PV}_Linux_MegaCLI/MegaCliLin.zip
+ rpm_unpack ./MegaCli-${PV}-1.noarch.rpm
+ rpm_unpack ./Lib_Utils-1.00-09.noarch.rpm
+}
+
+src_compile() {
+ # Fix 3.x kernel bug
+ gcc -Wall -fPIC -c ${FILESDIR}/fake-uname.c
+ gcc -Wall -shared -o libfake-uname.so fake-uname.o
+}
+
+src_install() {
+ exeinto /opt/megacli
+ libsysfs=libsysfs.so.2.0.2
+ case ${ARCH} in
+ amd64) MegaCli=MegaCli64 libsysfs=x86_64/${libsysfs};;
+ x86) MegaCli=MegaCli;;
+ *) die "invalid ARCH";;
+ esac
+ newexe opt/MegaRAID/MegaCli/${MegaCli} megacli
+
+ exeinto /opt/megacli/lib
+ doexe opt/lsi/3rdpartylibs/${libsysfs}
+ doexe "${WORKDIR}/libfake-uname.so"
+
+ into /opt
+ newbin "${FILESDIR}"/${PN}-wrapper-fake-uname ${PN}
+ dosym ${PN} /opt/bin/MegaCli
+
+ dodoc ${PV}_MegaCLI.txt
+
+ # Remove DT_RPATH
+ chrpath -d "${D}"/opt/megacli/megacli
+}
+
+pkg_postinst() {
+ einfo
+ einfo "See /usr/share/doc/${PF}/${PV}_MegaCli.txt for a list of supported controllers"
+ einfo "(contains LSI model names only, not those sold by 3rd parties"
+ einfo "under custom names like Dell PERC etc)."
+ einfo
+ einfo "As there's no dedicated manual, you might want to have"
+ einfo "a look at the following cheat sheet (originally written"
+ einfo "for Dell PowerEdge Expandable RAID Controllers):"
+ einfo "http://tools.rapidsoft.de/perc/perc-cheat-sheet.html"
+ einfo
+ einfo "For more information about working with Dell PERCs see:"
+ einfo "http://tools.rapidsoft.de/perc/"
+ einfo
+}
View
73 sys-block/megacli/megacli-8.03.08.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="4"
+
+inherit rpm
+
+DESCRIPTION="LSI Logic MegaRAID Command Line Interface management tool"
+HOMEPAGE="http://www.lsi.com/"
+SRC_URI="http://dl.dropbox.com/u/167753/lsi/${PV}_MegaCLI.zip"
+
+LICENSE="LSI"
+SLOT="0"
+# This package can never enter stable, it can't be mirrored and upstream
+# can remove the distfiles from their mirror anytime.
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="app-arch/unzip
+ app-admin/chrpath"
+
+S="${WORKDIR}"
+
+QA_PRESTRIPPED="/opt/megacli/megacli"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ unpack ./MegaCliLin.zip
+ rpm_unpack ./MegaCli-${PV}-1.noarch.rpm
+ rpm_unpack ./Lib_Utils-1.00-09.noarch.rpm
+}
+
+src_install() {
+ exeinto /opt/megacli
+ libsysfs=libsysfs.so.2.0.2
+ case ${ARCH} in
+ amd64) MegaCli=MegaCli64 libsysfs=x86_64/${libsysfs};;
+ x86) MegaCli=MegaCli;;
+ *) die "invalid ARCH";;
+ esac
+ newexe opt/MegaRAID/MegaCli/${MegaCli} megacli
+
+ exeinto /opt/megacli/lib
+ doexe opt/lsi/3rdpartylibs/${libsysfs}
+
+ into /opt
+ newbin "${FILESDIR}"/${PN}-wrapper ${PN}
+ dosym ${PN} /opt/bin/MegaCli
+
+ #dodoc ${PV}_MegaCLI.txt
+ dodoc readme.txt
+
+ # Remove DT_RPATH
+ chrpath -d "${D}"/opt/megacli/megacli
+}
+
+pkg_postinst() {
+ einfo
+ einfo "See /usr/share/doc/${PF}/${PV}_MegaCli.txt for a list of supported controllers"
+ einfo "(contains LSI model names only, not those sold by 3rd parties"
+ einfo "under custom names like Dell PERC etc)."
+ einfo
+ einfo "As there's no dedicated manual, you might want to have"
+ einfo "a look at the following cheat sheet (originally written"
+ einfo "for Dell PowerEdge Expandable RAID Controllers):"
+ einfo "http://tools.rapidsoft.de/perc/perc-cheat-sheet.html"
+ einfo
+ einfo "For more information about working with Dell PERCs see:"
+ einfo "http://tools.rapidsoft.de/perc/"
+ einfo
+}

0 comments on commit 4a21b37

Please sign in to comment.