debian/0000775000000000000000000000000012340404277007173 5ustar debian/copyright0000664000000000000000000000212212266377443011136 0ustar This package was firstly debianized by David Martínez Moreno on Sat, 23 Apr 2005 03:39:56 +0200. It was downloaded from http://aoetools.sf.net/ Upstream Author: Ed L. Cashin Copyright: (C) 2007 by Coraid, Inc., Ed Cashin and Erik Quanstrom. License: This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 dated June, 1991. This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. On Debian GNU/Linux systems, the complete text of the GNU General Public License version 2 can be found in `/usr/share/common-licenses/GPL-2'. debian/dirs0000664000000000000000000000011612265463746010071 0ustar /usr/share/initramfs-tools/hooks /usr/share/initramfs-tools/scripts/local-top debian/local-top_aoe0000664000000000000000000000100312265463746011642 0ustar #!/bin/sh set -e PREREQ="udev" prereqs() { echo "$PREREQ" } case $1 in prereqs) prereqs exit 0 ;; esac # Bring in the main config . /conf/initramfs.conf for conf in conf/conf.d/*; do [ -f ${conf} ] && . ${conf} done . /scripts/functions configure_networking # Make sure udev has processed all events from adding the NIC # modules before loading aoe wait_for_udev 10 modprobe aoe # Wait until aoe device files have been generated. wait_for_udev 10 [ -x /sbin/aoe-discover ] && aoe-discover debian/README0000664000000000000000000000235012266377443010066 0ustar aoetools for Debian ------------------- With aoetools it is shipped an init script that will mount any AoE volume properly configured in your /etc/fstab, that is, without option 'noauto' AND with an option '_netdev', if you want to avoid any error messages in the boot process. In the following examples I am supposing that the rest of the mount options are simply 'defaults', but you can replace it with other parameters. Example of a correct line: /dev/etherd/e0.0p5 /mnt/aoe xfs defaults,_netdev 2 0 Wrong examples: This line will generate boot errors, as the early mount process will try to mount this volume, because it is not marked as network-dependant: /dev/etherd/e0.0p5 /mnt/aoe xfs defaults 2 0 This line will provoke that the /mnt/aoe volume won't simply get mounted while booting or running "/etc/init.d/aoetools start": /dev/etherd/e0.0p5 /mnt/aoe xfs defaults,noauto 2 0 Important note: Please note that if your network is not properly configured or your AoE server is down, you can incur in big delays in the booting process. If you fear so, mount volumes manually after you are sure that your AoE shelf is reachable. debian/changelog0000664000000000000000000002703512340404277011054 0ustar aoetools (36-1ubuntu1) utopic; urgency=medium * Merge from Debian unstable. Remaining changes: - debian/aoetools.init: keep Ubuntu error logging -- Bhavani Shankar Sun, 25 May 2014 20:42:17 +0530 aoetools (36-1) unstable; urgency=low * New upstream release, released on 2013-08-07. Changes since the last one: - Support debugfs-exported debug info in sos-linux. - Add pkg subdirectory for distro-specific packaging files. - Only use one of the sysfs version files in aoe-version. - Restore payload field in aoe-stat output. - Handle missing sysfs files in aoe-stat. - Update docs for 3.x kernels. * Moved this package to 3.0 (quilt) format. * Bumped DH compat to 9. * debian/control: - Depend on debhelper (>> 9), removed quilt. - Bump Standards-Version to 3.9.5. - Added mention in the Description that this can run on 3.x kernels. - Added Vcs-* fields. - Added ${misc:Depends} to Depends. * debian/rules: - Actually migrate it to the compact version, overriding dh_installinit. - Added an override to install the upstream changelog. - Added override to dh_auto_install, because we need everything in /sbin. - Stop restarting aoetools on upgrades. This is the wrong thing, as we don't have a daemon or anything like that, because everything happends inside the kernel once the devices are mounted. We caused unnecesary grief with it (closes: #568554). I'm very sorry. * debian/watch: Added. * debian/patches: - 02_no_hyphen_in_manpages: Refreshed, and fixed a typo in aoeping.8. - 03_enable_hardened_build: New, to enable CFLAGS/CPPFLAGS/LDFLAGS from the environment in order to have hardened builds. - 04_support_slash_run_slash_udev: New, adding /run/udev to the udev checks. Thanks, Roger Leigh (closes: #644308). * debian/aoetools.init: - Unified the style for loops and whitespace. - Removed PATH with /usr elements to avoid lintian tripping on the wrong check. - Added aoetools to Provides. - Added 'status' action, fixed a bug with LVMGROUPS and clarified the case when we don't mount anything because of /etc/default/aoetools. - Added support for assembling RAID devices during start-up. Based on a patch by Gabor Kiss (closes: #606307). Thanks, Gabor! * debian/aoetools.default: Added support for RAID_ARRAYS and switched to single quotes. * Added hooks for initramfs-tools in order to be able to support booting from an AoE root device. Thanks, wolfle (closes: #591026). -- David Martínez Moreno Fri, 17 Jan 2014 14:13:58 -0800 aoetools (32-1) unstable; urgency=low * New upstream release: - New tool: aoe-sancheck - diagnoses MTU and other network issues. * Fixed part of #559335. I'm not convinced that we should alter the syntax of /etc/default/aoetools, though. Now the init script does not try to unmount filesystems already unmounted. -- David Martínez Moreno Mon, 18 Oct 2010 11:35:37 +0200 aoetools (30-3ubuntu1) lucid; urgency=low * Merged with Debian: (LP: #481744) - debian/aoetools.init: keep Ubuntu error logging -- Mackenzie Morgan Fri, 13 Nov 2009 00:26:16 -0500 aoetools (30-3) unstable; urgency=low * debian/rules: - Added NEWS to dh_installchangelog. * debian/control: Removed Section and Priority from the binary section. * debian/patches: - Removed old patches. - Added 02_no_hyphen_in_manpages.patch to fix all lintian warnings. - Added descriptions to patches. -- David Martínez Moreno Sun, 06 Sep 2009 00:17:09 +0200 aoetools (30-2) unstable; urgency=low * When loading the kernel module, marshal into the module the list of interfaces that we want to run AoE over. This fixes an obscure security problem where AoE traffic could go over a different interface than the one specified by the administrator (closes: #408042). Thanks, Jacques Normand for the explanation and Juan Céspedes for the patch. * debian/rules: Rewrote some part in order to be more verbose and solve the case when no volume is mounted. Thanks, Ferenc Wagner (closes: #492905). -- David Martínez Moreno Sat, 05 Sep 2009 18:12:34 +0200 aoetools (30-1ubuntu1) karmic; urgency=low * Merge from debian unstable, remaining changes: LP: #413558 - Made the init script more lsb compliant. -- Bhavani Shankar Fri, 14 Aug 2009 17:14:25 +0530 aoetools (30-1) unstable; urgency=low * New upstream release: - Enhanced manpages. - aoe-version modinfo workaround. - Merged Debian changes to aoe-flush into upstream. - aoeping: recognize errors in SMART command response * debian/rules: Moved patches from diff.gz to quilt. * debian/control: - Added B-D on quilt. - Fixed a typo in Description. - Bumped Standards-Version to 3.8.2 (no changes). * debian/compat: Bumped DH version to 5. -- David Martínez Moreno Thu, 13 Aug 2009 02:22:20 +0200 aoetools (26-1ubuntu1) intrepid; urgency=low * Merge from debian unstable, remaining changes: - Made the init script more lsb compliant. - Updated maintainer field according to spec. -- Chuck Short Fri, 04 Jul 2008 13:21:16 +0100 aoetools (26-1) unstable; urgency=low * New upstream release (closes: #475135). Main changes are: - Merged Debian changes for Makefile. - Add sos-linux tool for collecting localhost information (not shipped). - Create coraid-update for uploading update file to an update target. - Make aoeping and aoecfg more conforming to AoE protocol. - Support new payload size information from AoE driver. - Handle aoe-flush without arguments correctly. - aoe-flush: support flushing specific devices. - Fixed and added several manpages. * debian/aoetools.docs: Removed TODO. * aoe-flush.in: Patched to comply with dash-compliant shells. * debian/control: - Added a Homepage field. - Bumped Standards-Version to 3.8.0. - Reordered utilities in Description and added coraid-update. -- David Martínez Moreno Thu, 03 Jul 2008 16:40:06 +0200 aoetools (23-0ubuntu5) hardy; urgency=low * This time with feeling. -- Chuck Short Fri, 07 Mar 2008 11:20:36 -0500 aoetools (23-0ubuntu4) hardy; urgency=low * More init scripts clean-up. -- Chuck Short Tue, 19 Feb 2008 15:05:26 -0500 aoetools (23-0ubuntu3) hardy; urgency=low * Make the init script more lsb compliant. -- Chuck Short Fri, 15 Feb 2008 09:20:17 -0500 aoetools (23-0ubuntu2) hardy; urgency=low * Make init script lsb compliant. -- Chuck Short Tue, 12 Feb 2008 13:34:33 -0500 aoetools (23-0ubuntu1) hardy; urgency=low * New upstream version. -- Chuck Short Tue, 12 Feb 2008 09:45:23 -0500 aoetools (21-1) unstable; urgency=low * New upstream release. Main changes are: - Merged Debian modifications for solving bashisms. - Now the tools are udev-aware. - Added aoe-version tool for getting AoE-related software information. - Added aoecfg tool, a full implementation of the config query feature of the AoE protocol. - Added some additional manpages and clarified copyright. - Enhanced aoeping. * debian/copyright: Added some information for making clear that Coraid is the real copyright holder. * debian/control: Added aoe-flush, aoe-version and aoecfg to the description. * Makefile: Added AOE_CFG_OBJ to the clean target. -- David Martínez Moreno Mon, 10 Dec 2007 03:41:22 +0100 aoetools (15-1) unstable; urgency=low * New upstream release: - Man pages improved. - Missing device nodes trigger an error in the scripts now. - aoe-flush command added, for removing devices in driver memory. - Support aoe devices without "etherd" prefix in name. - Add support for -c flag to aoe-interfaces. - Some Debian changes merged. * debian/aoetools.init: - Change Provides: in the LSB header from 'mountaoe' to 'aoe'. - Add a comment about the loading of the aoe module. - Rearranged logic a bit, in order to postpone module load until we have a valid interface list. This has the added value of resolving (again) the installation in a new system. - Sleep 1 second before checking for /dev/etherd/discover, to give udev a chance to create the files. - Merged most of the modifications to the init script, kindly contributed by Glen W. Mabey. I added robustness and fixed some old errors while at it. This closes: #421554, #408044, #387552 (finally). * debian/aoetools.default: Added support for LVMGROUPS and AOEMOUNTS. * debian/rules: Added support for creating rc0.d/S34aoetools and rc6.d/S34aoetools. * debian/copyright: Point to GPL-2 instead of GPL. -- David Martínez Moreno Tue, 04 Sep 2007 03:24:19 +0200 aoetools (11-1.2) unstable; urgency=low * Non-maintainer upload. * Apply patch from Nelson A. de Oliveira to fix missing dependency on lsb-base (closes: #403294) -- Andrew Pollock Sat, 16 Dec 2006 10:37:05 -0800 aoetools (11-1.1) unstable; urgency=high * Non-maintainer upload. * Have the init script opportunistically modprobe aoe, and exit out if $INTERFACES == none before checking for /dev/etherd, so that the PACKAGE installs cleanly on unconfigured systems; patch from Steve Langasek. (Closes: #391345) -- Steinar H. Gunderson Tue, 31 Oct 2006 14:25:41 +0100 aoetools (11-1) unstable; urgency=low * New upstream release: - Use POSIX shell math instead of relying on bc or dc (closes: #377431). * The introduced changes, as is, do not work with discs bigger than 2 GB. The problem is that POSIX arithmetic is limited to 2147483648, but not in bash. Probably upstream author (and Warren Turkal) have /bin/sh pointing to /bin/bash, so he (they) did not see the problem. Changed all the scripts using bashisms to use /bin/bash. * debian/rules: Binaries should go to /sbin instead to /usr/sbin. If not, we are preventing users from using AoE volumes in the early boot process, as well as for hosting the /usr directory. Many thanks to Warren Turkal for pointing out this (closes: #388335). * debian/control: - Added aoe-revalidate to the list of included tools. - Bumped policy version to 3.7.2.1. * Added /etc/default/aoetools and /etc/init.d/aoetools in order to initialize AoE devices just after network goes up (position 41 in runlevel S). Added a README-Debian about this subject. This closes: #387552. -- David Martínez Moreno Tue, 3 Oct 2006 03:51:32 +0200 aoetools (10-1) unstable; urgency=low * New upstream release. This fixes device creation, so closes: #337300. * debian/control: - Bump Standards-Version to 3.7.2.0. - Bump dependency on debhelper to >= 5. - Rewrote the package description. * debian/compat: Bumped compatibility to 5. * debian/copyright: Changed FSF's address to the new one. * Added devnodes.txt to shipped docs. -- David Martínez Moreno Tue, 30 May 2006 04:13:47 +0200 aoetools (4-1) unstable; urgency=low * New upstream release. Makefile typo merged upstream, and added TODO file. -- David Martínez Moreno Thu, 16 Jun 2005 17:06:26 +0200 aoetools (3-1) unstable; urgency=low * First package release. -- David Martínez Moreno Sat, 23 Apr 2005 03:47:02 +0200 debian/hooks_aoe0000664000000000000000000000036712265463746011107 0ustar #!/bin/sh set -e PREREQ="" prereqs() { echo "$PREREQ" } case $1 in prereqs) prereqs exit 0 ;; esac . /usr/share/initramfs-tools/hook-functions [ -x /sbin/aoe-discover ] && copy_exec /sbin/aoe-discover /sbin manual_add_modules aoe debian/source/0000775000000000000000000000000012266377443010506 5ustar debian/source/format0000664000000000000000000000001412265463746011715 0ustar 3.0 (quilt) debian/aoetools.default0000664000000000000000000000174312266377443012406 0ustar # Configuration file for aoetools. # Enter the list of network interfaces to restrict the AoE discovery to, separated by spaces. # It can be blank, i.e. "", if you want to run AoE over all the interfaces. # If you do not want AoE discovery at all, enter "none" as the list of interfaces. # # If neither the aoe_iflist module load option nor this list of interfaces are used, the aoe driver # will use any network interface for AoE traffic. INTERFACES='none' # Enter a list of RAID arrays to be activated after AoE volumes are ready, separated by spaces, # without the /dev/ prefix and quoted. It may be blank. # Example: #RAID_ARRAYS='md0 md1' RAID_ARRAYS='' # Enter a list of LVM2 volume groups to be activated after AoE volumes are ready, separated by spaces. # It can be blank, i.e., ''. LVMGROUPS='' # Enter a list of file systems to be mounted over AoE. Note that those entries listed in /etc/fstab # that contain "/dev/etherd/" will be automatically added to this list. AOEMOUNTS='' debian/control0000664000000000000000000000336612340400712010574 0ustar Source: aoetools Section: admin Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: David Martínez Moreno Standards-Version: 3.9.5 Homepage: http://aoetools.sf.net Build-Depends: debhelper (>> 9) Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/aoetools.git Vcs-Git: git://anonscm.debian.org/collab-maint/aoetools.git Package: aoetools Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, lsb-base Description: tools to assist in using ATA over Ethernet The aoetools are programs that assist in using ATA over Ethernet. These tools are designed to work with the "aoe" driver for Linux 2.6+ kernels; in fact, this version recommends kernel 2.6.14 or later, as both support up to 16 slots per shelf address. . Systems running Linux 2.4 kernels do not need and should not install the aoetools. The aoe driver for 2.4 kernels is self-sufficient. . There are several tools included in this package: * aoecfg - manipulate AoE configuration strings * aoe-discover - trigger discovery of ATA over Ethernet devices * aoe-flush - flush the down devices out of the aoe driver * aoe-interfaces - restrict network interfaces used for AoE * aoe-mkdevs - create character and block device files * aoe-mkshelf - create block device files for one shelf address * aoeping - simple userland communication with AoE devices * aoe-revalidate - revalidate the disk size of an AoE device * aoe-sancheck - diagnoses MTU and other network issues * aoe-stat - print status information for AoE devices * aoe-version - print AoE-related software version information * coraid-update - upload an update file to a Coraid appliance debian/patches/0000775000000000000000000000000012266377443010635 5ustar debian/patches/03_enable_hardened_build.patch0000664000000000000000000000267312265463746016430 0ustar Description: Enable CFLAGS/CPPFLAGS/LDFLAGS from the environment. Add the ability in the Makefile to pass from the environment values for CFLAGS, CPPFLAGS and LDFLAGS in order to have a proper hardened build. Refer to http://wiki.debian.org/Hardening for details. Author: David Martínez Moreno Forwarded: no Last-Update: 2014-01-12 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ CONF_SCRIPTS = aoe-discover aoe-interfaces aoe-mkshelf aoe-revalidate aoe-flush aoe-stat PROGS = aoeping aoecfg aoe-sancheck COMMANDS := ${CONF_SCRIPTS} aoe-mkdevs aoe-version coraid-update ${PROGS} -CFLAGS = -Wall -O -g +CFLAGS += -Wall -O -g ${CPPFLAGS} SANCHECKLIBS = -lpthread AOE_PING_OBJ = aoeping.o linux.o @@ -68,17 +68,17 @@ rm -f ${CONF_SCRIPTS} ${AOE_PING_OBJ} ${AOE_CFG_OBJ} ${SANCHECK_OBJ} ${PROGS} aoeping : ${AOE_PING_OBJ} - ${CC} ${CFLAGS} -o $@ ${AOE_PING_OBJ} + ${CC} ${CFLAGS} ${LDFLAGS} -o $@ ${AOE_PING_OBJ} aoeping.o : aoeping.c dat.h fns.h ${CC} ${CFLAGS} -o $@ -c $< linux.o : linux.c config.h ${CC} ${CFLAGS} -o $@ -c $< aoecfg: ${AOE_CFG_OBJ} - ${CC} ${CFLAGS} -o $@ ${AOE_CFG_OBJ} + ${CC} ${CFLAGS} ${LDFLAGS} -o $@ ${AOE_CFG_OBJ} aoecfg.o : aoecfg.c dat.h fns.h ${CC} ${CFLAGS} -o $@ -c $< aoe-sancheck : ${SANCHECK_OBJ} - -$(CC) $(CFLAGS) -o $@ ${SANCHECK_OBJ} $(SANCHECKLIBS) + -$(CC) $(CFLAGS) ${LDFLAGS} -o $@ ${SANCHECK_OBJ} $(SANCHECKLIBS) aoe-sancheck.o : aoe-sancheck.c -$(CC) $(CFLAGS) -o $@ -c $< debian/patches/series0000664000000000000000000000017112266377443012051 0ustar 01_no_bashisms.patch 02_no_hyphen_in_manpages.patch 03_enable_hardened_build.patch 04_support_slash_run_slash_udev.patch debian/patches/01_no_bashisms.patch0000664000000000000000000000064412266377443014467 0ustar # 01_no_bashisms.patch # # This patch avois calling directly to /bin/sh. # Index: aoetools-30/aoe-mkdevs =================================================================== --- aoetools-30.orig/aoe-mkdevs +++ aoetools-30/aoe-mkdevs @@ -56,6 +56,6 @@ export n_partitions mkshelf=`echo $0 | sed 's!mkdevs!mkshelf!'` i=0 while test $i -lt $n_shelves; do - sh $mkshelf $dir $i + $mkshelf $dir $i i=`expr $i + 1` done debian/patches/02_no_hyphen_in_manpages.patch0000664000000000000000000000445012266377443016512 0ustar Description: Patch hyphens in manpages. Patched all the manpages in order to avoid usual hyphen->minus confusion. Also fixed a typo. Author: David Martínez Moreno Forwarded: no Last-Update: 2014-01-12 --- a/aoecfg.8 +++ b/aoecfg.8 @@ -3,7 +3,7 @@ aoecfg \- manipulate AoE configuration strings .SH SYNOPSIS .B aoecfg -[-c \fIcmd\fR] [-s \fIcfgstr\fR] [-t \fItimeout\fR] [\fIshelf slot\fR] [\fInetif\fR] +[\-c \fIcmd\fR] [\-s \fIcfgstr\fR] [\-t \fItimeout\fR] [\fIshelf slot\fR] [\fInetif\fR] .fi .SH DESCRIPTION .IR Aoecfg (8) --- a/aoe-mkdevs.8 +++ b/aoe-mkdevs.8 @@ -52,13 +52,13 @@ .IP .EX .nf -nai:~# rm -rf /dev/etherd +nai:~# rm \-rf /dev/etherd nai:~# aoe-mkdevs /dev/etherd -nai:~# ls /dev/etherd | wc -l +nai:~# ls /dev/etherd | wc \-l 1603 -nai:~# rm -rf /dev/etherd +nai:~# rm \-rf /dev/etherd nai:~# n_partitions=1 aoe-mkdevs /dev/etherd -nai:~# ls /dev/etherd | wc -l +nai:~# ls /dev/etherd | wc \-l 103 .fi .EE --- a/aoe-mkshelf.8 +++ b/aoe-mkshelf.8 @@ -52,11 +52,11 @@ .EX .nf nai:~# aoe-mkshelf /dev/etherd 7 -nai:~# ls /dev/etherd/e7.* | wc -l +nai:~# ls /dev/etherd/e7.* | wc \-l 160 nai:~# rm /dev/etherd/e7.* nai:~# n_partitions=1 aoe-mkshelf /dev/etherd 7 -nai:~# ls /dev/etherd/e7.* | wc -l +nai:~# ls /dev/etherd/e7.* | wc \-l 10 nai:~# .fi --- a/aoeping.8 +++ b/aoeping.8 @@ -67,9 +67,9 @@ SMART commands in the list below are supported. If the command requires data transfer, one sector (512 bytes) of data is always the amount -transfered. If the command takes a parameter (for the Low LBA +transferred. If the command takes a parameter (for the Low LBA register), then the name of the SMART command is immediately followed -by a colon and then a number, the value of the parameter, e.g., "-S +by a colon and then a number, the value of the parameter, e.g., "\-S read_log:1". .IP read_data @@ -119,7 +119,7 @@ .IP .EX .nf -bash# aoeping -v 10 9 eth0 | head +bash# aoeping \-v 10 9 eth0 | head tag: 80000000 eth: eth0 shelf: 10 @@ -139,7 +139,7 @@ .IP .EX .nf -bash# aoeping -i -s 20 \\ +bash# aoeping \-i \-s 20 \\ 10 9 eth0 > /dev/null \\ && echo ok ok @@ -154,7 +154,7 @@ .IP .EX .nf -bash# aoeping -S return_status \\ +bash# aoeping \-S return_status \\ 10 9 eth0 | grep 'LBA Mid: 0x4f' \\ > /dev/null \\ && echo ok debian/patches/04_support_slash_run_slash_udev.patch0000664000000000000000000000311712265463746020173 0ustar Description: Support the new /run/udev location for udev detection. /run is a new cross-distribution location for the storage of transient state files, i.e. files containing run-time information that may or may not need to be written early in the boot process and which does not require preserving across reboots. A result of that change is that udev no longer uses /dev/ to store its runtime state file, i.e. the /dev/.udev/ directory, /dev/.udevdb and /dev/.udev.tdb are gone and udev uses /run/udev/ now. Author: Roger Leigh Origin: other, http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=10;filename=aoetools-run-udev.patch;att=1;bug=644308 Bug-Debian: http://bugs.debian.org/644308 Forwarded: no Reviewed-By: David Martínez Moreno Last-Update: 2014-01-13 --- aoetools-36.orig/aoe-mkdevs +++ aoetools-36/aoe-mkdevs @@ -23,7 +23,7 @@ $zero: Exiting. EOF exit 1 fi -if test "`ps axwwww | grep 'udev[d]'`" || test -d "/dev/.udev"; then +if test "`ps axwwww | grep 'udev[d]'`" || test -d "/run/udev" || test -d "/dev/.udev"; then cat 1>&2 <&2 < # and later modified by Ian Murdock . # # Also based on init script mountnfs.sh from initscripts package. # # Modified for aoetools by David Martínez Moreno . # Copyright 2006-2014. Under GPLv2. # # Support for LVM and other mount points contributed by Glen W. Mabey. # Support for RAID contributed by Gabor Kiss. # ### BEGIN INIT INFO # Provides: aoe aoetools # Required-Start: $local_fs $network # Required-Stop: $local_fs $network # Should-Start: # Default-Start: S # Default-Stop: 0 6 # Short-Description: Begin AoE discovery and mount related filesystems. # Description: Begin AoE discovery and mount filesystems residing # on AoE volumes. ### END INIT INFO NAME=aoetools DESC="AoE devices discovery and mounting AoE filesystems" [ -f /etc/default/rcS ] && . /etc/default/rcS . /lib/lsb/init-functions # Include aoetools defaults if available if [ -f /etc/default/aoetools ] then . /etc/default/aoetools fi set -e create_fs_list() { # We start with a list from /etc/default/aoetools. waitaoe="$AOEMOUNTS" [ -f /etc/fstab ] || return # # Read through fstab line by line. If it contains /dev/etherd, set the flag # for mounting file systems over AoE. # exec 9<&0 /dev/null 2>&1 || true else modprobe aoe >/dev/null 2>&1 || true fi # Also, if udev is being used, the /dev/etherd devices # are not created until aoe module insertion, so... sleep 1 # ...we give udev a chance to populate /dev/etherd/. if [ ! -c /dev/etherd/discover ] then log_failure_msg "Missing devices under /dev/etherd/. Please run aoe-mkdevs /dev/etherd and try again." >&2 exit 1 fi # Try to set up interfaces for discovery, if any. if [ -n "$INTERFACES" ] then aoe-interfaces $INTERFACES fi aoe-discover create_fs_list if [ -n "$waitaoe" ] then echo fi if [ ! -x '/sbin/mdadm' -a -n "$RAID_ARRAYS" ] then log_failure_msg "/sbin/mdadm is not present. Please install mdadm package and try again." log_action_msg "RAID_ARRAYS option is ignored." >&2 RAID_ARRAYS='' fi if [ -n "$RAID_ARRAYS" ] then log_action_msg "Assembling RAID arrays..." for md in $RAID_ARRAYS do /sbin/mdadm --assemble $md --scan done fi if [ ! -x '/sbin/vgchange' -a -n "$LVMGROUPS" ] then echo log_failure_msg "The LVM2 tools are not present. Please install lvm2 package and try again. We will not honour LVMGROUPS." LVMGROUPS='' fi if [ -n "$LVMGROUPS" ] then log_action_msg "Assembling LVM2 groups..." for vg in "$LVMGROUPS" do vgchange --available=y $vg done fi if [ -n "$waitaoe" ] then for mountpt in $waitaoe do log_action_msg "Mounting $mountpt..." mount $mountpt log_action_msg "Waiting for $mountpt." done else echo "Nothing to mount." fi } do_stop() { create_fs_list if [ -n "$waitaoe" ] then for mountpt in $waitaoe; do if [ -z "`awk '{print $2}' < /proc/mounts | grep -w $mountpt$`" ] then # It's already been unmounted. continue fi log_action_msg "Unmounting $mountpt..." umount $mountpt done fi if [ -n "$LVMGROUPS" ] then for vg in "$LVMGROUPS" do vgchange --available=n $vg done fi if [ -x /sbin/mdadm -a -n "$RAID_ARRAYS" ] then log_action_msg "Stopping RAID arrays..." for md in $RAID_ARRAYS do /sbin/mdadm --stop /dev/$md done fi # Removing the module prevents LVM's "Shutting down LVM Volume Groups..." # from hanging when an LVM has been setup on a device in /dev/etherd/. modprobe --remove aoe >/dev/null 2>&1 || true } do_status() { if $(lsmod |grep -qw '^aoe\s') then log_action_msg 'The aoe module is loaded.' fi # FIXME: Make something smarter like detect udev or a monolithic kernel. AOE_MOUNTS="$(grep '/dev/etherd/' /proc/mounts || true)" if [ -n "$AOE_MOUNTS" ] then echo 'The following AoE file systems are mounted:' echo "$AOE_MOUNTS" | awk '{print $2}' else log_failure_msg 'No AoE file systems mounted.' fi } case "$1" in start|restart|reload|force-reload) log_daemon_msg "Starting $DESC: " do_start log_end_msg 0 ;; stop) log_daemon_msg "Stopping $DESC: " do_stop log_end_msg 0 ;; status) do_status ;; *) N=/etc/init.d/$NAME echo "Usage: $N {start|stop|restart|reload|force-reload|status}" exit 1 ;; esac exit 0 debian/rules0000775000000000000000000000101012266377443010256 0ustar #!/usr/bin/make -f # Uncomment this to turn on verbose mode. # export DH_VERBOSE=1 %: dh $@ override_dh_auto_install: $(MAKE) install PREFIX=debian/aoetools SBINDIR=debian/aoetools/sbin install debian/hooks_aoe debian/aoetools/usr/share/initramfs-tools/hooks/aoe install debian/local-top_aoe debian/aoetools/usr/share/initramfs-tools/scripts/local-top/aoe override_dh_installchangelogs: dh_installchangelogs NEWS override_dh_installinit: dh_installinit --no-restart-on-upgrade -u"start 41 S . start 34 0 6 ." debian/compat0000664000000000000000000000000212266377443010404 0ustar 9 debian/aoetools.docs0000664000000000000000000000002412266377443011701 0ustar README devnodes.txt debian/watch0000664000000000000000000000007012265463746010235 0ustar version=3 http://sf.net/aoetools/aoetools-(.+)\.tar\.gz