Browse Source

Import upstream version 36

Ed Cashin 8 years ago
parent
commit
cbba7921ec
10 changed files with 155 additions and 26 deletions
  1. 21 0
      NEWS
  2. 1 1
      README
  3. 15 5
      aoe-stat.8
  4. 36 15
      aoe-stat.in
  5. 3 3
      aoe-version
  6. 1 1
      aoetools.8
  7. 1 1
      devnodes.txt
  8. 11 0
      pkg/rhel6/SOURCES/60-aoe.rules
  9. 49 0
      pkg/rhel6/SPECS/aoetools.spec
  10. 17 0
      sos-linux

+ 21 - 0
NEWS

@@ -1,3 +1,24 @@
+2013-08-07 Ed Cashin <ecashin@coraid.com>
+	support debugfs-exported debug info in sos-linux
+	release 36
+
+2013-07-10 Ed Cashin <ecashin@coraid.com>
+	add pkg subdirectory for distro-specific packaging files
+
+2012-09-20 Ed Cashin <ecashin@coraid.com>
+	only use one of the sysfs version files in aoe-version
+	release 35
+
+2012-06-27 Ed Cashin <ecashin@coraid.com>
+	restore payload field in aoe-stat output
+	release 34
+
+2012-01-24 Ed Cashin <ecashin@coraid.com>
+	handle missing sysfs files in aoe-stat
+	update docs for 3.x kernels
+	remove "function" keyword in aoe-stat for Ubuntu
+	release 33
+
 2010-08-18 Justin Sanders <justin@coraid.com>
 	aoe-sancheck fix: zero out every interface
 	release 32

+ 1 - 1
README

@@ -1,5 +1,5 @@
 The aoetools are programs that assist in using ATA over Ethernet on
-systems with version 2.6 Linux kernels.  
+systems with version 2.6 and newer Linux kernels.  
 
 Systems running 2.4 Linux kernels do not need and should not install
 the aoetools.  The aoe driver for 2.4 kernels is self sufficient.

+ 15 - 5
aoe-stat.8

@@ -44,6 +44,16 @@ considers this device ready
 for I/O.  The "down" status means the opposite.  The "down,closewait"
 status means that some software still has the device open, and when
 this straggler closes the device, it will enter the "down" state.
+.SH UNAVAILABLE TARGETS
+If a discovered AoE target will not respond to I/O commands, some
+of the information needed to allow Linux to use the device is not
+available.  The
+.I aoe-stat
+command shows the missing information as "(NA)" fields.
+.PP
+It is normal for "(NA)" fields to appear during the brief
+time between the time that an AoE target is detected and the
+time the Linux kernel finishes reading its partition table.
 .SH ENVIRONMENT VARIABLES
 If the
 .I sysfs_dir
@@ -87,11 +97,11 @@ nai:~# aoe-stat
 nai:~# ifconfig eth3 up
 nai:~# aoe-discover 
 nai:~# aoe-stat
-      e0.0     10995.116GB   eth0 up            
-      e0.1     10995.116GB   eth0 up            
-      e0.2     10995.116GB   eth0 up            
-      e1.0      1152.874GB   eth0 up            
-      e7.0       370.566GB   eth0 up            
+      e0.0     10995.116GB   eth3 up            
+      e0.1     10995.116GB   eth3 up            
+      e0.2     10995.116GB   eth3 up            
+      e1.0      1152.874GB   eth3 up            
+      e7.0       370.566GB   eth3 up            
 nai:~# 
 .fi
 .EE

+ 36 - 15
aoe-stat.in

@@ -1,6 +1,6 @@
 #! /bin/bash
 # aoe-stat - collate and present information about AoE storage
-# Copyright 2009, CORAID, Inc., and licensed under GPL v.2.
+# Copyright 2012, CORAID, Inc., and licensed under GPL v.2.
 
 set -e
 me=`basename $0`
@@ -15,7 +15,7 @@ test ! -d "$sysd/block" && {
 	exit 1
 }
 
-function checknode () {
+checknode () {
 	devname="$1"
 	m_sysfs="$2"
 	if test -b "@devdir@/$devname"; then
@@ -28,6 +28,16 @@ EOF
 	fi
 }
 
+NA="(NA)"
+cat_or_NA () {
+	f="${1?}"
+	if test -r "$f"; then
+		cat "$f"
+	else
+		echo "$NA"
+	fi
+}
+
 re=.
 if test $# -gt 0; then
 	re=$1
@@ -49,23 +59,34 @@ for d in `ls -d $sysd/block/*e[0-9]*\.[0-9]* 2>/dev/null | grep -v p` end; do
 	test $d = end && continue
 
 	dev=`echo "$d" | sed 's/.*!//'`
-	sectors="`cat \"$d/size\"`"
-	minor="`awk -F: '{print $2}' \"$d/dev\"`"
-	checknode "$dev" "$minor"
-	psize=$(((512000 * $sectors) / (1000 * 1000 * 1000)))
-	psize=`printf "%04d\n" $psize | sed 's!\(...\)$!.\1!'`
-	if test "$payload" = "yes"; then
+	if test -r "$d"/dev; then
+		minor="`awk -F: '{print $2}' \"$d/dev\"`"
+		checknode "$dev" "$minor"
+	else
+		minor="$NA"
+	fi
+	sectors=`cat_or_NA "$d"/size`
+	if test "$sectors" = "$NA"; then
+		psize="$NA"
+	else
+		psize=$(((512000 * $sectors) / (1000 * 1000 * 1000)))
+		psize=`printf "%04d\n" $psize | sed 's!\(...\)$!.\1!'`GB
+	fi
+	netif=`cat_or_NA "$d"/netif`
+	state=`cat_or_NA "$d"/state`
+	payload=`cat_or_NA "$d"/payload`
+	if test "$payload" != "$NA"; then
 		printf "$format" \
 			"$dev" \
-			"${psize}GB" \
-			"`cat \"$d/netif\"`" \
-			"`cat \"$d/payload\"`" \
-			"`cat \"$d/state\"`"
+			"${psize}" \
+			"$netif" \
+			"$payload" \
+			"$state"
 	else
 		printf "$format" \
 			"$dev" \
-			"${psize}GB" \
-			"`cat \"$d/netif\"`" \
-			"`cat \"$d/state\"`"
+			"${psize}" \
+			"$netif" \
+			"$state"
 	fi
 done | sort | grep $re

+ 3 - 3
aoe-version

@@ -1,8 +1,8 @@
 #! /bin/sh
 # aoe-version - display versions of AoE-related software
-# Copyright 2010, CORAID, Inc., and licensed under GPL v.2.
+# Copyright 2013, CORAID, Inc., and licensed under GPL v.2.
 
-aoetools=32
+aoetools=36
 
 # modinfo doesn't always work correctly when there is a file
 # in the current working directory called "aoe", but it's
@@ -36,7 +36,7 @@ if test "$?" != "0" || test -z "$installed"; then
 fi
 
 if test -d /sys/module/aoe; then
-	running="`find /sys/module/aoe -name version | xargs cat`"
+	running="`find /sys/module/aoe -name version | sed 1q | xargs cat`"
 	if test "$?" != "0"; then
 		running="(unknown)"
 	fi

+ 1 - 1
aoetools.8

@@ -1,6 +1,6 @@
 .TH aoetools 8
 .SH NAME
-aoetools \- utilities for AoE on systems running Linux 2.6
+aoetools \- utilities for AoE on systems running Linux 2.6 and up
 .SH DESCRIPTION
 The
 .I aoetools

+ 1 - 1
devnodes.txt

@@ -32,7 +32,7 @@ can't use udev, then here's what to do:
 
         make NPERSHELF=10
 
-    * Using aoetools-7 and earlier with newer 2.6 kernels (2.6.14 and
+    * Using aoetools-7 and earlier with newer kernels (2.6.14 and
       later) is not recommended.
 
 Other combinations should work with the default settings.

+ 11 - 0
pkg/rhel6/SOURCES/60-aoe.rules

@@ -0,0 +1,11 @@
+# These rules tell udev what device nodes to create for aoe support.
+
+# aoe char devices
+SUBSYSTEM=="aoe", KERNEL=="discover",	NAME="etherd/%k", GROUP="disk", MODE="0220"
+SUBSYSTEM=="aoe", KERNEL=="err",	NAME="etherd/%k", GROUP="disk", MODE="0440"
+SUBSYSTEM=="aoe", KERNEL=="interfaces",	NAME="etherd/%k", GROUP="disk", MODE="0220"
+SUBSYSTEM=="aoe", KERNEL=="revalidate",	NAME="etherd/%k", GROUP="disk", MODE="0220"
+SUBSYSTEM=="aoe", KERNEL=="flush",	NAME="etherd/%k", GROUP="disk", MODE="0220"
+
+# aoe block devices     
+KERNEL=="etherd*",       NAME="%k", GROUP="disk"

+ 49 - 0
pkg/rhel6/SPECS/aoetools.spec

@@ -0,0 +1,49 @@
+%define sbind %{buildroot}%{_sbindir}
+%define mand %{buildroot}%{_mandir}
+%define udevrulesd %{buildroot}%{_sysconfdir}/udev/rules.d
+%define docfiles COPYING HACKING NEWS README
+
+Summary: ATA over Ethernet (AoE) utilities
+Name: aoetools
+Vendor: Coraid, Inc.
+Packager: Ed Cashin <ecashin@coraid.com>
+Version: 36
+Release: 1%{dist}
+URL: http://aoetools.sourceforge.net/
+Source0: %{name}-%{version}.tar.gz
+Source1: 60-aoe.rules
+License: GPLv2
+Group: Application/System
+
+%description
+The command-line utilities for using the aoe driver to work with
+ATA over Ethernet storage targets on a Linux system.
+
+%define debug_package %{nil}
+
+%prep
+%setup -n %{name}-%{version}
+
+%build
+make SBINDIR=%{sbind} MANDIR=%{mand}
+
+%install
+mkdir -p -m 755 %{sbind}/
+mkdir -p -m 755 %{mand}/man8/
+make install SBINDIR=%{sbind} MANDIR=%{mand}
+mkdir -p -m 755 %{udevrulesd}/
+install -m 644 %{SOURCE1} %{udevrulesd}
+
+%files
+%defattr(-,root,root)
+%doc %docfiles
+%attr(0755,root,root) %{_sbindir}/*
+%{_mandir}/man8/*
+%config %{_sysconfdir}/udev/rules.d/*
+
+%changelog
+* Thu Aug 15 2013 Ed Cashin <ecashin@coraid.com> - 36-1
+- Update for v36
+
+* Wed Jul 10 2013 Ed Cashin <ecashin@coraid.com> - 35-1
+- Initial package for aoetools v35 plus udev rules

+ 17 - 0
sos-linux

@@ -29,4 +29,21 @@ for i in `aoe-stat | awk '{print $3}' | sed 's!,! !g'`; do
 	echo ethtool -S $i
 done | sort | uniq | sh -x
 # top -b -n 1
+
+# check for old-style sysfs-exported debug information, ignoring errors
 grep . /sys/block/etherd*/debug /dev/null
+
+# check for new-style debugfs-exported debug information, ignoring errors
+dmnt=/sys/kernel/debug
+didmount=
+mounted=`awk '$3=="debugfs"{print $2}' /proc/mounts`
+if test "x$mounted" = "x" && mount -t debugfs none "$dmnt"; then
+	didmount="$dmnt"
+	mounted="$dmnt"
+fi
+cd "$mounted"/aoe && grep . e[0-9]*.*[0-9]
+cd /
+if test "x$didmount" != "x"; then
+	umount "$didmount"
+fi
+exit 0