--- dmraid-1.0.0.rc16.orig/debian/dmraid.postinst +++ dmraid-1.0.0.rc16/debian/dmraid.postinst @@ -0,0 +1,30 @@ +#! /bin/sh + +set -e + + +case "$1" in + configure) + if command -v update-initramfs >/dev/null 2>&1; then + update-initramfs -u + fi + # Activate existing arrays now. + udevadm trigger --subsystem-match=block --action=change + + if [ -f /etc/init.d/dmraid ]; then + update-rc.d -f dmraid remove + rm -f /etc/init.d/dmraid + fi + ;; + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 --- dmraid-1.0.0.rc16.orig/debian/dmraid.install +++ dmraid-1.0.0.rc16/debian/dmraid.install @@ -0,0 +1,5 @@ +debian/initramfs/dmraid.initramfs-hook/dmraid usr/share/initramfs-tools/hooks +debian/initramfs/dmraid.initramfs-local-top/dmraid usr/share/initramfs-tools/scripts/local-top +debian/standard/sbin/dmraid sbin +debian/standard/usr/share/man usr/share +debian/dmraid-activate sbin --- dmraid-1.0.0.rc16.orig/debian/dmraid.udev +++ dmraid-1.0.0.rc16/debian/dmraid.udev @@ -0,0 +1,6 @@ +# This file causes drives with dmraid arrays to be checked, and if all +# drives are present, brought up. +# See udev(8) for syntax + +SUBSYSTEM=="block", ACTION=="add|change", ENV{ID_TYPE}=="disk", ENV{ID_FS_USAGE}=="raid", KERNEL=="hd[a-z]|sd[a-z]", \ + RUN+="/sbin/dmraid-activate %k" --- dmraid-1.0.0.rc16.orig/debian/watch +++ dmraid-1.0.0.rc16/debian/watch @@ -0,0 +1,3 @@ +# watch control file for dmraid +version=3 +http://people.redhat.com/heinzm/sw/dmraid/src dmraid-([\d.].*)\.tar\.bz2 --- dmraid-1.0.0.rc16.orig/debian/dmraid-activate +++ dmraid-1.0.0.rc16/debian/dmraid-activate @@ -0,0 +1,291 @@ +#!/bin/sh +# +# dmraid-activate: Script to reformat the output of dmraid to be useful with +# udev. +# +# (c) 2008 Canonical Ltd. +# +# This program 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; either version 2 of the License, or +# (at your option) any later version. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +# Arguments: $1 = Name of array you want activated. +activate_array () +{ + Raid_Setinfo=$(dmraid -i -si "$1") + if [ -z "$Raid_Setinfo" ]; then + log_error "Cannot retrieve RAID set information for $1" + return 1 + fi + + Raid_Type=$(dmraid -i -si -ct "$1") + Raid_Nodevs=$(dmraid -i -si -cd "$1") + + case "$Raid_Type" in + stripe) + if [ "$Raid_Nodevs" -lt 2 ]; then + if [ -n "$Degraded" ]; then + log_error "Cannot bring up a RAID0 array in degraded mode, not all devices present." + fi + return 2 + fi + ;; + mirror) + if [ "$Raid_Nodevs" -lt 2 ]; then + if [ -z "$Degraded" ]; then + log_error "Raid set $Raid_Name is degraded. Not activating" + return 2 + else + log_warning "Activating $Raid_Name in degraded mode" + Return_Val=3 + fi + fi + ;; + raid5_*) + modprobe -q dm_raid45 + if [ "$Raid_Nodevs" -lt 3 ]; then + if [ -z "$Degraded" ]; then + log_error "Raid set $Raid_Name is degraded. Not activating" + return 2 + else + log_warning "Activating $Raid_Name in degraded mode" + Return_Val=3 + fi + fi + ;; + esac + + # At this point we have the required number of devs, or the user wants the + # array brought up in degraded mode, except in the case of striped arrays. + # We need to know the root device for determining if the -Z flag can be used + # (see #533848 and LP: 392510) + if [ -z "$ROOT" ]; then + for x in $(cat /proc/cmdline); do + case $x in + root=*) + ROOT=${x#root=} + ;; + esac + done + case "$ROOT" in + LABEL=*) + ROOT=$(readlink -f /dev/disk/by-uuid/${ROOT#LABEL=}) + ;; + UUID=*) + ROOT=$(readlink -f /dev/disk/by-uuid/${ROOT#UUID=}) + ;; + esac + else + ROOT=$(readlink -f $ROOT) + fi + + if (echo $ROOT | grep -q $1) ; then + dmraid -i -ay -Z "$1" + else + dmraid -i -ay "$1" + fi + + return $Return_Val +} + +log_warning() +{ + if type logger > /dev/null ; then + logger -t dmraid-activate "WARNING: $1" + else + echo "dmraid-activate: WARNING: $1" + fi +} + +log_error() +{ + if type logger > /dev/null ; then + logger -t dmraid-activate "ERROR: $1" + else + echo "dmraid-activate: ERROR: $1" + fi +} + +ddf1_virtual_drive_names() +{ + ddf1_awk_script="$(cat <<'EOF' +BEGIN { + section = "" + disk_ref = "" + guid_i = 0 + + # Heximal to decimal conversion array + for (i = 0; i <= 9; i++) hex2dec[i] = i + hex2dec["a"] = 10; hex2dec["b"] = 11; hex2dec["c"] = 12 + hex2dec["e"] = 13; hex2dec["d"] = 14; hex2dec["f"] = 15; +} + +function section_begins(name) +{ + section = name + vd_guid = "" + drive_map = 0 +} + +function extract_vd_guid(line, g) +{ + g = substr(line, match(line,/\[[0-9a-f ]+\]$/)+1, RLENGTH-2) + gsub(/ /, "", g) + # IF LSI, do timestamp substitution to get persistent name, see + # 19_ddf1_lsi_persistent_name.patch + if (g ~ /^4c5349/) + g = substr(g, 1, 32) "47114711" substr(g, 41) + return g +} + +function extract_vd_name(line, hex, n, max, i, d1, d2, sed) +{ + n = tolower(substr(line, match(line,/\[[0-9a-f ]+\]$/)+1, RLENGTH-2)) + max = split(n, hex, / /) + + if (max <= 0 || hex[0] == "00") return "" + + # Convert name from hex to string (16 bytes) + n = "" + for (i = 1; i <= max; i++) { + d1 = hex2dec[substr(hex[i], 1, 1)] + d2 = hex2dec[substr(hex[i], 2, 1)] + if ((d1 + d2) == 0) break + n = n sprintf("%c", d1 * 16 + d2) + } + # Shell-escape single quotes in the name + gsub(/'/,"'\\''", n) + # Finally strip non-graph chars from the end of the string + # mawk does not support character classes. Use sed. + sed = "echo '" n "' | sed 's/[^[:graph:]]\+$//'" + sed | getline n + close(sed) + return n +} + +{ + if (!/^0x/ && / at /) { + # Section begins + section_begins(substr($0, 1, match($0, / at /)-1)) + } else if (section == "Disk Data" && /^0x020 reference:[ \t]*[0-9A-Fx]+/) { + disk_ref = $3 + sub(/^0x/, "", disk_ref) + } else if (disk_ref) { + # We need to parse 'Virtual Drive' sections in order to extract VD + # names + if (section == "Virtual Drive") { + if (/^0x000 guid:/) { + vd_guid = extract_vd_guid($0) + } else if (/^0x030 name:/) { + vd_name = extract_vd_name($0) + if (vd_name) + vd_names[vd_guid] = vd_name + } + } else if (section == "Virtual Drive Config Record") { + if (/^0x008 guid:/) { + vd_guid = extract_vd_guid($0) + } else if (drive_map) { + # 0: 4BCBB980 @ 0 + if ($2 == disk_ref) { + guids[guid_i] = vd_guid + guid_i++ + } + } else if (vd_guid) { + drive_map = /^Drive map:/ + } + } + } +} +END { + # Print discovered virtual drive names (or GUIDs) which belong to this + # physical drive + for (guid_i in guids) { + guid = guids[guid_i] + if (guid in vd_names) { + print vd_names[guid] + } else { + print guid + } + } +} +EOF +)" + dmraid -i -n "$1" | awk "$ddf1_awk_script" +} + +if grep -qs "\" /proc/cmdline; then + log_warning "dmraid disabled by boot option" + exit 0 +fi + +modprobe -q dm_mod + +if [ -z "$1" ] || [ "$1" = "--degraded" ] && [ "$#" -lt 2 ]; then + echo "Node name not specified." >&2 + exit 1 +fi + +if [ "$1" = "--degraded" ]; then + Degraded=1 + Node_Name=$2 +else + Node_Name=$1 +fi + +Raid_Name=$(dmraid -i -r -cr /dev/$Node_Name | grep -vi "No RAID disks" | grep -vi "formats discovered") + +if [ -z "$Raid_Name" ]; then + exit 0 +fi + +newline=" +" + +case "$Raid_Name" in + isw_*) + # We need a special case for isw arrays, since it is possible to have several + # subsets of a RAID group, of varying RAID types. + Isw_Group_Name=$Raid_Name + Isw_Subsets=$(dmraid -i -n "/dev/$Node_Name" | grep volume | sed 's/.*volume: " *\(.*\)"$/\1/') + + for isw_subset in $Isw_Subsets + do + activate_array "${Isw_Group_Name}_${isw_subset}" + done + break + ;; + .ddf1_disks) + # Dummy name for the main DDF1 group. Needs special handling to + # find RAID subsets (name or GUID) for this physical drive + Ddf1_names=`ddf1_virtual_drive_names "/dev/$Node_Name"` + + # Returned names might contain space characters. Therefore + # split fields at new line. Use $IFS to avoid forking a new shell + save_IFS="$IFS" + IFS="$newline" + for ddf1_name in $Ddf1_names + do + IFS="$save_IFS" + activate_array "ddf1_${ddf1_name}" + IFS="$newline" + done + IFS="$save_IFS" + break + ;; + *) + activate_array "$Raid_Name" + break + ;; +esac + +exit $Return_Val --- dmraid-1.0.0.rc16.orig/debian/libdmraid1.0.0.rc16.install +++ dmraid-1.0.0.rc16/debian/libdmraid1.0.0.rc16.install @@ -0,0 +1 @@ +debian/standard/lib/*.so.* lib --- dmraid-1.0.0.rc16.orig/debian/dmraid-udeb.install +++ dmraid-1.0.0.rc16/debian/dmraid-udeb.install @@ -0,0 +1,2 @@ +debian/udeb/sbin/dmraid sbin +debian/dmraid-activate sbin --- dmraid-1.0.0.rc16.orig/debian/dmraid.dirs +++ dmraid-1.0.0.rc16/debian/dmraid.dirs @@ -0,0 +1 @@ +usr/share/bug/dmraid --- dmraid-1.0.0.rc16.orig/debian/dmraid.postrm +++ dmraid-1.0.0.rc16/debian/dmraid.postrm @@ -0,0 +1,26 @@ +#!/bin/sh + +set -e + +case "$1" in + remove|purge) + if command -v update-initramfs >/dev/null 2>&1; then + update-initramfs -u + fi + + ;; + upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + + + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + +esac + + +#DEBHELPER# + + --- dmraid-1.0.0.rc16.orig/debian/copyright +++ dmraid-1.0.0.rc16/debian/copyright @@ -0,0 +1,199 @@ +This is the Ubuntu / Debian GNU/Linux prepackaged version of dmraid. + +Packaged by Fabio M. Di Nitto . + +Re-debianized by Giuseppe Iuculano + +It was downloaded from http://people.redhat.com/heinzm/sw/dmraid/ +Upstream Author: Heinz Mauelshagen + +upstream LICENSE +**** + + Copyright (C) 2004-2008 Heinz Mauelshagen, Red Hat GmbH. + Copyright (C) 2006 Darrick Wong, James Simshaw, Adam DiCarlo IBM. + Copyright (c) 2001, 2002, 2004 Adaptec Inc. + Copyright (C) 2004 NVidia Corporation. All rights reserved. + All rights reserved. + + This dmraid code is free software; + you can redistribute and/or modify it under the terms of + the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + dmraid 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 (Lesser) General Public + License along with this dmraid code; if not, write to the Free + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301, USA. + +**** + +On Ubuntu / Debian GNU/Linux systems, the complete text of the GNU +General Public License can be found in `/usr/share/common-licenses/GPL'. +The complete text of the GNU Lesser General Public License can be found in +`/usr/share/common-licenses/LGPL'. + +The Debian packaging is © 2008, Giuseppe Iuculano and +is licensed under the GPL, see `/usr/share/common-licenses/GPL'. + + +1.0.0.rc15/lib/metadata/reconfig.c: + + Copyright (C) 2006 IBM, all rights reserved. + Written by Darrick Wong , + James Simshaw , and + Adam DiCarlo + + Copyright (C) 2006-2008 Heinz Mauelshagen, Red Hat GmbH + All rights reserved + + LICENSE: GPL, see below + +1.0.0.rc15/lib/metadata/metadata.c, 1.0.0.rc15/lib/format/format.c, +1.0.0.rc15/lib/format/ataraid/isw.c, 1.0.0.rc15/lib/device/scsi.c, +1.0.0.rc15/lib/device/scsi.h, 1.0.0.rc15/lib/misc/misc.c, +1.0.0.rc15/lib/activate/activate.c, 1.0.0.rc15/lib/activate/devmapper.c, +1.0.0.rc15/tools/commands.c, 1.0.0.rc15/tools/commands.h, +1.0.0.rc15/tools/toollib.c, 1.0.0.rc15/include/dmraid/lib_context.h, +1.0.0.rc15/include/dmraid/list.h, 1.0.0.rc15/include/dmraid/misc.h, +1.0.0.rc15/include/dmraid/dmraid.h, 1.0.0.rc15/include/dmraid/metadata.h, +1.0.0.rc15/include/dmraid/format.h: + + Copyright (C) 2004-2008 Heinz Mauelshagen, Red Hat GmbH. + All rights reserved + Copyright (C) 2007 Intel Corporation. All rights reserved. + November, 2007 - additions for Create, Delete, Rebuild & Raid 10. + LICENSE: GPL, see below + +1.0.0.rc15/lib/metadata/log_ops.c: + + Copyright (C) 2006 Darrick Wong, IBM + All rights reserved + Copyright (C) 2006 Heinz Mauelshagen, Red Hat GmbH + All rights reserved + LICENSE: GPL, see below + +1.0.0.rc15/lib/format/ataraid/nv.c: + + Copyright (C) 2004 NVidia Corporation. All rights reserved. + Copyright (C) 2004-2008 Heinz Mauelshagen, Red Hat GmbH. + All rights reserved + LICENSE: GPL, see below + +1.0.0.rc15/lib/format/ataraid/asr.c: + + Copyright (C) 2005-2006 IBM, All rights reserved. + Written by Darrick Wong , + James Simshaw , and + Adam DiCarlo + Copyright (C) 2006 Heinz Mauelshagen, Red Hat GmbH + All rights reserved + LICENSE: GPL, see below + +1.0.0.rc15/lib/format/ataraid/nv.h: + + Copyright (C) 2004,2005 NVidia Corporation. All rights reserved. + dmraid extensions: + Copyright (C) 2004,2005 Heinz Mauelshagen, Red Hat GmbH. + LICENSE: GPL, see below + +1.0.0.rc15/lib/format/ataraid/isw.h + + Copyright (C) 2003,2004,2005 Intel Corporation. + dmraid extensions: + Copyright (C) 2004,2005 Heinz Mauelshagen, Red Hat GmbH. + All rights reserved + Authors: Boji Tony Kannanthanam < boji dot t dot kannanthanam at intel dot com > + Martins Krikis < martins dot krikis at intel dot com > + LICENSE: GPL, see below + +1.0.0.rc15/lib/format/ataraid/hpt37x.h: + + Copyright (c) 2000,2001 Søren Schmidt + All rights reserved. + dmraid modifications: + Copyright (C) 2004,2005 Heinz Mauelshagen, Red Hat GmbH. + All rights reserved + LICENSE: + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer, + without modification, immediately at the beginning of the file. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +1.0.0.rc15/lib/format/ataraid/asr.h: + + Copyright (c) 2005-2006 IBM (actual code changes by Darrick Wong) + Copyright (c) 2001, 2002, 2004 Adaptec Inc. + All rights reserved. + + LICENSE: + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer, + without modification, immediately at the beginning of the file. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + + Alternatively, this software may be distributed under the terms of the + GNU General Public License ("GPL") version 2, see below + +1.0.0.rc15/lib/format/ddf/ddf1_dump.c, 1.0.0.rc15/lib/format/ddf/ddf1.c, +1.0.0.rc15/lib/format/ddf/ddf1_cvt.h, 1.0.0.rc15/lib/format/ddf/ddf1_cvt.c, +1.0.0.rc15/lib/format/ddf/ddf1.h, 1.0.0.rc15/lib/format/ddf/ddf1_lib.c, +1.0.0.rc15/lib/format/ddf/ddf1_lib.h, 1.0.0.rc15/lib/format/ddf/ddf1_dump.h: + + Copyright (C) 2005-2006 IBM, All rights reserved. + Written by Darrick Wong + Copyright (C) 2006 Heinz Mauelshagen, Red Hat GmbH + All rights reserved + LICENSE: GPL, see below + +1.0.0.rc15/lib/format/ddf/ddf1_crc.c: + + Copyright (C) 2005-2006 IBM, All rights reserved. + Written by James Simshaw + Copyright (C) 2006-2008 Heinz Mauelshagen, Red Hat GmbH + All rights reserved + LICENSE: GPL, see below + +1.0.0.rc15/include/dmraid/reconfig.h: + + Copyright (C) 2006 Darrick Wong, IBM. + All rights reserved + Copyright (C) 2006-2008 Heinz Mauelshagen Red Hat GmbH. + All rights reserved + LICENSE: GPL, see below + +debian/dmraid-activate: + + (c) 2008 Canonical Ltd. + LICENSE: GPL, see below --- dmraid-1.0.0.rc16.orig/debian/changelog +++ dmraid-1.0.0.rc16/debian/changelog @@ -0,0 +1,533 @@ +dmraid (1.0.0.rc16-4.2) unstable; urgency=low + + * Non-maintainer upload. + * Call udevadm settle before activating dmraid devices + (Closes: #677450) + + -- Ulrich Dangel Mon, 10 Sep 2012 17:35:50 +0100 + +dmraid (1.0.0.rc16-4.1) unstable; urgency=low + + * Non-maintainer upload. + * dmraid-active: properly handle the case when DDF1 virtual drive has a name. + (Closes: #603319) + + -- Modestas Vainius Sat, 18 Dec 2010 22:26:41 +0200 + +dmraid (1.0.0.rc16-4) unstable; urgency=low + + [ Modestas Vainius ] + * [7b2bf79] Make dmraid-activate work with DDF1 arrays by special- + casing their handling. Similar to ISW case, there do not seem to be + a way for getting raid subsets for the physical drive except parsing + native log. (Closes: #603319) + + -- Giuseppe Iuculano Mon, 22 Nov 2010 13:02:29 +0100 + +dmraid (1.0.0.rc16-3) unstable; urgency=low + + * [3bea125] debian/patches/20_fix_isw_sectors_calculation.patch: Fix + isw raid0 incorrect sectors calculation (Closes: #561866) - thanks + to Valentin Pavlyuchenko + * [239630a] Added ${misc:Depends} in Depends + + -- Giuseppe Iuculano Mon, 28 Dec 2009 10:57:55 +0100 + +dmraid (1.0.0.rc16-2) unstable; urgency=low + + * [0819a82] debian/patches/18_pdc_raid10_failure..patch: fix pdc + metadata format handler to report the proper number of devices in a + subset + * [8418d6b] debian/patches/19_ddf1_lsi_persistent_name.patch: Because the + LSI bios changes the timestamp in the metadata on every boot, neutralize + it in order to allow for persistent names. + + -- Giuseppe Iuculano Thu, 26 Nov 2009 11:37:24 +0100 + +dmraid (1.0.0.rc16-1) experimental; urgency=low + + [ Tormod Volden ] + * [aed3ea8] Add support for "nodmraid" boot option + + [ Giuseppe Iuculano ] + * [6ae6d88] Imported Upstream version 1.0.0.rc16 + * [3bdcbf4] Remove old 1.0.0.rc15 directory + * [f2b47d1] Refreshed patches and deleted patches merged in upstream + * [27f877d] SONAME bump, libdmraid1.0.0.rc15 -> libdmraid1.0.0.rc16 + * [8ea0cf4] Updated symbols file + * [e2bd834] debian/patches/02_disable_dmreg.patch: Disabled all dmreg + stuff + * [7339f26] Added 951 disk offset for Promise FastTrak S150 TX2plus + (LP: #465198) - thanks to Even Ambjørnrud + * [fbe64d4] Updated my email address and removed DM-Upload-Allowed + control field + + -- Giuseppe Iuculano Sun, 01 Nov 2009 19:00:41 +0100 + +dmraid (1.0.0.rc15-11) unstable; urgency=low + + * [ce4e2dc] 15_activate_multiple_raid_sets.patch: Continue onto all + raid sets instead of returning after processing the first. (LP: #401713) + * [58a1426] debian/initramfs/dmraid.initramfs-local-top/dmraid: Check + the exit code before parsing output, thanks to Tormod Volden. + (Closes: #542256) (LP: #415280, #376792) + * [91d2b67] Updated to standards version 3.8.3 (No changes needed) + + -- Giuseppe Iuculano Sun, 23 Aug 2009 18:06:13 +0200 + +dmraid (1.0.0.rc15-10) unstable; urgency=low + + * [1a1b752] debian/dmraid-activate: Use the -Z flag only if root + partition is mountd in a dmraid array. + (Closes: #533848) (LP: #392510) + + -- Giuseppe Iuculano Wed, 15 Jul 2009 18:53:52 +0200 + +dmraid (1.0.0.rc15-9) unstable; urgency=low + + [ Giuseppe Iuculano ] + * [ea0c659] debian/rules: Copy the autotools stuff before copying the + 1.0.0.rc15 directory to the build directory. (Closes: #533689) + + [ Luke Yelavich ] + * [317853a] debian/patches/17_isw-probe-hpa.patch: Probe isw disks + with [some] HPA awareness, thanks to Robert Collins + . (LP: #372170) + + [ Giuseppe Iuculano ] + * [89d15f3] debian/initramfs/dmraid.initramfs-hook/dmraid: copy grep + only if if BUSYBOX=n, thanks to Colin Watson (Closes: #534299) + * [a2f0730] Updated to standards version 3.8.2 (No changes needed). + + -- Giuseppe Iuculano Sat, 11 Jul 2009 10:47:47 +0200 + +dmraid (1.0.0.rc15-8) unstable; urgency=low + + * [68f05e2] Fixed some typos in dmraid man page, Thanks A. Costa. + (Closes: #525252) + * [c72bf51] Added grep in initrd, dmraid-activate needs it. (Closes: #528998) + + -- Giuseppe Iuculano Fri, 22 May 2009 19:06:09 +0200 + +dmraid (1.0.0.rc15-7) unstable; urgency=low + + * [c617e81] debian/dmraid.postinst: Do not run update-initramfs if it + is not installed (Closes: #522799) + * [3011c19] debian/patches/16_fix_isw_sectors_calculation.patch: Fix + isw raid0 incorrect sectors calculation, thanks to Valentin + Pavlyuchenko (Closes: #524637) (LP: #337284) + * [9cf5ed5] debian/patches/14_isw-serial-fix.patch: Use Hans de Goede + patch. + * [18ece89] debian/dmraid-activate: grep also for "formats discovered" + when assigns Raid_Name, and do not use "cut" to assign + Isw_Group_Name. In this way dmraid-activate works also for user + having multiple metadata signatures and/or not using initramfs. + (Closes: #523660) + + -- Giuseppe Iuculano Wed, 22 Apr 2009 11:55:49 +0200 + +dmraid (1.0.0.rc15-6) unstable; urgency=low + + * [6af052c] Remove 15_isw_incorrect_status_fix.patch, it causes a + segfault. (Closes: #521104) + + -- Giuseppe Iuculano Wed, 25 Mar 2009 22:34:59 +0100 + +dmraid (1.0.0.rc15-5) unstable; urgency=low + + * [ad6ac87] do not use basename in the local-top initramfs script + (Closes: #520875) + * [b1fc9ec] Added a bug submission control script. It allows Debian's bug + tools to include relevant information in bug reports. + + -- Giuseppe Iuculano Mon, 23 Mar 2009 14:22:17 +0100 + +dmraid (1.0.0.rc15-4) unstable; urgency=low + + * [546b293] debian/patches/05_jmicron-name-fix.patch: Fix segfault + when attempting to generate name for jmicron controllers. Thanks to + danwood76 (LP: #344215) + * [4b3dfa0] debian/patches/15_isw_incorrect_status_fix.patch: fix + incorrect status displayed when disk is missing (isw) + + -- Giuseppe Iuculano Sun, 22 Mar 2009 08:46:25 +0100 + +dmraid (1.0.0.rc15-3) unstable; urgency=low + + * [748a001] debian/patches/14_isw-serial-fix.patch: Change the serial + number scan to only look at the LAST 16 bytes rather than the first. + Thanks Sam Bingner (LP: #267953) + * [9f577ac] debian/patches/09_promise-add-offsets.patch: Added 591 + disk offset locations for Promise RAID metadata. (ASUS M3A equipped + with the SB600 south bridge) + * [7aef2ee] debian/control: Added ${misc:Depends} in Depends + * [7cac457] Updated to standards version 3.8.1 (No changes needed) + + -- Giuseppe Iuculano Sat, 14 Mar 2009 13:13:02 +0100 + +dmraid (1.0.0.rc15-2) unstable; urgency=low + + * [ac0f158] debian/dmraid-activate: Use the newly introduced -Z flag for + dmraid, to instruct the kernel to remove partition device nodes from array + member disks. This means that there is no chance of race conditions with + udev and creating UUID/label symbolic links either for member disk nodes, + or dmraid device-mapper nodes. + + -- Luke Yelavich Fri, 20 Feb 2009 17:31:09 +0100 + +dmraid (1.0.0.rc15-1) unstable; urgency=low + + * [fc70eec] debian/patches/13_rm_partitions.patch: Make -- + rm_partitions work with older kernels which return EINVAL when + trying to remove a partition with a number > 16 - Document -- + rm_partitions in the man page + * [68c7ed1] Added debian/README.source + * Upload to unstable. + + -- Giuseppe Iuculano Mon, 16 Feb 2009 13:50:55 +0100 + +dmraid (1.0.0.rc15-1~exp7) experimental; urgency=low + + [ Luke Yelavich ] + * [aaefbef] debian/initramfs/dmraid.initramfs-hook/dmraid: create udev + rules dir before copying each udev rule + * [fdef4bb] debian/dmraid-activate: Refactor code to allow for special + casing of raid groups and subsets + * [072319d] debian/patches/05_kernel-event-handling.patch: Drop, as + this was breaking RAID0 activation for all metadata types, and the kernel + event handling setup is present in rc15 anyway (Closes: #514798), + (LP: #310928) + * [e1f9960] debian/libdmraid-dev.links: Symlink libdmraid.so since + pointing to a broken symbolic link in the install file causes the + build to FTBFS + + [ Giuseppe Iuculano ] + * [fdd5c72] Bump to debhelper 7 compatibility levels + * [5c20ceb] debian/patches/11_isw-raid10.patch: Fix mismatch between + BIOS and dmraid's view of ISW raid 10 sets + * [4fce3ee] debian/patches/13_rm_partitions.patch: patch adding + rm_partitions cmdline option and functionality + * [ff07846] debian/rules: Use dh_clean -k is deprecated, use dh_prep + and fix dh-clean-k-is-deprecated lintian warning + + -- Giuseppe Iuculano Fri, 13 Feb 2009 09:00:09 +0100 + +dmraid (1.0.0.rc15-1~exp6) experimental; urgency=low + + * [51d68d1] debian/patches/07_isw_metadata_normal_state.patch: Fix + Metadata is not put in the NORMAL state after dmraid rebuild is + started manually + * [8165a84] debian/patches/08_isw_rebuild.patch: Fix ISW Metadata is + corrupted after rebuilding is started + * [0f588f5] debian/control: Fix Vcs-Browser field to play nice with + cl2vcs + * [d832984] Added libdmraid1.0.0.rc15 symbols file + * [f0e50b8] Added description in 07_isw_metadata_normal_state.patch + and 08_isw_rebuild.patch + * [492e108] debian/dmraid-activate: Activate unconditionally isw array + (LP: #310928) + + -- Giuseppe Iuculano Fri, 30 Jan 2009 08:40:41 +0100 + +dmraid (1.0.0.rc15-1~exp5) experimental; urgency=low + + * [f23f890] debian/patches: Deleted old patch 08_promise-metadata- + fixes.dpatch + * [db69b2c] Switch to quilt + * [e40b076] debian/initramfs/dmraid.initramfs-hook/dmraid: New udev in + Ubuntu has the default rules installed into /lib/udev/rules.d, so + refer also to udev rules file in /lib/udev/rules.d + * [fed9520] debian/dmraid-activate: Ignore case distinctions when grep + for "No RAID disks" + * [c85b78f] debian/dmraid.postinst: call udevadm with --action=change + (Closes: #512771), (LP: #320482) + * [8d88132] debian/control: Remove priority and section fields in the + binary package, and fix duplicate-short-description lintian warning + * [1fd2986] Fixed command-with-path-in-maintainer-script lintian + warning + * [36cd8e5] debian/control: Removed initramfs-tools depends + * [b3eb93f] debian/control: Fixed duplicate-long-description lintian + warning + + -- Giuseppe Iuculano Fri, 23 Jan 2009 19:55:42 +0100 + +dmraid (1.0.0.rc15-1~exp4) experimental; urgency=low + + * [e41f5e6] debian/patches/10_exit_code.dpatch: Fix exit-code for "No + RAID disks" and "no block devices found" errors (LP: #300825) + * [3d0a810] debian/rules: don't create a minimal binary for udeb, some + features required from the installer are missing + * [cadad71] debian/patches/07_fix_dmraid_mini_build.dpatch: Removed + + -- Giuseppe Iuculano Sat, 27 Dec 2008 09:26:28 +0100 + +dmraid (1.0.0.rc15-1~exp3) experimental; urgency=low + + * switch to git + * debian/control: + + enabled LED support + + removed pointless configure-initramfs flavour + * debian/patches/06_fix_led_support_compilation.dpatch: fix FTBFS when LED + support is enabled + * debian/patches/07_fix_dmraid_mini_build.dpatch: fix FTBFS with + --enable-mini + * debian/control: create a minimal binary for udeb (--enable-mini) + + -- Giuseppe Iuculano Tue, 23 Dec 2008 08:52:53 +0100 + +dmraid (1.0.0.rc15-1~exp2) experimental; urgency=low + + * debian/control: + + Made the long description for the udeb shorter + + Added initramfs-tools to dmraid Depends + * debian/initramfs/dmraid.initramfs-hook/dmraid: + + Removed blank line added before the 'fi' in the dmraid initramfs-hook. + + check if 85_dmraid.rules or 85-dmraid.rules exists, and then copy it + (LP: #306114) + * debian/patches/02_raid45_to_raid4-5.dpatch: Removed + * debian/dmraid.postinst: initramfs-tools is in Depends, do not check for + update-initramfs (fixed command-with-path-in-maintainer-script lintian + warning) + * debian/dmraid-activate: modprobe also dm_raid45 + * debian/patches/02_scsi_serial_remove_ws.dpatch: remove whitespace from + serial id (LP: #305011) + * debian/copyright: Updated + + -- Giuseppe Iuculano Sun, 14 Dec 2008 10:17:51 +0100 + +dmraid (1.0.0.rc15-1~exp1) experimental; urgency=low + + * New upstream release + * debian/control: + + Added Version Control System location + + Create new packages, libdmraid1, libdmraid-dev and libdmraid1-udeb + respectively. + + Added Luke Yelavich in Uploaders + * Removed debian/initramfs/dmraid.initramfs-local/ + * debian/patches: + + Removed 06_isw-metadata-fixes.dpatch, 10_jmicron-name-fix.dpatch, + 04_generate-uuids.dpatch, 07_isw-raid10-nested.dpatch, + 02_raid45_toraid456.dpatch, 11_fix_segfault_on_big_endian.dpatch + + Added 02_raid45_to_raid4-5.dpatch + + Updated all patches to work with 1.0.0.rc15 + + 04_do_not_use_p_for_partition.dpatch: Removed "p" from device name. A + proper upgrade script is needed before using it. + * debian/rules: + + copy config.sub and config.guess in the right location + + fix mandir location + + added --enable-shared_lib in configure + + Support cross-compiling + * Install dmraid-activate also in dmraid-udeb package + * debian/patches/01_fix_broken_linking.dpatch: + + Create correct symbolic links when building a shared library. + + libdmraid should be linked against libdevmapper when building the shared + library, not the dmraid executable. + * debian/initramfs/dmraid.initramfs-hook/dmraid: Use force_load instead of + manual_add_modules + + -- Giuseppe Iuculano Sat, 19 Nov 2008 21:10:18 +0100 + +dmraid (1.0.0.rc14-6) unstable; urgency=low + + * debian/rules: Added execution rights to + /usr/share/initramfs-tools/scripts/local-top/dmraid + * debian/patches/02_raid45_toraid456.dpatch: Remove, this not fix #411172 + and the new dm-raid45 (not yet in Debian) is using the target that the + dmraid code originally expected. + + -- Giuseppe Iuculano Thu, 06 Nov 2008 08:50:02 +0100 + +dmraid (1.0.0.rc14-5) unstable; urgency=low + + * debian/control: dmraid and dmraid-udeb should depend on dmsetup and + dmsetup-udeb respecitvely, to ensure UUID symlinks are correctly created. + * Place a script in the local-top directory of the initramfs, to catch any + arrays that have not been activated by udev and vol_id. This is because + vol_id does not yet have knowledge of newer array metadata. Thanks to Luke + Yelavich (Workaround for #500883) + * Removed pointless debian/initramfs/dmraid.initramfs-local directory + * debian/patches/12_support_virtio_devices.dpatch: Check virtio devices for + dmraid metadata, patch thanks to Colin Watson . + * Fixed a typo in the previous changelog entry + + -- Giuseppe Iuculano Wed, 22 Oct 2008 01:13:55 +0200 + +dmraid (1.0.0.rc14-4) unstable; urgency=high + + * debian/dmraid.postinst: Activate existing arrays once the package is + installed. (Closes: #498674). Thanks to Luke Yelavich + * debian/patches/00list: Removed 07_isw-raid10-nested.dpatch, it breaks some + Intel raid1 system (Closes: #494278) + * debian/dmraid.udev: watershed isn't in udev package, removed from RUN + command + * Do not install useless usr/share/initramfs-tools/scripts/local-top + * debian/dmraid-activate: Don't take out any locks, added -i + (--ignorelocking) option in every dmraid command executed by + dmraid-activate, and do not use /usr/bin/basename, it is pointless and + breaks fakeraid detection if /usr isn't mounted (Closes: 499060) + * debian/control: Removed lsb-base and added udev in dmraid Depends + + -- Giuseppe Iuculano Sun, 21 Sep 2008 15:54:38 +0200 + +dmraid (1.0.0.rc14-3) unstable; urgency=low + + * debian/patches/09_promise-add-offsets.dpatch: Added 974 disk offset + locations for Promise RAID metadata. (Closes: #489972) + * Run update-initramfs in postrm + * debian/control: Dropped zlib1g-dev build dependency. + * Merge from Ubuntu debian/dmraid.udev: Udev rule to allow dmraid arrays to + be brought up in the event that the member disks of an array are present. + * debian/dmraid.init: Drop, udev helps us start dmraid arrays now. + (Closes: #394399) + * Merge from Ubuntu debian/dmraid-activate: Script to reformat the output of + dmraid to be useful with udev (Do not install in udeb) + * debian/initramfs/dmraid.initramfs-hook/dmraid: Added dmraid-activate, new + udev rule needs it + + -- Giuseppe Iuculano Sun, 31 Aug 2008 14:51:38 +0200 + +dmraid (1.0.0.rc14-2) unstable; urgency=low + + * Merge the following patch from Ubuntu (thanks to Luke Yelavich): + + 04_generate-uuids.dpatch, Generate UUIDs with DMRAID prefix. + (Closes: #489967) + + 05_kernel-event-handling.dpatch, Add support for kernel driver event + handling support. (Closes: #489968) + + 06_isw-metadata-fixes.dpatch, Intel Software RAID metadata fixes. + (Closes: #489969) + + 07_isw-raid10-nested.dpatch, Add RAID10(0+1) nested RAID level support + for Intel Software RAID. (Closes: #489970) + + 08_promise-metadata-fixes.dpatch, Promise metadata fixes. + (Closes: #489971) + + 09_promise-add-offsets.dpatch, Add extra offsets where promise metadata + can be found. (Closes: #489972) + + 10_jmicron-name-fix.dpatch, Fix segfault when attempting to generate + name for jmicron controllers. (Closes: #489973) + * Added 11_fix_segfault_on_big_endian.dpatch (via upstream), it fixes a + segfault on big-endian platforms (ppc) + + -- Giuseppe Iuculano Wed, 09 Jul 2008 09:26:32 +0200 + +dmraid (1.0.0.rc14-1) unstable; urgency=low + + * New upstream release (Closes: #450809) + * New maintainer, thanks to Utnubu Team for the prior work on dmraid + (Closes: #459593) + * Switch to dpatch + - 01_statically_link_against_libz.dpatch (merged) + - 02_raid45_toraid456.dpatch Change raid45 target to raid456 + (Closes: #411172) + - 03_fix_hyphen-used-as-minus-sign.dpatch + * lintian cleaned: + - Calling dh_installdeb after dh_shlibdeps + - Added autotools-dev to Build-Depends, and fix + outdated-autotools-helper-file + - Added watch file + - Fix old-fsf-address-in-copyright-file + - Fix init.d-script-missing-lsb-short-description + - Updated to standards version 3.8.0 + * debian/dmraid.init: Check if /etc/default/rcS exists before sourcing it + * debian/rules: Using dh_install instead of cp for installing initrams + + -- Giuseppe Iuculano Tue, 24 Jun 2008 10:17:33 +0200 + +dmraid (1.0.0.rc13-2.1) unstable; urgency=low + + * Non-maintainer upload to solve release goal. + * Add LSB dependency header to init.d scripts (Closes: #458626) + + -- Petter Reinholdtsen Tue, 18 Mar 2008 17:57:38 +0100 + +dmraid (1.0.0.rc13-2) unstable; urgency=high + + * Apply patch to link libz statically, but only that; works only with GNU + linker, and might break full static linking in the future; thanks Steve + Langasek; catched by Frederic Briere; closes: #396762. + + -- Loic Minier Sun, 5 Nov 2006 17:08:55 +0100 + +dmraid (1.0.0.rc13-1) unstable; urgency=low + + * New upstream release; closes: #391499. + - Update copyright years and copyright holders. + - Update version in debian/rules. + - Supports some new NVIDIA RAID arrays; closes: #391125. + - Add a zlib1g-dev build-dep. + - Configure the standard flavour with --enable-libselinux + --enable-libsepol. + * Merge diff from 0.9.9+1.0.0.rc9-3.1 NMU; acknowledge NMU; thanks + Jonathan McDowell; closes: #367796, #367661. + * Add myself as Uploaders. + * Compute upstream version with dpkg-parsechangelog instead of hardcoding + it. + * Use $(CURDIR) instead of $(shell pwd). + * Fix bashisms; thanks Julien Danjou; closes: #374480. + * Pass --mandir to configure relative to ${prefix}; pass an absolute DESTDIR + to make install. + * Bump up Debhelper compatibility level to 5; partially addresses #375413. + * Bump up Standards-Version to 3.7.2. + * Build a new udeb flavour, configured without selinux and sepol; + closes: #375413. + * Add a .PHONY definition; create the list of configure-$flavour targets + dynamically; misc cleanups. + + -- Loic Minier Sun, 29 Oct 2006 12:01:36 +0100 + +dmraid (0.9.9+1.0.0.rc9-3.1) unstable; urgency=low + + * NMU with permission. + * Move init script from 03 to 04 to ensure we run after udev. + (Closes: #367796) + * Include the initramfs hook and script contributed by Tormod Volden, + so dmraid can integrate effortlessly (closes: launchpad.net/22107) + (Closes: #367661) + + -- Jonathan McDowell Mon, 24 Jul 2006 18:49:11 +0100 + +dmraid (0.9.9+1.0.0.rc9-3) unstable; urgency=low + + * add dmraid-udeb by popular request, looking forward for d-i integration + (Closes: #350250) + + -- Filippo Giunchedi Sat, 11 Feb 2006 13:25:55 +0100 + +dmraid (0.9.9+1.0.0.rc9-2) unstable; urgency=low + + * fix Description: to a more accurate one this closes: #334805 and correctly + indent the item list (closes: #334855) + * fix copyright file with additional informations as per policy 12.5 + (closes: #334856) + * add CHANGELOG to dh_installchangelogs + + -- Filippo Giunchedi Thu, 20 Oct 2005 22:12:42 +0200 + +dmraid (0.9.9+1.0.0.rc9-1) unstable; urgency=low + + * upload to debian on behalf of the utnubu team (closes: #306257) + + -- Filippo Giunchedi Sun, 16 Oct 2005 13:22:24 +0200 + +dmraid (0.9.9+1.0.0.rc9-0ubuntu1) breezy; urgency=low + + * New upstream releasse with tons of fixes. + + * Drop all our local patches (merged by upstream). + + -- Fabio M. Di Nitto Mon, 26 Sep 2005 06:57:21 +0200 + +dmraid (0.9.9+1.0.0.rc8-0ubuntu1) breezy; urgency=low + + * First release. + + * Fix aclocal.m4 to cope properly with --enable-klibc/--disable-klibc. + + * Fix make.tmpl.in to be very loud when building with klibc. + + * Fix make.tmpl.in to understand $(DESTDIR) for mandir and infodir. + + * Fix missing ] in lib/format/ataraid/pdc.c to compile on bigendian + machines. + + * Run init script before mdadm-raid and lvm and stop after. + + -- Fabio M. Di Nitto Thu, 22 Sep 2005 06:56:24 +0200 --- dmraid-1.0.0.rc16.orig/debian/rules +++ dmraid-1.0.0.rc16/debian/rules @@ -0,0 +1,100 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +# export DH_VERBOSE=1 + +include /usr/share/quilt/quilt.make + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) +CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) +else +CROSS= --build $(DEB_BUILD_GNU_TYPE) +endif + +version := $(shell dpkg-parsechangelog | sed -ne 's/^Version: \(.*\)-[^-]*$$/\1/p') +buildroot := $(CURDIR)/debian/build +flavours := standard udeb + +common-config-flags := $(CROSS) --prefix=/usr --exec-prefix=/ + +methods: methods-stamp +methods-stamp: + dh_testdir + mkdir -p ${buildroot} + cp -f /usr/share/misc/config.sub 1.0.0.rc16/autoconf/config.sub + cp -f /usr/share/misc/config.guess 1.0.0.rc16/autoconf/config.guess + for i in ${flavours}; do cp -rp ${version} ${buildroot}/$$i; done + touch $@ + +configure-standard: methods configure-standard-stamp +configure-standard-stamp: + dh_testdir + cd ${buildroot}/standard && \ + ./configure ${common-config-flags} --disable-klibc --enable-libselinux --enable-libsepol --enable-shared_lib --enable-led --enable-intel_led + touch $@ + +configure-udeb: methods configure-udeb-stamp +configure-udeb-stamp: + dh_testdir + cd ${buildroot}/udeb && \ + ./configure ${common-config-flags} --disable-libselinux --disable-libsepol --enable-shared_lib + touch $@ + +configure: methods configure-stamp +configure-stamp: $(addprefix configure-, $(flavours)) + dh_testdir + touch $@ + +build: $(QUILT_STAMPFN) configure build-stamp +build-stamp: + dh_testdir + for i in ${flavours}; do cd ${buildroot}/$$i && make; done + touch $@ + +install: build + dh_testdir + dh_testroot + dh_prep + cd ${buildroot}/standard && make DESTDIR=$(CURDIR)/debian/standard install + cd ${buildroot}/udeb && make DESTDIR=$(CURDIR)/debian/udeb install + rm -rf debian/udeb/usr + dh_link + +binary-arch: install + dh_testdir + dh_testroot + dh_install + dh_installdirs + dh_installudev --priority=85 + dh_installdocs ${version}/CREDITS ${version}/KNOWN_BUGS ${version}/README ${version}/TODO + dh_installchangelogs ${version}/CHANGELOG + install -m0755 debian/dmraid.bug debian/dmraid/usr/share/bug/dmraid/script + chmod 755 debian/dmraid/usr/share/initramfs-tools/hooks/dmraid + chmod 755 debian/dmraid/usr/share/initramfs-tools/scripts/local-top/dmraid + chmod 755 debian/dmraid/sbin/dmraid-activate + dh_strip -a + dh_compress -a + dh_fixperms -a + dh_makeshlibs -a --add-udeb 'libdmraid1.0.0.rc16-udeb' -V + dh_shlibdeps -a + dh_installdeb -a + dh_gencontrol -a + dh_md5sums -a + dh_builddeb -a + +binary-indep: install + # nothing to do + +binary: binary-arch binary-indep + +clean: unpatch + dh_testdir + dh_testroot + dh_clean + rm -f *-stamp + rm -rf debian/build debian/standard debian/udeb +.PHONY: clean binary binary-indep binary-arch install build configure methods $(addprefix configure-, $(flavours)) --- dmraid-1.0.0.rc16.orig/debian/libdmraid1.0.0.rc16.symbols +++ dmraid-1.0.0.rc16/debian/libdmraid1.0.0.rc16.symbols @@ -0,0 +1,53 @@ +libdmraid.so.1.0.0.rc16 libdmraid1.0.0.rc16 #MINVER# + Base@Base 1.0.0.rc16 + _dbg_free@Base 1.0.0.rc16 + _dbg_malloc@Base 1.0.0.rc16 + _dbg_realloc@Base 1.0.0.rc16 + _dbg_strdup@Base 1.0.0.rc16 + add_delimiter@Base 1.0.0.rc16 + add_dev_to_array@Base 1.0.0.rc16 + change_set@Base 1.0.0.rc16 + check_valid_format@Base 1.0.0.rc16 + count_devices@Base 1.0.0.rc16 + count_devs@Base 1.0.0.rc16 + count_sets@Base 1.0.0.rc16 + delete_raidsets@Base 1.0.0.rc16 + discover_devices@Base 1.0.0.rc16 + discover_partitions@Base 1.0.0.rc16 + discover_raid_devices@Base 1.0.0.rc16 + display_devices@Base 1.0.0.rc16 + display_set@Base 1.0.0.rc16 + dm_version@Base 1.0.0.rc16 + dso_end_rebuild@Base 1.0.0.rc16 + dso_get_members@Base 1.0.0.rc16 + erase_metadata@Base 1.0.0.rc16 + find_set@Base 1.0.0.rc16 + get_dm_type@Base 1.0.0.rc16 + get_set_name@Base 1.0.0.rc16 + get_set_type@Base 1.0.0.rc16 + get_status@Base 1.0.0.rc16 + get_type@Base 1.0.0.rc16 + group_set@Base 1.0.0.rc16 + hot_spare_add@Base 1.0.0.rc16 + init_locking@Base 1.0.0.rc16 + lc_inc_opt@Base 1.0.0.rc16 + lc_list@Base 1.0.0.rc16 + lc_opt@Base 1.0.0.rc16 + lc_stralloc_opt@Base 1.0.0.rc16 + lc_strcat_opt@Base 1.0.0.rc16 + lib_perform@Base 1.0.0.rc16 + libdmraid_date@Base 1.0.0.rc16 + libdmraid_exit@Base 1.0.0.rc16 + libdmraid_init@Base 1.0.0.rc16 + libdmraid_make_table@Base 1.0.0.rc16 + libdmraid_version@Base 1.0.0.rc16 + list_formats@Base 1.0.0.rc16 + lock_resource@Base 1.0.0.rc16 + log_alloc_err@Base 1.0.0.rc16 + plog@Base 1.0.0.rc16 + process_sets@Base 1.0.0.rc16 + rebuild_raidset@Base 1.0.0.rc16 + remove_delimiter@Base 1.0.0.rc16 + remove_white_space@Base 1.0.0.rc16 + total_sectors@Base 1.0.0.rc16 + unlock_resource@Base 1.0.0.rc16 --- dmraid-1.0.0.rc16.orig/debian/README.source +++ dmraid-1.0.0.rc16/debian/README.source @@ -0,0 +1,135 @@ +dmraid subversion repository has been converted into a git repository, hosted +at git.debian.org. + +http://git.debian.org/?p=users/derevko-guest/dmraid.git +git://git.debian.org/git/users/derevko-guest/dmraid.git + +For dmraid-debian developers: + +git clone ssh://@git.debian.org/git/users/derevko-guest/dmraid.git + + +== Best practices == + +* debian/changelog + +Do not update your change in debian/changelog, we will use git-dch(1) before +doing a release or anytime between releases. + +The simplest way is doing all the changes to the debian-branch without touching +debian/changelog at all. Then, when done, do: + +git-dch --release + +This will look up the latest released version in the changelog, increment the +version in the Debian changelog, generate changelog messages from the +corresponding Git commit id up to the branch head and finally spawns an editor +for final changelog file editing by invoking dch --release. + +But what if you want to have an (unreleased) snapshot for intermediate testing: + +git-dch --snapshot + +will generate a snapshot release with a specially crafted version number and a +warning in the changelog that this is a snapshort release: + +git-buildpackage (0.3.7~1.gbp470ce2) UNRELEASED; urgency=low + + ** SNAPSHOT build @470ce29ec7877705c844474a2fd89869aea0406d ** + + * add support for automatic snapshot + +During subsequent calls with --snapshot this version number will continue to +increase. Since the snapshot banners contains the commit id of the current +branch head, git-dch can figure out what to append to the changelog by itself: + +git-dch --snapshot --auto + +will fetch the commit id and add changelog entries from that point to the +current HEAD - again auto incrementing the version number. If you don't want to +start at that commit id, you can specify any id or tag with: + +git-dch --since=e76a6a180a57701ae4ae381f74523cacb3152780 --snapshot + +After testing you can remove the snapshot header by a final git-dch call: + +git-dch --since=HEAD --release + +This will add no further entries but simply remove the specially crafted version +number and the snapshort header. Again you can use any commit id or tag instead +of HEAD if you want to add further changelog entries - or you can (of course) +use --auto again. + + +* git commit + +Usually changelog entries should correspond to a single Git commit. In this case +it's convenient to include the commit id in the changelog entry. This has the +advantage that it's easy for people to identify changes without having to write +very extensive changelog messages - the link back to Git can be automated via +the Vcs-Browser and Vcs-Git fields in debian/control. + +See Cl2vcs for how this looks: https://honk.sigxcpu.org/cl2vcs/index.cgi?pkg=dmraid + +For this reason it´s a good idea to begin the commit message with a single +line summarizing the change (it will be the changelog entry, so add the Close: +or LP: entry), followed by a blank line and then a more thorough description. + + +* Configuration files + +Here my configuration files, if you like cowbuilder you can use them. + +~/.gbp.conf : + +[DEFAULT] +builder = /usr/bin/git-pbuilder +cleaner = fakeroot debian/rules clean +pristine-tar = True + +[git-buildpackage] +export-dir = ../build-area/ +tarball-dir = ../tarballs/ +sign-tags = True +#keyid = 0xAE3BE9AA +[git-dch] +id-length=7 +meta=True + + + + +~/.gitconfig + +[user] + name = Giuseppe Iuculano + email = giuseppe@iuculano.it +[color] + diff = auto + status = auto + branch = auto +[branch "master"] + remote = origin + merge = refs/heads/master +[branch "upstream"] + remote = origin + merge = refs/heads/upstream +[branch "pristine-tar"] + remote = origin + merge = refs/heads/pristine-tar + + + + + +/usr/bin/git-pbuilder + +#!/bin/sh +# +# pbuilder helper for git-buildpackage +# use this as "builder" in gbp.conf +set -e + +# pass all options to dpkg-buildpackage: +pdebuild --pbuilder cowbuilder --auto-debsign --debsign-k AE3BE9AA $PBUILDER_OPTS --debbuildopts "-i\.git/ -I.git $*" + --- dmraid-1.0.0.rc16.orig/debian/libdmraid-dev.links +++ dmraid-1.0.0.rc16/debian/libdmraid-dev.links @@ -0,0 +1 @@ +lib/libdmraid.so.1.0.0.rc15 usr/lib/libdmraid.so --- dmraid-1.0.0.rc16.orig/debian/dmraid.bug +++ dmraid-1.0.0.rc16/debian/dmraid.bug @@ -0,0 +1,88 @@ +#!/bin/bash +# +# dmraid bug submission control script +# +# allows Debian's bug tools to include relevant information in bug reports. +# +# based on mdadm bug submission control script +# +set +eu + +if ! command -v yesno >/dev/null; then + if [ -r /usr/share/reportbug/handle_bugscript ]; then + exec /usr/share/reportbug/handle_bugscript ". $0" /dev/stdout + fi + yesno() { + read -n1 -p"$1" REPLY + case "$REPLY" in + [yY]) REPLY=yep;; + [nN]) REPLY=nop;; + ('') REPLY="$2";; + esac + } + exec 3>&1 +fi + +root=$(id -u) + +echo "--- dmraid -r -vvv output" >&3 +if ! [ "$root" = "0" ] ;then + echo "Only root can run dmraid -r -vvv, please type the root password" + su root -c "dmraid -r -vvv" >&3 +else + dmraid -r -vvv >&3 +fi + +echo >&3 + + +echo "--- dmraid -s -vv output" >&3 +if ! [ "$root" = "0" ] ;then + echo "Only root can run dmraid -s -vv, please type the root password" + su root -c "dmraid -s -vv" >&3 +else + dmraid -s -vv >&3 +fi +echo >&3 + +echo "--- /proc/partitions:" >&3 +cat /proc/partitions >&3 2>&3 || : +echo >&3 + +echo "--- initrd.img-$(uname -r):" >&3 +if [ -r /boot/initrd.img-$(uname -r) ]; then + zcat /boot/initrd.img-$(uname -r) 2>&3 | cpio -t 2>&3 | egrep '/md[a/]' >&3 +fi +echo >&3 + +if [ -r /proc/modules ]; then + echo "--- /proc/modules:" >&3 + grep 'dm_' < /proc/modules >&3 || : + echo >&3 +fi + +if [ -r /proc/cmdline ]; then + echo "--- /proc/cmdline" >&3 + cat /proc/cmdline >&3 + echo >&3 +fi + +if [ -f /boot/grub/menu.lst ]; then + echo "--- grub:" >&3 + if [ -r /boot/grub/menu.lst ]; then + grep '^[^#].*root=' /boot/grub/menu.lst >&3 || : + else + echo menu.lst file not readable. >&3 + fi + echo >&3 +fi + +if [ -f /etc/lilo.conf ]; then + echo "--- lilo:" >&3 + if [ -r /etc/lilo.conf ]; then + egrep '^([^#].*)?root=' /etc/lilo.conf >&3 || : + else + echo lilo.conf file not readable. >&3 + fi + echo >&3 +fi --- dmraid-1.0.0.rc16.orig/debian/control +++ dmraid-1.0.0.rc16/debian/control @@ -0,0 +1,84 @@ +Source: dmraid +Section: admin +Priority: optional +Maintainer: Giuseppe Iuculano +Uploaders: Luke Yelavich +Standards-Version: 3.8.3 +Build-Depends: debhelper (>= 7), libdevmapper-dev, libklibc-dev, libselinux1-dev, quilt (>= 0.40), autotools-dev +Vcs-git: git://git.debian.org/git/users/derevko-guest/dmraid.git +Vcs-Browser: http://git.debian.org/?p=users/derevko-guest/dmraid.git +Homepage: http://people.redhat.com/~heinzm/sw/dmraid/ + +Package: dmraid +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, udev, dmsetup +Description: Device-Mapper Software RAID support tool + dmraid discovers, activates, deactivates and displays properties + of software RAID sets (eg, ATARAID) and contained DOS partitions. + . + dmraid uses the Linux device-mapper to create devices with respective + mappings for the ATARAID sets discovered. + . + The following formats are supported: + Highpoint HPT37X/HPT45X + Intel Software RAID + LSI Logic MegaRAID + NVidia NForce RAID (nvraid) + Promise FastTrack + Silicon Image(tm) Medley(tm) + VIA Software RAID + . + Please read the documentation in /usr/share/doc/dmraid BEFORE attempting + any use of this software. Improper use can cause data loss! + +Package: dmraid-udeb +Architecture: any +Section: debian-installer +XC-Package-Type: udeb +Depends: ${shlibs:Depends}, dmsetup-udeb +Description: Device-Mapper Software RAID support tool (udeb) + dmraid discovers, activates, deactivates and displays properties + of software RAID sets (eg, ATARAID) and contained DOS partitions. + . + This is the minimal package (udeb) used by debian-installer + +Package: libdmraid1.0.0.rc16-udeb +Architecture: any +Section: debian-installer +XC-Package-Type: udeb +Depends: ${shlibs:Depends} +Description: Device-Mapper Software RAID support tool - shared library (udeb) + dmraid discovers, activates, deactivates and displays properties + of software RAID sets (eg, ATARAID) and contained DOS partitions. + . + This is the minimal package (udeb shared library) used by debian-installer + +Package: libdmraid1.0.0.rc16 +Architecture: any +Section: libs +Depends: ${shlibs:Depends}, ${misc:Depends} +Replaces: libdmraid1.0.0.rc15 (<< 1.0.0.rc16-1) +Description: Device-Mapper Software RAID support tool - shared library + dmraid discovers, activates, deactivates and displays properties + of software RAID sets (eg, ATARAID) and contained DOS partitions. + . + dmraid uses the Linux device-mapper to create devices with respective + mappings for the ATARAID sets discovered. + . + This package contains the dmraid shared library, which implements + the back half of dmraid, including on-disk metadata formats. + +Package: libdmraid-dev +Architecture: any +Section: libdevel +Depends: libdmraid1.0.0.rc16 (= ${binary:Version}), ${misc:Depends} +Description: Device-Mapper Software RAID support tool - header files + dmraid discovers, activates, deactivates and displays properties + of software RAID sets (eg, ATARAID) and contained DOS partitions. + . + dmraid uses the Linux device-mapper to create devices with respective + mappings for the ATARAID sets discovered. + . + This package contains the header files needed to link programs against + dmraid. + --- dmraid-1.0.0.rc16.orig/debian/libdmraid1.0.0.rc16-udeb.install +++ dmraid-1.0.0.rc16/debian/libdmraid1.0.0.rc16-udeb.install @@ -0,0 +1 @@ +debian/udeb/lib/*.so.* lib --- dmraid-1.0.0.rc16.orig/debian/compat +++ dmraid-1.0.0.rc16/debian/compat @@ -0,0 +1 @@ +7 --- dmraid-1.0.0.rc16.orig/debian/libdmraid-dev.install +++ dmraid-1.0.0.rc16/debian/libdmraid-dev.install @@ -0,0 +1,2 @@ +debian/standard/lib/*.a usr/lib +debian/standard/usr/include/dmraid usr/include --- dmraid-1.0.0.rc16.orig/debian/initramfs/dmraid.initramfs-hook/dmraid +++ dmraid-1.0.0.rc16/debian/initramfs/dmraid.initramfs-hook/dmraid @@ -0,0 +1,47 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +. /usr/share/initramfs-tools/hook-functions + +if [ -x /sbin/dmraid ]; then + force_load dm-mod + force_load dm-mirror + force_load dm-raid45 + copy_exec /sbin/dmraid sbin + copy_exec /sbin/dmraid-activate sbin + if [ "$BUSYBOX" = n ]; then + copy_exec /bin/grep bin + fi + if [ -f /etc/udev/rules.d/85_dmraid.rules ]; then + mkdir -p ${DESTDIR}/etc/udev/rules.d + cp -p /etc/udev/rules.d/85_dmraid.rules ${DESTDIR}/etc/udev/rules.d + fi + if [ -f /etc/udev/rules.d/85-dmraid.rules ]; then + mkdir -p ${DESTDIR}/etc/udev/rules.d + cp -p /etc/udev/rules.d/85-dmraid.rules ${DESTDIR}/etc/udev/rules.d + fi + if [ -f /lib/udev/rules.d/85_dmraid.rules ]; then + mkdir -p ${DESTDIR}/lib/udev/rules.d + cp -p /lib/udev/rules.d/85_dmraid.rules ${DESTDIR}/lib/udev/rules.d + fi + if [ -f /lib/udev/rules.d/85-dmraid.rules ]; then + mkdir -p ${DESTDIR}/lib/udev/rules.d + cp -p /lib/udev/rules.d/85-dmraid.rules ${DESTDIR}/lib/udev/rules.d + fi +fi + +exit 0 --- dmraid-1.0.0.rc16.orig/debian/initramfs/dmraid.initramfs-local-top/dmraid +++ dmraid-1.0.0.rc16/debian/initramfs/dmraid.initramfs-local-top/dmraid @@ -0,0 +1,28 @@ +#!/bin/sh + +# local-top script for dmraid. + +PREREQS="" +prereqs() +{ + echo $PREREQS +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +. /scripts/functions +wait_for_udev 30 + +# Activate any dmraid arrays that were not identified by udev and vol_id. + +if devices=$(dmraid -r -c); then + for dev in $devices; do + dmraid-activate $dev + done +fi --- dmraid-1.0.0.rc16.orig/debian/patches/01_fix_broken_linking.patch +++ dmraid-1.0.0.rc16/debian/patches/01_fix_broken_linking.patch @@ -0,0 +1,121 @@ +Author: Luke Yelavich +Description: Fix library symbolic link creation and library linking. +--- a/1.0.0.rc16/configure ++++ b/1.0.0.rc16/configure +@@ -693,6 +693,7 @@ DEBUG_MALLOC + DMRAID_TEST + DMRAID_VERSION + DMRAID_LIB_VERSION ++DMRAID_LIB_MAJOR_VERSION + DIETLIBC + GROUP + JOBS +@@ -5767,8 +5768,10 @@ fi + + if test "-f lib/version.h"; then + DMRAID_LIB_VERSION="`sed --quiet 's/^.*\(DMRAID_LIB_VERSION\)[^_].*"\(.*\)"/\2/p' lib/version.h`" ++ DMRAID_LIB_MAJOR_VERSION="`grep DMRAID_LIB_MAJOR_VERSION lib/version.h | tr '\t' ' ' | cut -f 3 -d ' '`" + else + DMRAID_LIB_VERSION="Unknown" ++ DMRAID_LIB_MAJOR_VERSION="Unknown" + fi + + +--- a/1.0.0.rc16/configure.in ++++ b/1.0.0.rc16/configure.in +@@ -178,7 +178,7 @@ if test x$DEBUG_MALLOC = xyes; then + fi + + dnl Mess with default exec_prefix +-if [[ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ]]; ++if [ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ]; + then exec_prefix=""; + fi; + +@@ -220,8 +220,10 @@ fi + + if test "-f lib/version.h"; then + DMRAID_LIB_VERSION="`sed --quiet 's/^.*\(DMRAID_LIB_VERSION\)[[^_]].*"\(.*\)"/\2/p' lib/version.h`" ++ DMRAID_LIB_MAJOR_VERSION="`grep DMRAID_LIB_MAJOR_VERSION lib/version.h | tr '\t' ' ' | cut -f 3 -d ' '`" + else + DMRAID_LIB_VERSION="Unknown" ++ DMRAID_LIB_MAJOR_VERSION="Unknown" + fi + + AC_SUBST(CC) +@@ -232,6 +234,7 @@ AC_SUBST(DEBUG_MALLOC) + AC_SUBST(DMRAID_TEST) + AC_SUBST(DMRAID_VERSION) + AC_SUBST(DMRAID_LIB_VERSION) ++AC_SUBST(DMRAID_LIB_MAJOR_VERSION) + AC_SUBST(DIETLIBC) + AC_SUBST(GROUP) + AC_SUBST(JOBS) +--- a/1.0.0.rc16/lib/Makefile.in ++++ b/1.0.0.rc16/lib/Makefile.in +@@ -65,6 +65,11 @@ ifeq ("@KLIBC@", "no") + LIB_EVENTS_SHARED=$(top_srcdir)/lib/$(LIB_EVENTS_NAME).so + TARGETS += $(LIB_SHARED) $(LIB_EVENTS_SHARED) + INSTALL_TARGETS += $(LIB_SHARED) $(LIB_EVENTS_SHARED) ++ ifeq ("@DIETLIBC@", "yes") ++ LIBDMRAIDLIBS += -ldevmapper_dietc ++ else ++ LIBDMRAIDLIBS += -ldevmapper ++ endif + endif + endif + +@@ -82,10 +87,11 @@ install_dmraid_libs: $(INSTALL_TARGETS) + for f in $(INSTALL_TARGETS); \ + do \ + n=$$(basename $${f}) ; \ +- if [[ "$$n" =~ '.so$$' ]]; then \ ++ if echo "$$n" | grep -q '.so$$'; then \ + $(INSTALL) -m 555 $(STRIP) \ + $$f $(libdir)/$${n}.@DMRAID_LIB_VERSION@; \ +- $(LN_S) -f $${n}.@DMRAID_LIB_VERSION@ $(libdir)/$${n}; \ ++ mkdir -p $(prefix)/lib; \ ++ cd $(prefix)/lib/ && $(LN_S) -f /lib/$${n}.@DMRAID_LIB_VERSION@ $${n}; \ + else \ + $(INSTALL) -m 555 $(STRIP) $$f $(libdir)/$${n}; \ + fi \ +--- a/1.0.0.rc16/make.tmpl.in ++++ b/1.0.0.rc16/make.tmpl.in +@@ -44,6 +44,7 @@ endif + OWNER = @OWNER@ + GROUP = @GROUP@ + DMRAID_LIB_VERSION = @DMRAID_LIB_VERSION@ ++DMRAID_LIB_MAJOR_VERSION = @DMRAID_LIB_MAJOR_VERSION@ + + # The number of jobs to run, if blank, defaults to the make standard + ifndef MAKEFLAGS +@@ -136,7 +137,7 @@ $(TARGETS): $(OBJECTS) + + %.so: $(OBJECTS) + $(CC) -shared -Wl,-soname,$(notdir $@).$(DMRAID_LIB_VERSION) \ +- -Wl,--version-script,.export.sym $(OBJECTS) -o $@ -ldevmapper-event ++ -Wl,--version-script,.export.sym $(OBJECTS) $(LIBDMRAIDLIBS) -o $@ -ldevmapper-event + + $(LIB_STATIC): $(OBJECTS) + $(RM) $@ +--- a/1.0.0.rc16/tools/Makefile.in ++++ b/1.0.0.rc16/tools/Makefile.in +@@ -34,12 +34,16 @@ ifeq ("@KLIBC@", "yes") + DMRAIDLIBS += -ldevmapper_klibc + else + ifeq ("@DIETLIBC@", "yes") +- DMRAIDLIBS += -ldevmapper_dietc ++ ifeq ("@LIB_SO@", "no") ++ DMRAIDLIBS += -ldevmapper_dietc ++ endif + ifeq ("@STATIC_LINK@", "no") + DMEVENTTOOLLIBS = -ldevmapper-event_dietc + endif + else +- DMRAIDLIBS += -ldevmapper ++ ifeq ("@LIB_SO@", "no") ++ DMRAIDLIBS += -ldevmapper ++ endif + ifeq ("@STATIC_LINK@", "no") + DMEVENTTOOLLIBS = -ldevmapper-event + endif --- dmraid-1.0.0.rc16.orig/debian/patches/04_do_not_use_p_for_partition.patch +++ dmraid-1.0.0.rc16/debian/patches/04_do_not_use_p_for_partition.patch @@ -0,0 +1,13 @@ +Author: Giuseppe Iuculano +Description: Removed "p" from device name. A proper upgrade script is needed before using it. +--- a/1.0.0.rc16/lib/format/partition/dos.c ++++ b/1.0.0.rc16/lib/format/partition/dos.c +@@ -31,7 +31,7 @@ _name(struct lib_context *lc, struct rai + { + const char *base = get_basename(lc, rd->di->path); + +- return type ? snprintf(str, len, "%s%s%u", base, OPT_STR_PARTCHAR(lc), ++ return type ? snprintf(str, len, "%s%u", base, + partition) : snprintf(str, len, "%s", base); + } + --- dmraid-1.0.0.rc16.orig/debian/patches/09_promise-add-offsets.patch +++ dmraid-1.0.0.rc16/debian/patches/09_promise-add-offsets.patch @@ -0,0 +1,13 @@ +Author: Luke Yelavich +Description: Add extra offsets where promise metadata can be found. +--- a/1.0.0.rc16/lib/format/ataraid/pdc.h ++++ b/1.0.0.rc16/lib/format/ataraid/pdc.h +@@ -13,7 +13,7 @@ + + #include + +-#define PDC_CONFIGOFFSETS 63,255,256,16,399,591,675,735,974,991 ++#define PDC_CONFIGOFFSETS 63,255,256,16,399,591,675,735,974,991,911,951 + #define PDC_DATAOFFSET 0 + + /* --- dmraid-1.0.0.rc16.orig/debian/patches/15_isw_incorrect_status_fix.patch +++ dmraid-1.0.0.rc16/debian/patches/15_isw_incorrect_status_fix.patch @@ -0,0 +1,322 @@ +Patch include: + fix for "Incorrect status displayed when disk is missing" issue. + fix for "Missing supported RAID configuration in "-l" option" - Bugzilla bug +479395 + fix for "Wrong disk layout in raid01" - no Bugzilla bug. +--- a/1.0.0.rc15/lib/format/ataraid/isw.c ++++ b/1.0.0.rc15/lib/format/ataraid/isw.c +@@ -4,8 +4,11 @@ + * Copyright (C) 2004-2008 Heinz Mauelshagen, Red Hat GmbH. + * All rights reserved. + * +- * Copyright (C) 2007,2008 Intel Corporation. All rights reserved. ++ * Copyright (C) 2007,2009 Intel Corporation. All rights reserved. + * November, 2007 - additions for Create, Delete, Rebuild & Raid 10. ++ * March, 2008 - additions for hot-spare check ++ * August, 2008 - support for Activation, Rebuild checks ++ * January, 2009 - additions for Activation, Rebuild check + * + * See file LICENSE at the top of this source tree for license information. + */ +@@ -162,7 +165,7 @@ name(struct lib_context *lc, struct raid + + while (i--) { + if (disk == isw->disk + i) { +- id = i / 2; ++ id = i % 2; + goto ok; + } + } +@@ -479,7 +482,7 @@ isw_read_extended(struct lib_context *lc + /* Read extended metadata to offset ISW_DISK_BLOCK_SIZE */ + if (blocks > 1 && + !read_file(lc, handler, di->path, +- (void *) isw_tmp + ISW_DISK_BLOCK_SIZE, ++ (void *) (((uint8_t*)isw_tmp) + ISW_DISK_BLOCK_SIZE), + *size - ISW_DISK_BLOCK_SIZE, *isw_sboffset)) { + dbg_free(isw_tmp); + isw_tmp = NULL; +@@ -708,6 +711,7 @@ super_created(struct raid_set *super, vo + super->stride = ((struct isw_dev *) private)->vol.map.blocks_per_strip; + } + ++ + /* + * rs_group contains the top-level group RAID set (type: t_group) on entry + * and shall be returned on success (or NULL on error). +@@ -1112,6 +1116,15 @@ isw_metadata_handler(struct lib_context + + break; /* case GET_REBUILD_DRIVE_NO */ + ++ case ALLOW_ACTIVATE: /* same as ALLOW_REBUILD */ ++ case ALLOW_REBUILD: ++ /* Do not allow activate or rebuild, if the log is non-empty */ ++ isw = META (rd, isw); ++ ret = !isw->bbm_log_size; /* Is log empty */ ++ if (!ret) ++ log_err(lc, "BBM entries detected!"); ++ break; /* case ALLOW_REBUILD */ ++ + default: + LOG_ERR(lc, 0, "%u not yet supported", command); + +@@ -1144,16 +1157,25 @@ check_rd(struct lib_context *lc, struct + struct raid_dev *rd, void *context) + { + struct isw_dev *dev = rd->private.ptr; +- +- /* FIXME: more status checks ? */ +- if (dev->status) { ++ if (dev == NULL) ++ if (rd->type == t_spare) return 1; ++ else { ++ LOG_ERR(lc, 0, "No information about %s device on %s " ++ "in RAID set \"%s\"", ++ handler, rd->di->path, rs->name); ++ return 0; ++ } ++ /* if disk is ready to read and write return 1 */ ++ if ((dev->status & ISW_DEV_READ_COALESCING) ++ && (dev->status & ISW_DEV_WRITE_COALESCING)) { ++ return 1; ++ } ++ else { + LOG_ERR(lc, 0, "%s device for volume \"%s\" broken on %s " + "in RAID set \"%s\"", + handler, dev->volume, rd->di->path, rs->name); +- ++ return 0; + } +- +- return 1; + } + + static int +@@ -1622,6 +1644,7 @@ _isw_create_first_volume(struct lib_cont + isw->attributes = MPB_ATTRIB_CHECKSUM_VERIFY; + isw->num_raid_devs = (rs->type == ISW_T_SPARE) ? 0 : 1; + isw->family_num = isw->orig_family_num = _checksum(isw) + time(NULL); ++ isw->bbm_log_size = 0; + isw->check_sum = 0; + isw->check_sum = _checksum(isw); + return isw; +@@ -1719,6 +1742,7 @@ _isw_create_second_volume(struct lib_con + isw->generation_num++; + isw->attributes = MPB_ATTRIB_CHECKSUM_VERIFY; + isw->num_raid_devs++; ++ isw->bbm_log_size = 0; + isw->check_sum = 0; + isw->check_sum = _checksum(isw); + return isw; +@@ -1941,6 +1965,8 @@ _isw_log(struct lib_context *lc, struct + DP("error_log_pos: %u", isw, isw->error_log_pos); + DP("cache_size: %u", isw, isw->cache_size); + DP("orig_family_num: %u", isw, isw->orig_family_num); ++ DP ("power_cycle_count: %u", isw, isw->power_cycle_count); ++ DP ("bbm_log_size: %u", isw, isw->bbm_log_size); + + for (i = 0; i < ISW_FILLERS; i++) { + if (isw->filler[i]) +@@ -2296,7 +2322,7 @@ isw_delete(struct lib_context *lc, struc + static struct dmraid_format isw_format = { + .name = HANDLER, + .descr = "Intel Software RAID", +- .caps = "0,1,01", ++ .caps = "0,1,5,01", + .format = FMT_RAID, + .read = isw_read, + .write = isw_write, +--- a/1.0.0.rc15/lib/format/format.c ++++ b/1.0.0.rc15/lib/format/format.c +@@ -260,6 +260,7 @@ write_metadata(struct lib_context *lc, c + return 1; + } + ++ + /* + * Check devices in a RAID set. + * +@@ -277,7 +278,7 @@ _check_raid_set(struct lib_context *lc, + void *context), + void *f_check_context, const char *handler) + { +- unsigned int devs; ++ unsigned int dev_tot_qan; + uint64_t sectors; + struct raid_dev *rd; + +@@ -285,36 +286,73 @@ _check_raid_set(struct lib_context *lc, + return; + + sectors = total_sectors(lc, rs); +- rs->total_devs = devs = count_devs(lc, rs, ct_dev); ++ rs->total_devs = dev_tot_qan = count_devs(lc, rs, ct_dev); + list_for_each_entry(rd, &rs->devs, devs) { +- unsigned int devices = f_devices(rd, f_devices_context); ++ unsigned int dev_found_qan = f_devices(rd, f_devices_context); + /* FIXME: error if the metadatas aren't all the same? */ +- rs->found_devs = devices; ++ rs->found_devs = dev_found_qan; + + log_dbg(lc, "checking %s device \"%s\"", handler, rd->di->path); +- if (T_SPARE(rd) && rs->type == t_raid1 && /* FIXME: rs->type check ? */ +- rd->sectors != sectors) { +- rd->status = s_inconsistent; +- log_err(lc, "%s: size mismatch in set \"%s\", spare " +- "\"%s\"", handler, rs->name, rd->di->path); +- continue; +- } +- +- if (devs != devices && +- f_check && !f_check(lc, rs, rd, f_check_context)) { +- rd->status = s_broken; +- log_err(lc, "%s: wrong # of devices in RAID " +- "set \"%s\" [%u/%u] on %s", +- handler, rs->name, devs, devices, rd->di->path); +- } else +- rd->status = s_ok; ++ /* if disks number of found disks equals disk expected status status OK */ ++ if ((dev_tot_qan == dev_found_qan) && f_check ++ && f_check(lc, rs, rd, f_check_context)) { ++ rd->status = s_ok; ++ } ++ else { ++ if(dev_tot_qan != dev_found_qan) { ++ log_err(lc, "%s: wrong # of devices in RAID " ++ "set \"%s\" [%u/%u] on %s", ++ handler, rs->name, dev_tot_qan, dev_found_qan, rd->di->path); ++ } ++ /* if number of disks is incorrect, status depends on raid type: */ ++ switch(rs->type) { ++ case t_linear: ++ case t_raid0: /* raid 0 - always broken */ ++ rd->status = s_broken; ++ break; ++ case t_raid1: /* raid 1 - if at least 1 disk- inconsintent */ ++ if(dev_tot_qan >= 1) ++ rd->status = s_inconsistent; ++ else if (T_SPARE(rd) && rd->sectors != sectors) { ++ rd->status = s_inconsistent; ++ log_err(lc, "%s: size mismatch in set \"%s\", spare " ++ "\"%s\"", handler, rs->name, rd->di->path); ++ } ++ else rd->status = s_broken; ++ break; ++ case t_raid4: ++ case t_raid5_ls: ++ case t_raid5_rs: ++ case t_raid5_la: ++ case t_raid5_ra: /* raid 4/5 - if 1 disk missing- inconsistent */ ++ if((dev_tot_qan == (dev_found_qan-1) && dev_tot_qan > 1 ++ && f_check && f_check(lc, rs, rd, f_check_context)) ++ || (dev_tot_qan > dev_found_qan)) ++ rd->status = s_inconsistent; ++ else rd->status = s_broken; ++ break; ++ case t_raid6: /* raid 6 - if up to 2 disks missing- inconsistent */ ++ if((dev_tot_qan >= (dev_found_qan-2) ++ && f_check && f_check(lc, rs, rd, f_check_context)) ++ || (dev_tot_qan > dev_found_qan)) ++ rd->status = s_inconsistent; ++ else rd->status = s_broken; ++ break; ++ ++ case t_spare: /* spare - always broken */ ++ rd->status = s_broken; ++ break; ++ default: /* other - undef */ ++ rd->status = s_undef; ++ } ++ } + } + } + + /* + * Update RAID set state based on operational subsets/devices. + * +- * In case of a RAID set hierachy, check availability of subsets ++ f a RAID set hierachy, check availability of subsets + * and set superset to broken in case *all* subsets are broken. + * If at least one is still available, set to inconsistent. + * +@@ -323,12 +361,19 @@ _check_raid_set(struct lib_context *lc, + */ + static void + _set_rs_status(struct lib_context *lc, struct raid_set *rs, +- unsigned int i, unsigned int operational) ++ unsigned int i, unsigned int operational, ++ unsigned int inconsist, unsigned int subsets_raid01) + { +- if (operational == i) ++ if (subsets_raid01 == 1) { ++ rs->status = s_broken; ++ return; ++ } ++ if (operational == i) + rs->status = s_ok; + else if (operational) + rs->status = s_inconsistent; ++ else if (inconsist) ++ rs->status = s_inconsistent; + else + rs->status = s_broken; + +@@ -338,26 +383,30 @@ _set_rs_status(struct lib_context *lc, s + static int + set_rs_status(struct lib_context *lc, struct raid_set *rs) + { +- unsigned int i = 0, operational = 0; ++ unsigned int i = 0, operational = 0, subsets_raid01 = 0, inconsist = 0; + struct raid_set *r; + struct raid_dev *rd; + + /* Set status of subsets. */ + list_for_each_entry(r, &rs->sets, list) { + /* Check subsets to set status of superset. */ +- i++; ++ if((rs->type == t_raid0) && (r->type == t_raid1)) ++ subsets_raid01++; /* Count subsets for raid 01 */ ++ i++; /* Count subsets*/ + if (S_OK(r->status) || S_INCONSISTENT(r->status)) +- operational++; ++ operational++; /* Count operational subsets*/ + } + + /* Check status of devices... */ + list_for_each_entry(rd, &rs->devs, devs) { +- i++; ++ i++; /* Count disks*/ + if (S_OK(rd->status)) +- operational++; ++ operational++; /* Count disks in "ok" raid*/ ++ if (S_INCONSISTENT(rd->status)) ++ inconsist++; /* Count disks in degraded raid*/ + } + +- _set_rs_status(lc, rs, i, operational); ++ _set_rs_status(lc, rs, i, operational, inconsist, subsets_raid01); + return S_BROKEN(rs->status) ? 0 : 1; + } + +--- a/1.0.0.rc15/include/dmraid/format.h ++++ b/1.0.0.rc15/include/dmraid/format.h +@@ -75,6 +75,8 @@ enum handler_commands { + GET_REBUILD_DRIVE, + GET_REBUILD_DRIVE_NO, + CHECK_HOT_SPARE, ++ ALLOW_ACTIVATE, ++ ALLOW_REBUILD, + /* ... */ + }; + +--- a/1.0.0.rc15/lib/format/ataraid/isw.h ++++ b/1.0.0.rc15/lib/format/ataraid/isw.h +@@ -188,6 +188,8 @@ struct isw_dev { + + struct isw { + int8_t sig[MAX_SIGNATURE_LENGTH]; /* 0x0 - 0x1F */ ++ uint32_t bbm_log_size; ++ uint32_t power_cycle_count; + uint32_t check_sum; /* 0x20 - 0x23 MPB Checksum */ + uint32_t mpb_size; /* 0x24 - 0x27 Size of MPB */ + uint32_t family_num; /* 0x28 - 0x2B Checksum from first time this config was written */ --- dmraid-1.0.0.rc16.orig/debian/patches/19_ddf1_lsi_persistent_name.patch +++ dmraid-1.0.0.rc16/debian/patches/19_ddf1_lsi_persistent_name.patch @@ -0,0 +1,20 @@ +Using a dummy string for the timestamp in the LSI metadata +--- a/1.0.0.rc16/lib/format/ddf/ddf1.c ++++ b/1.0.0.rc16/lib/format/ddf/ddf1.c +@@ -696,6 +696,16 @@ name(struct lib_context *lc, struct ddf1 + sprintf(b, "%02x%02x%02x%02x", + vd->guid[i], vd->guid[i + 1], + vd->guid[i + 2], vd->guid[i + 3]); ++ ++ /* ++ * Because the LSI bios changes the timestamp in the ++ * metadata on every boot, we have to neutralize it ++ * in order to allow for persistent names. ++ * ++ * Using a dummy string "47114711" for that. ++ */ ++ if (!strncmp((char *) vd->guid, "LSI", 3)) ++ strncpy(buf + prefix + 32, "47114711", 8); + } + + out: --- dmraid-1.0.0.rc16.orig/debian/patches/series +++ dmraid-1.0.0.rc16/debian/patches/series @@ -0,0 +1,12 @@ +01_fix_broken_linking.patch +02_disable_dmreg.patch +03_fix_hyphen-used-as-minus-sign.patch +04_do_not_use_p_for_partition.patch +09_promise-add-offsets.patch +10_exit_code.patch +12_support_virtio_devices.patch +17_isw-probe-hpa.patch +15_activate_multiple_raid_sets.patch +18_pdc_raid10_failure..patch +19_ddf1_lsi_persistent_name.patch +20_fix_isw_sectors_calculation.patch --- dmraid-1.0.0.rc16.orig/debian/patches/03_fix_hyphen-used-as-minus-sign.patch +++ dmraid-1.0.0.rc16/debian/patches/03_fix_hyphen-used-as-minus-sign.patch @@ -0,0 +1,291 @@ +Author: Giuseppe Iuculano +Description: Fix hyphen-used-as-minus-sign +--- a/1.0.0.rc16/man/dmraid.8 ++++ b/1.0.0.rc16/man/dmraid.8 +@@ -4,20 +4,20 @@ dmraid \- discover, configure and activa + .SH SYNOPSIS + .B dmraid + {-a|--activate} {y|n|yes|no} +- [-d|--debug]... [-v|--verbose]... [-i|--ignorelocking] +- [-f|--format FORMAT[,FORMAT...]] ++ [\-d|--debug]... [\-v|--verbose]... [\-i|--ignorelocking] ++ [\-f|--format FORMAT[,FORMAT...]] + [{-P|--partchar} CHAR] +- [-p|--no_partitions] +- [-Z|--rm_partitions] ++ [\-p|--no_partitions] ++ [\-Z|--rm_partitions] + [--separator SEPARATOR] +- [-t|--test] ++ [\-t|--test] + [RAID-set...] + + .B dmraid + {-b|--block_devices} +- [-c|--display_columns][FIELD[,FIELD...]]... +- [-d|--debug]... [-v|--verbose]... +- [--separator SEPARATOR] ++ [\-c|--display_columns][FIELD[,FIELD...]]... ++ [\-d|--debug]... [\-v|--verbose]... ++ [\--separator SEPARATOR] + [device-path...] + + .B dmraid +@@ -25,60 +25,60 @@ dmraid \- discover, configure and activa + + .B dmraid + {-l|--list_formats} +- [-d|--debug]... [-v|--verbose]... ++ [\-d|--debug]... [\-v|--verbose]... + + .B dmraid + {-n|--native_log} +- [-d|--debug]... [-v|--verbose]... [-i|--ignorelocking] +- [-f|--format FORMAT[,FORMAT...]] +- [--separator SEPARATOR] ++ [\-d|--debug]... [\-v|--verbose]... [\-i|--ignorelocking] ++ [\-f|--format FORMAT[,FORMAT...]] ++ [\--separator SEPARATOR] + [device-path...] + + .B dmraid +- {-R| --rebuild} ++ {-R| \--rebuild} + RAID-set + [device-path] + + .B dmraid +- {-x| --remove} ++ {-x| \--remove} + [RAID-set] + + .B dmraid +- -f FORMAT-handler +-{-C| --create} set +- --type raidlevel +- [--size=setsize --strip stridesize] +- --disk "device-path, device-path [, device-path ...]" ++ \-f FORMAT-handler ++{-C| \--create} set ++ \--type raidlevel ++ [\--size=setsize \--strip stridesize] ++ \--disk "device-path, device-path [, device-path ...]" + + .B dmraid +-[ -f|--format FORMAT-handler] +--S|--spare [RAID-set] +--M|--media "device-path" ++[ \-f|--format FORMAT-handler] ++\-S|--spare [RAID-set] ++\-M|--media "device-path" + + .B dmraid + {-r|--raid_devices} +- [-c|--display_columns][FIELD[,FIELD...]]... +- [-d|--debug]... [-v|--verbose]... [-i|--ignorelocking] +- [-D|--dump_metadata] +- [-f|--format FORMAT[,FORMAT...]] +- [--separator SEPARATOR] ++ [\-c|--display_columns][FIELD[,FIELD...]]... ++ [\-d|--debug]... [\-v|--verbose]... [\-i|--ignorelocking] ++ [\-D|--dump_metadata] ++ [\-f|--format FORMAT[,FORMAT...]] ++ [\--separator SEPARATOR] + [device-path...] + + .B dmraid + {-r|--raid_devices} +- [-d|--debug]... [-v|--verbose]... [-i|--ignorelocking] +- [-E|--erase_metadata] +- [-f|--format FORMAT[,FORMAT...]] +- [--separator SEPARATOR] ++ [\-d|--debug]... [\-v|--verbose]... [\-i|--ignorelocking] ++ [\-E|--erase_metadata] ++ [\-f|--format FORMAT[,FORMAT...]] ++ [\--separator SEPARATOR] + [device-path...] + + .B dmraid + {-s|--sets}...[a|i|active|inactive] +- [-c|--display_columns][FIELD[,FIELD...]]... +- [-d|--debug]... [-v|--verbose]... [-i|--ignorelocking] +- [-f|--format FORMAT[,FORMAT...]] +- [-g|--display_group] +- [--separator SEPARATOR] ++ [\-c|--display_columns][FIELD[,FIELD...]]... ++ [\-d|--debug]... [\-v|--verbose]... [\-i|--ignorelocking] ++ [\-f|--format FORMAT[,FORMAT...]] ++ [\-g|--display_group] ++ [\--separator SEPARATOR] + [RAID-set...] + + .B dmraid +@@ -117,7 +117,7 @@ will make dmraid tell the kernel to remo + underlying the set, ie if sda is part of the set, remove sda1, sda2, etc. + This prevents applications from directly accessiong the disks bypassing dmraid. + RAID set names given on command line don't need to be fully specified +-(eg, "dmraid -ay sil" would activate all discovered Silicon Image Medley ++(eg, "dmraid \-ay sil" would activate all discovered Silicon Image Medley + RAID sets). + + .TP +@@ -134,7 +134,7 @@ See description of + below for FIELD identifiers. + + .TP +-.I [-d|--debug]... ++.I [\-d|--debug]... + Enable debugging output. Opion can be given multiple times + increasing the debug output level. + +@@ -214,18 +214,18 @@ is added to the system. + During system reboot, enter OROM and mark the new drive as the rebuild drive. + After booting to the OS, use the dmraid command to rebuild. + +- Example: dmraid -R raid_set ++ Example: dmraid \-R raid_set + + 2. Using dmraid to identify a new drive + Boot to the OS and use the dmraid command with the new drive as + the second parameter. + +- Example: dmraid -R raid_set /dev/sdc ++ Example: dmraid \-R raid_set /dev/sdc + + 3. Using hot spare drive +- Mark a drive as hot spare using the "dmraid -f isw -S" command. Then use the dmraid command to start the rebuild. ++ Mark a drive as hot spare using the "dmraid \-f isw \-S" command. Then use the dmraid command to start the rebuild. + +- Example: dmraid -R raid_set ++ Example: dmraid \-R raid_set + + .TP + .I {-x|--remove} [RAID-set] +@@ -235,11 +235,11 @@ Delete one or all existing software RAID + .I -f FORMAT-handler {-C|--create} --type raidlevel [--size=setsize --strip stripsize] --disk "device-path, device-path [,device-path]" + Delete one or all existing Configure a software RAID device and store the configuration data in a group of hard drive devices consisting of this array. This command requires the following options: + +--f FORMAT-handler ++\-f FORMAT-handler + .br +- metadata format (see "dmraid -l") ++ metadata format (see "dmraid \-l") + .br +---type digit[digit...] ++\--type digit[digit...] + .br + specify the raid level of the software RAID set. + .br +@@ -251,7 +251,7 @@ Delete one or all existing Configure a s + .br + 01: raid01 (isw raid10) + .br +---size: [digits[k|K|m|M|g|G][b|B]] ++\--size: [digits[k|K|m|M|g|G][b|B]] + .br + specify the size of the RAID set.The number is an integer followed by [kKmMgG] and/or [bB]. + .br +@@ -267,11 +267,11 @@ Delete one or all existing Configure a s + .br + If this option is missing, it's set to the default value pre-configured by the vendor. Note that different vendors may apply different constraints on the granularity of the size or the minimal value. + .br +---strip: [digits[k|K|m|M|g|G][b|B]] ++\--strip: [digits[k|K|m|M|g|G][b|B]] + .br + specify the strip size of a RAID1, RAID5, and RAID10 RAID set (as above) + .br +---disk: device-path[{,| }device-path...] ++\--disk: device-path[{,| }device-path...] + .br + specify the array of the hard drives, e.g. /dev/sda. + +@@ -349,7 +349,7 @@ Use SEPARATOR as a delimiter for all opt + .TP + .I -s... [a|i] [RAID-set...] + Display properties of RAID sets. Multiple RAID set names can be given +-on the command line which don't need to be fully specified (eg, "dmraid -s hpt" ++on the command line which don't need to be fully specified (eg, "dmraid \-s hpt" + would display all discovered Highpoint RAID sets). Enter + .B -s + twice to display RAID subsets too. +@@ -377,7 +377,7 @@ Enable verbose runtime information outpu + increasing the verbosity level. + + .SH EXAMPLES +-"dmraid -l" lists all supported metadata formats with their names along with ++"dmraid \-l" lists all supported metadata formats with their names along with + some descriptive information, eg: + .br + hpt37x : (+) Highpoint HPT37X +@@ -400,16 +400,16 @@ dos : (+) DOS partitions on SW RAIDs + .br + (0): Discover, (+): Discover+Activate + +-"dmraid -ay" activates all software RAID sets discovered. ++"dmraid \-ay" activates all software RAID sets discovered. + +-"dmraid -an" deactivates all active software RAID sets which are not open ++"dmraid \-an" deactivates all active software RAID sets which are not open + (eg, mounted filesystem on them). + +-"dmraid -ay -f pdc" (pdc looked up from "dmraid -l") activates all ++"dmraid \-ay \-f pdc" (pdc looked up from "dmraid \-l") activates all + software RAID sets with Promise format discovered and ignores all other + supported formats. + +-"dmraid -r" discovers all software RAID devices supported on your system, eg: ++"dmraid \-r" discovers all software RAID devices supported on your system, eg: + .br + /dev/dm-46: hpt45x, "hpt45x_chidjhaiaa-0", striped, ok, 320172928 sectors, data@ 0 + .br +@@ -420,7 +420,7 @@ supported formats. + /dev/dm-58: hpt45x, "hpt45x_chidjhaiaa-1", striped, ok, 320172928 sectors, data@ 0 + + +-"dmraid -s -s hpt45x_chidjhaiaa" displays properties of ++"dmraid \-s \-s hpt45x_chidjhaiaa" displays properties of + set "hpt45x_chidjhaiaa", eg: + .br + *** Superset +@@ -478,7 +478,7 @@ dev : 2 + spare : 0 + .br + +-"dmraid -s -ccs hpt45" displays properties in column format of all sets ++"dmraid \-s \-ccs hpt45" displays properties in column format of all sets + and subsets with hpt45* format, eg: + .br + hpt45x_chidjhaiaa,640345856,128,raid10,ok,4,0 +@@ -487,7 +487,7 @@ hpt45x_chidjhaiaa-a,640345856,128,stripe + .br + hpt45x_chidjhaiaa-b,640345856,128,stripe,ok,2,0 + +-"dmraid -r --sep : -cpath:size" display paths and sizes in sectors for ++"dmraid \-r \--sep : \-cpath:size" display paths and sizes in sectors for + RAID devices in column format using ':' as a delimiter, eg: + .br + /dev/dm-8:320173055 +@@ -518,18 +518,18 @@ RAID devices in column format using ':' + .br + /dev/dm-66:390624896 + +-"dmraid -f isw -C Raid0 --type 0 --strip 8k --size 20g --disk "/dev/sdb /dev/sdc"" creates an ISW volume with ++"dmraid \-f isw \-C Raid0 \--type 0 \--strip 8k \--size 20g \--disk "/dev/sdb /dev/sdc"" creates an ISW volume with + a name of "Raid0", 20Gig bytes in total, and 8kilo bytes strip size on two disks. + +-"dmraid -f isw -C Test0 --type 0 --disk "/dev/sdd /dev/sde"" creates an ISW volume with the default size and strip size. ++"dmraid \-f isw \-C Test0 \--type 0 \--disk "/dev/sdd /dev/sde"" creates an ISW volume with the default size and strip size. + +-"dmraid -f isw -C Test10 --type 01 --strip 128B --disk "/dev/sda /dev/sdb /dev/sdc /dev/sdd" creates a stacked ++"dmraid \-f isw \-C Test10 \--type 01 \--strip 128B \--disk "/dev/sda /dev/sdb /dev/sdc /dev/sdd" creates a stacked + RAID device, RAID10 (isw format), with a name of "Test10", 128 blocks (512bytes) strip size , and the default volume size on + 4 disks. + +-"dmraid -f isw -S -M /dev/sde" marks the device /dev/sde as a hot spare for rebuild ++"dmraid \-f isw \-S \-M /dev/sde" marks the device /dev/sde as a hot spare for rebuild + +-"dmraid -R isw_djaggchdde_RAID1 /dev/sde" starts rebuild of the RAID volume on device /dev/sde ++"dmraid \-R isw_djaggchdde_RAID1 /dev/sde" starts rebuild of the RAID volume on device /dev/sde + + .SH DIAGNOSTICS + dmraid returns an exit code of 0 for success or 1 for error. --- dmraid-1.0.0.rc16.orig/debian/patches/02_disable_dmreg.patch +++ dmraid-1.0.0.rc16/debian/patches/02_disable_dmreg.patch @@ -0,0 +1,134 @@ +Disabled all dmreg stuff +--- a/1.0.0.rc16/lib/Makefile.in ++++ b/1.0.0.rc16/lib/Makefile.in +@@ -45,10 +45,6 @@ SOURCES=\ + format/ddf/ddf1_dump.c \ + format/partition/dos.c + +-ifeq ("@STATIC_LINK@", "no") +- SOURCES += register/dmreg.c +-endif +- + OBJECTS=$(SOURCES:%.c=%.o) + + LIB_STATIC=$(top_srcdir)/lib/libdmraid.a +@@ -63,8 +59,8 @@ ifeq ("@KLIBC@", "no") + ifeq ("@STATIC_LINK@", "no") + LIB_SHARED=$(top_srcdir)/lib/libdmraid.so + LIB_EVENTS_SHARED=$(top_srcdir)/lib/$(LIB_EVENTS_NAME).so +- TARGETS += $(LIB_SHARED) $(LIB_EVENTS_SHARED) +- INSTALL_TARGETS += $(LIB_SHARED) $(LIB_EVENTS_SHARED) ++ TARGETS += $(LIB_SHARED) ++ INSTALL_TARGETS += $(LIB_SHARED) + ifeq ("@DIETLIBC@", "yes") + LIBDMRAIDLIBS += -ldevmapper_dietc + else +--- a/1.0.0.rc16/make.tmpl.in ++++ b/1.0.0.rc16/make.tmpl.in +@@ -137,7 +137,7 @@ $(TARGETS): $(OBJECTS) + + %.so: $(OBJECTS) + $(CC) -shared -Wl,-soname,$(notdir $@).$(DMRAID_LIB_VERSION) \ +- -Wl,--version-script,.export.sym $(OBJECTS) $(LIBDMRAIDLIBS) -o $@ -ldevmapper-event ++ -Wl,--version-script,.export.sym $(OBJECTS) $(LIBDMRAIDLIBS) -o $@ + + $(LIB_STATIC): $(OBJECTS) + $(RM) $@ +--- a/1.0.0.rc16/tools/Makefile.in ++++ b/1.0.0.rc16/tools/Makefile.in +@@ -22,12 +22,6 @@ TARGETS=\ + + include $(top_srcdir)/make.tmpl + +-ifeq ("@KLIBC@", "no") +- ifeq ("@STATIC_LINK@", "no") +- TARGETS += dmevent_tool +- endif +-endif +- + DMRAIDLIBS=-ldmraid + + ifeq ("@KLIBC@", "yes") +@@ -37,16 +31,10 @@ else + ifeq ("@LIB_SO@", "no") + DMRAIDLIBS += -ldevmapper_dietc + endif +- ifeq ("@STATIC_LINK@", "no") +- DMEVENTTOOLLIBS = -ldevmapper-event_dietc +- endif + else + ifeq ("@LIB_SO@", "no") + DMRAIDLIBS += -ldevmapper + endif +- ifeq ("@STATIC_LINK@", "no") +- DMEVENTTOOLLIBS = -ldevmapper-event +- endif + endif + + ifeq ("@LIBSELINUX@", "yes") +--- a/1.0.0.rc16/lib/.export.sym ++++ b/1.0.0.rc16/lib/.export.sym +@@ -52,8 +52,6 @@ Base { + dso_end_rebuild; + hot_spare_add; + dso_get_members; +- dm_register_device; +- dm_unregister_device; + dm_all_monitored; + local: + *; +--- a/1.0.0.rc16/lib/activate/activate.c ++++ b/1.0.0.rc16/lib/activate/activate.c +@@ -849,18 +849,12 @@ enum dm_what { DM_ACTIVATE, DM_REGISTER + static int + dm_register_for_event(char *dev_name, char *lib_name) + { +-#ifdef DMRAID_AUTOREGISTER +- dm_register_device(dev_name, lib_name); +-#endif + return 1; + } + + static int + dm_unregister_for_event(char *dev_name, char *lib_name) + { +-#ifdef DMRAID_AUTOREGISTER +- dm_unregister_device(dev_name, lib_name); +-#endif + return 1; + } + +@@ -874,6 +868,8 @@ do_device(struct lib_context *lc, struct + if (OPT_TEST(lc)) + return 1; + ++ return 1; ++ + struct dmraid_format *fmt = get_format(rs); + + if (fmt->name != NULL) { +--- a/1.0.0.rc16/lib/metadata/reconfig.c ++++ b/1.0.0.rc16/lib/metadata/reconfig.c +@@ -242,20 +242,16 @@ add_dev_to_raid(struct lib_context *lc, + * metadata on disks to OK state. + */ + /* Create lib-events library name */ +- if (fmt->name) { ++ /*if (fmt->name) { + strncpy(lib_name, "libdmraid-events-", LIB_NAME_LENGTH); + strncat(lib_name, fmt->name, + LIB_NAME_LENGTH-strlen(fmt->name)-3); + strncat(lib_name, ".so", 3); + } else + goto err; +- +- /* Check registration */ +- if (!dm_monitored_events(&pending, sub_rs->name, lib_name)) { +- /* If NOT registered update metadata to OK state. */ ++*/ + if (check_rd->fmt->metadata_handler) + check_rd->fmt->metadata_handler(lc, UPDATE_REBUILD_STATE, NULL, (void *) rs); +- } + } + #endif + --- dmraid-1.0.0.rc16.orig/debian/patches/12_support_virtio_devices.patch +++ dmraid-1.0.0.rc16/debian/patches/12_support_virtio_devices.patch @@ -0,0 +1,13 @@ +Author: Luke Yelavich +Description: Support for checking virtio devices for dmraid metadata. +--- a/1.0.0.rc16/lib/device/scan.c ++++ b/1.0.0.rc16/lib/device/scan.c +@@ -174,7 +174,7 @@ interested(struct lib_context *lc, char + * Whole IDE and SCSI disks only. + */ + return (!isdigit(name[strlen(name) - 1]) && +- (*(name + 1) == 'd' && (*name == 'h' || *name == 's'))) ++ (*(name + 1) == 'd' && (*name == 'h' || *name == 's' || *name == 'v'))) + #ifdef DMRAID_TEST + /* + * Include dm devices for testing. --- dmraid-1.0.0.rc16.orig/debian/patches/15_activate_multiple_raid_sets.patch +++ dmraid-1.0.0.rc16/debian/patches/15_activate_multiple_raid_sets.patch @@ -0,0 +1,12 @@ +Continue onto all raid sets instead of returning after processing the first. (LP: #401713) +--- a/1.0.0.rc16/lib/metadata/metadata.c ++++ b/1.0.0.rc16/lib/metadata/metadata.c +@@ -839,7 +839,7 @@ _discover_partitions(struct lib_context + */ + if (T_GROUP(rs)) { + _discover_partitions(lc, &rs->sets); +- return; ++ continue; + } + + /* --- dmraid-1.0.0.rc16.orig/debian/patches/18_pdc_raid10_failure..patch +++ dmraid-1.0.0.rc16/debian/patches/18_pdc_raid10_failure..patch @@ -0,0 +1,14 @@ +fix pdc metadata format handler to report the proper number of devices in a subset +--- a/1.0.0.rc16/lib/format/ataraid/pdc.c ++++ b/1.0.0.rc16/lib/format/ataraid/pdc.c +@@ -490,7 +490,9 @@ devices(struct raid_dev *rd, void *conte + if (context && pdc->raid.type != PDC_T_SPAN) + *((uint64_t *) context) += rd->sectors; + +- return pdc->raid.total_disks; ++ return is_raid10(pdc) ? ++ pdc->raid.total_disks / 2 : ++ pdc->raid.total_disks; + } + + static int --- dmraid-1.0.0.rc16.orig/debian/patches/20_fix_isw_sectors_calculation.patch +++ dmraid-1.0.0.rc16/debian/patches/20_fix_isw_sectors_calculation.patch @@ -0,0 +1,14 @@ +Fix isw raid0 incorrect sectors calculation, thanks to Valentin Pavlyuchenko +--- a/1.0.0.rc16/lib/format/ataraid/isw.c ++++ b/1.0.0.rc16/lib/format/ataraid/isw.c +@@ -776,7 +776,9 @@ _create_rd(struct lib_context *lc, + r->di = rd->di; + r->fmt = rd->fmt; + r->offset = dev->vol.map[0].pba_of_lba0; +- if ((r->sectors = dev->vol.map[0].blocks_per_member - RAID_DS_JOURNAL)) ++ //fix bugs on ICH10R ++ //if ((r->sectors = dev->vol.map[0].blocks_per_member - RAID_DS_JOURNAL)) ++ if ((r->sectors = dev->vol.map[0].blocks_per_member)) + goto out; + + log_zero_sectors(lc, rd->di->path, handler); --- dmraid-1.0.0.rc16.orig/debian/patches/10_exit_code.patch +++ dmraid-1.0.0.rc16/debian/patches/10_exit_code.patch @@ -0,0 +1,22 @@ +Author: Giuseppe Iuculano +Description: Fix exit-code for "No RAID disks" and "no block devices found" errors (LP: #300825) +--- a/1.0.0.rc16/lib/metadata/metadata.c ++++ b/1.0.0.rc16/lib/metadata/metadata.c +@@ -2096,7 +2096,7 @@ get_metadata(struct lib_context *lc, enu + + if (!count_devices(lc, DEVICE)) { + log_print(lc, "no block devices found"); +- return 1; ++ return 0; + } + + if (!(M_RAID & p->metadata)) +@@ -2118,7 +2118,7 @@ get_metadata(struct lib_context *lc, enu + if (!OPT_HOT_SPARE_SET(lc) && !OPT_CREATE(lc) + && !count_devices(lc, RAID)) { + format_error(lc, "disks", argv); +- return 1; ++ return 0; + } + + if (M_SET & p->metadata) { --- dmraid-1.0.0.rc16.orig/debian/patches/17_isw-probe-hpa.patch +++ dmraid-1.0.0.rc16/debian/patches/17_isw-probe-hpa.patch @@ -0,0 +1,144 @@ +Probe isw disks with [some] HPA awareness, thanks to Robert Collins . (LP: #372170) +--- a/1.0.0.rc16/lib/format/ataraid/isw.c ++++ b/1.0.0.rc16/lib/format/ataraid/isw.c +@@ -353,6 +353,7 @@ raiddev(struct isw *isw, unsigned i) + enum convert { FULL, FIRST, LAST }; + #if BYTE_ORDER == LITTLE_ENDIAN + # define to_cpu(x, y) ++# define CVT16(x) + #else + /* + * We can differ from the read_raid_dev template here, +@@ -547,15 +548,16 @@ disk_ok(struct lib_context *lc, struct d + } + + static void * +-isw_read_metadata(struct lib_context *lc, struct dev_info *di, +- size_t * sz, uint64_t * offset, union read_info *info) ++isw_try_sboffset(struct lib_context *lc, struct dev_info *di, ++ size_t * sz, uint64_t * offset, union read_info *info, ++ uint64_t const isw_sboffset) + { + size_t size = ISW_DISK_BLOCK_SIZE; +- uint64_t isw_sboffset = ISW_CONFIGOFFSET(di); + struct isw *isw; ++ uint64_t temp_isw_sboffset = isw_sboffset; + + if (!(isw = alloc_private_and_read(lc, handler, size, +- di->path, isw_sboffset))) ++ di->path, temp_isw_sboffset))) + goto out; + + /* +@@ -565,9 +567,15 @@ isw_read_metadata(struct lib_context *lc + to_cpu(isw, FIRST); + + /* Check Signature and read optional extended metadata. */ +- if (!is_isw(lc, di, isw) || +- !isw_read_extended(lc, di, &isw, &isw_sboffset, &size)) ++ if (!is_isw(lc, di, isw)) { ++ log_dbg(lc, "not isw at %ld", isw_sboffset); + goto bad; ++ } ++ if (!isw_read_extended(lc, di, &isw, &temp_isw_sboffset, &size)) { ++ log_err(lc, "isw metadata, but extended read failed at %ld", ++ isw_sboffset); ++ goto bad; ++ } + + /* + * Now that we made sure, that we've got all the +@@ -578,6 +586,8 @@ isw_read_metadata(struct lib_context *lc + if (disk_ok(lc, di, isw)) { + *sz = size; + *offset = info->u64 = isw_sboffset; ++ log_dbg(lc, "isw metadata found at %ld from probe at %ld\n", ++ *offset, isw_sboffset); + goto out; + } + +@@ -589,6 +599,54 @@ out: + return (void *) isw; + } + ++/* HPA on a disk shifts everything down. This is a 'works-enough' approach to ++ * handling that. There is a better long term approach requiring kernel ++ * patches - see the lkml patches for alt_size. ++ */ ++static void * ++isw_try_hpa(struct lib_context *lc, struct dev_info *di, ++ size_t * sz, uint64_t * offset, union read_info *info) ++{ ++ struct isw10 *isw10; ++ void *result = NULL; ++ uint64_t actual_offset; ++ if (!(isw10 = alloc_private_and_read(lc, handler, ISW_DISK_BLOCK_SIZE, ++ di->path, ISW_10_CONFIGOFFSET(di)))) ++ goto out; ++ if (strncmp((const char *)isw10->sig, ISW10_SIGNATURE, ISW10_SIGNATURE_SIZE)) ++ goto out_free; ++ log_dbg(lc, "Found isw 10 gafr signature."); ++ CVT16(isw10->offset); ++ actual_offset = isw10->offset + 2; ++ log_dbg(lc, "isw 10 sector offset calculated at %hd.", actual_offset); ++ if (actual_offset > di->sectors) ++ goto out_free; ++ result = isw_try_sboffset(lc, di, sz, offset, info, ++ ISW_SECTOR_TO_OFFSET(di->sectors - actual_offset)); ++ out_free: ++ dbg_free(isw10); ++ out: ++ return result; ++} ++ ++ ++static void * ++isw_read_metadata(struct lib_context *lc, struct dev_info *di, ++ size_t * sz, uint64_t * offset, union read_info *info) ++{ ++ void *result; ++ if ((result = isw_try_sboffset( ++ lc, di, sz, offset, info, ISW_CONFIGOFFSET(di)))) ++ return result; ++ if ((result = isw_try_hpa(lc, di, sz, offset, info))) ++ return result; ++ log_dbg(lc, "isw trying hard coded -2115 offset."); ++ if ((result = isw_try_sboffset( ++ lc, di, sz, offset, info, (di->sectors - 2115)*512))) ++ return result; ++ return NULL; ++} ++ + static int setup_rd(struct lib_context *lc, struct raid_dev *rd, + struct dev_info *di, void *meta, union read_info *info); + static struct raid_dev * +--- a/1.0.0.rc16/lib/format/ataraid/isw.h ++++ b/1.0.0.rc16/lib/format/ataraid/isw.h +@@ -36,8 +36,11 @@ + + /* Intel metadata offset in bytes */ + #define ISW_CONFIGSECTOR(di) ((di)->sectors - 2) +-#define ISW_CONFIGOFFSET(di) (ISW_CONFIGSECTOR(di) << 9) ++#define ISW_SECTOR_TO_OFFSET(sector) ((sector) << 9) ++#define ISW_CONFIGOFFSET(di) (ISW_SECTOR_TO_OFFSET(ISW_CONFIGSECTOR(di))) + #define ISW_DATAOFFSET 0 /* Data offset in sectors */ ++#define ISW_10_CONFIGSECTOR(di) ((di)->sectors - 1) ++#define ISW_10_CONFIGOFFSET(di) (ISW_SECTOR_TO_OFFSET(ISW_10_CONFIGSECTOR(di))) + + #define MPB_SIGNATURE "Intel Raid ISM Cfg Sig. " + #define MPB_SIGNATURE_SIZE (sizeof(MPB_SIGNATURE) - 1) +@@ -222,6 +225,14 @@ struct isw { + // here comes isw_dev[num_raid_devs] + } __attribute__ ((packed)); + ++#define ISW10_SIGNATURE "$GAFR\x10" ++#define ISW10_SIGNATURE_SIZE (sizeof(ISW10_SIGNATURE) - 1) ++struct isw10 { ++ int8_t sig[ISW10_SIGNATURE_SIZE]; ++ uint32_t offset; /* offset to real data, in sectors back */ ++} __attribute__ ((packed)); ++ ++ + #endif + + int register_isw(struct lib_context *lc);