From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Jul 28 15:10:01 2008 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A11C71065682 for ; Mon, 28 Jul 2008 15:10:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 6A0C18FC19 for ; Mon, 28 Jul 2008 15:10:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m6SFA16c004581 for ; Mon, 28 Jul 2008 15:10:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m6SFA10R004580; Mon, 28 Jul 2008 15:10:01 GMT (envelope-from gnats) Resent-Date: Mon, 28 Jul 2008 15:10:01 GMT Resent-Message-Id: <200807281510.m6SFA10R004580@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Bjoern A. Zeeb" Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34DEF106567B for ; Mon, 28 Jul 2008 15:05:46 +0000 (UTC) (envelope-from bz@zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [62.111.66.27]) by mx1.freebsd.org (Postfix) with ESMTP id 8209E8FC35 for ; Mon, 28 Jul 2008 15:05:45 +0000 (UTC) (envelope-from bz@zabbadoz.net) Received: from localhost (amavis.str.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 3F61041C798 for ; Mon, 28 Jul 2008 16:50:07 +0200 (CEST) Received: from mail.cksoft.de ([62.111.66.27]) by localhost (amavis.str.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id ndJmUGU4Z2HQ for ; Mon, 28 Jul 2008 16:50:05 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id A92B141C7A7; Mon, 28 Jul 2008 16:50:05 +0200 (CEST) Received: from storage.int.zabbadoz.net (storage.int.zabbadoz.net [10.111.66.189]) by mail.int.zabbadoz.net (Postfix) with ESMTP id 140B144487F; Mon, 28 Jul 2008 14:49:45 +0000 (UTC) Received: by storage.int.zabbadoz.net (Postfix, from userid 1060) id AC2A54899B8; Mon, 28 Jul 2008 14:49:45 +0000 (UTC) Message-Id: <20080728144945.AC2A54899B8@storage.int.zabbadoz.net> Date: Mon, 28 Jul 2008 14:49:45 +0000 (UTC) From: "Bjoern A. Zeeb" To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: "Bjoern A. Zeeb" Subject: ports/126040: update sysutils/linux-megacli X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: "Bjoern A. Zeeb" List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jul 2008 15:10:01 -0000 >Number: 126040 >Category: ports >Synopsis: update sysutils/linux-megacli >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Mon Jul 28 15:10:00 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Bjoern A. Zeeb >Release: FreeBSD 7.0-CURRENT amd64 >Organization: Zabbadoz.NeT >Environment: System: FreeBSD foo 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Sun Oct 30 18:31:51 UTC 2005 bz@foo:/path/to/HEAD/sys/KERNEL amd64 >Description: When trying to diagnose problems, vendors like Dell ask for the "TTY Log" so save that upon reboot. It should only be there after a "warm boot". After power cycling old contents should be gone unless special knobs turned, which you do not want unless you really need and they tell you to. In case you like debugging in daily mails you can even get daily diffs of the TTY log by turning on the switch in periodic.conf. Most people will not want to. You should make sure to have a well known good latest version of mfi(4) and the latest firmware. The rc.d script is enabled by default but you can turn it off in rc.conf if it gives trouble. I am not good on rc scripts so you may want to review;-) I'll hopefully add more information on mfi debugging to the wiki soon. >How-To-Repeat: >Fix: You can also (temporary) fetch the patch from http://people.freebsd.org/~bz/sysutils-linux-megacli-20080727-01.diff Index: sysutils/linux-megacli/Makefile =================================================================== RCS file: /local/mirror/FreeBSD/r/pcvs/ports/sysutils/linux-megacli/Makefile,v retrieving revision 1.7 diff -u -p -r1.7 Makefile --- sysutils/linux-megacli/Makefile 18 Jun 2008 13:02:45 -0000 1.7 +++ sysutils/linux-megacli/Makefile 28 Jul 2008 14:38:14 -0000 @@ -7,7 +7,7 @@ PORTNAME= megacli PORTVERSION= 1.01.40 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= sysutils linux MASTER_SITES= http://www.lsi.com/support/downloads/megaraid/miscellaneous/linux/ PKGNAMEPREFIX= linux- @@ -23,6 +23,7 @@ ONLY_FOR_ARCHS= i386 amd64 USE_LINUX= yes SUB_FILES= megacli.sh SUB_FILES+= 407.status-mfi-raid +SUB_FILES+= mfi_tty_log # From bsd.linux.rpm.mk RPM2CPIO?= ${LOCALBASE}/bin/rpm2cpio @@ -39,6 +40,7 @@ do-install: ${INSTALL_SCRIPT} ${WRKSRC}/megacli.sh ${PREFIX}/sbin/megacli ${MKDIR} ${PREFIX}/etc/periodic/daily ${INSTALL_SCRIPT} ${WRKSRC}/407.status-mfi-raid ${PREFIX}/etc/periodic/daily + ${INSTALL_SCRIPT} ${WRKSRC}/mfi_tty_log ${PREFIX}/etc/rc.d ${INSTALL_PROGRAM} ${WRKSRC}/opt/MegaRAID/MegaCli/MegaCli ${PREFIX}/libexec post-install: Index: sysutils/linux-megacli/pkg-plist =================================================================== RCS file: /local/mirror/FreeBSD/r/pcvs/ports/sysutils/linux-megacli/pkg-plist,v retrieving revision 1.2 diff -u -p -r1.2 pkg-plist --- sysutils/linux-megacli/pkg-plist 9 Mar 2007 13:15:02 -0000 1.2 +++ sysutils/linux-megacli/pkg-plist 28 Jul 2008 14:38:14 -0000 @@ -1,6 +1,7 @@ sbin/megacli libexec/MegaCli etc/periodic/daily/407.status-mfi-raid +etc/rc.d/mfi_tty_log %%PORTDOCS%%%%DOCSDIR%%/readme.txt %%PORTDOCS%%%%DOCSDIR%%/README-status-mfi-raid.txt %%PORTDOCS%%@dirrm %%DOCSDIR%% Index: sysutils/linux-megacli/files/407.status-mfi-raid.in =================================================================== RCS file: /local/mirror/FreeBSD/r/pcvs/ports/sysutils/linux-megacli/files/407.status-mfi-raid.in,v retrieving revision 1.4 diff -u -p -r1.4 407.status-mfi-raid.in --- sysutils/linux-megacli/files/407.status-mfi-raid.in 18 Jun 2008 13:02:46 -0000 1.4 +++ sysutils/linux-megacli/files/407.status-mfi-raid.in 28 Jul 2008 14:38:14 -0000 @@ -16,6 +16,7 @@ fi : ${daily_status_mfi_raid_enable:=NO} : ${daily_status_mfi_raid_verbose:=NO} : ${daily_status_mfi_raid_persist_logs:=YES} +: ${daily_status_mfi_raid_tty_log:=NO} megacli=${megacli:-%%PREFIX%%/sbin/megacli} logdir=${logdir:-/var/log} @@ -222,7 +223,31 @@ for ctrl in `jot ${ADPCOUNT} ${ADPMINIDX if test $raid_rc -eq 0; then echo " No new log messages." fi - [ $rc -eq 0 ] && [ $raid_rc -ne 0 ] && rc=3 + + # TTY Log + echo "TTY Log:" + tty_log=${logdir}/mfi_raid_${ctrl}_tty + tty_rc=0 + case "$daily_status_mfi_raid_tty_log" in + [Yy][Ee][Ss]) + if test ! -f ${tty_log}.today; then + touch ${tty_log}.today + fi + mv -f ${tty_log}.today ${tty_log}.yesterday + ${megacli} -FwTermLog Dsply -a${ctrl} > ${tty_log}.today + cmp -s ${tty_log}.yesterday ${tty_log}.today + tty_rc=$? + if test $tty_rc -ne 0; then + diff -u ${tty_log}.yesterday ${tty_log}.today | \ + grep -v '^-\|^$' + else + echo " No new TTY log messages." + fi + ;; + *) + ;; + esac + [ $rc -eq 0 ] && [ $raid_rc -ne 0 -o $tty_rc -ne 0 ] && rc=3 done exit ${rc} Index: sysutils/linux-megacli/files/mfi_tty_log.in =================================================================== RCS file: sysutils/linux-megacli/files/mfi_tty_log.in diff -N sysutils/linux-megacli/files/mfi_tty_log.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sysutils/linux-megacli/files/mfi_tty_log.in 28 Jul 2008 14:38:14 -0000 @@ -0,0 +1,63 @@ +#!/bin/sh +# +# $FreeBSD: src/etc/rc.d/abi,v 1.4.2.4 2007/03/10 14:04:01 yar Exp $ +# + +# PROVIDE: mfi_tty_log +# REQUIRE: abi +# KEYWORD: nojail + +: ${rc_mfi_raid_tty_log:=YES} + +. /etc/rc.subr + +name="mfi_tty_log" +start_cmd="${name}_start" +stop_cmd=":" + +mfi_tty_log_start() +{ + megacli=${megacli:-%%PREFIX%%/sbin/megacli} + logdir=${logdir:-/var/log} + + case "$rc_mfi_raid_tty_log" in + [Yy][Ee][Ss]) + echo + echo 'Checking for TTY logs of MFI(4) RAID controllers:' + ;; + *) + return 0 + ;; + esac + + if test `id -u` -ne 0; then + echo "You must be root to run `basename $0`." >&2 + return 1 + fi + + ADPCOUNT=$(${megacli} -adpCount | \ + awk '/Controller Count:/ { gsub("\\.", ""); print $3 }') + + case ${ADPCOUNT} in + 0) echo "Error: Cannot find an adapter." >&2 + return 1 + ;; + [1-9]|[1-9][0-9]|[1-2][0-9][0-9]) + ;; + *) + echo "Error: Cannot get the number of adapters: ${ADPCOUNT}" >&2 + return 1 + ;; + esac + + ADPMINIDX=0 + ADPMAXIDX=`expr ${ADPCOUNT} - 1` + + for ctrl in `jot ${ADPCOUNT} ${ADPMINIDX} ${ADPMAXIDX}`; do + tty_log=${logdir}/mfi_raid_${ctrl}_tty.boot + echo " Adapter: ${ctrl} - TTY log saved to ${tty_log}" + ${megacli} -FwTermLog Dsply -a${ctrl} > ${tty_log} + done +} + +run_rc_command "$1" >Release-Note: >Audit-Trail: >Unformatted: