[arch-commits] Commit in mdadm/repos (20 files)

Tobias Powalowski tpowa at archlinux.org
Tue Oct 30 07:44:56 UTC 2012


    Date: Tuesday, October 30, 2012 @ 03:44:56
  Author: tpowa
Revision: 169813

archrelease: copy trunk to testing-i686, testing-x86_64

Added:
  mdadm/repos/testing-i686/
  mdadm/repos/testing-i686/PKGBUILD
    (from rev 169812, mdadm/trunk/PKGBUILD)
  mdadm/repos/testing-i686/disable-werror.patch
    (from rev 169812, mdadm/trunk/disable-werror.patch)
  mdadm/repos/testing-i686/linux-3.0.patch
    (from rev 169812, mdadm/trunk/linux-3.0.patch)
  mdadm/repos/testing-i686/mdadm
    (from rev 169812, mdadm/trunk/mdadm)
  mdadm/repos/testing-i686/mdadm.conf
    (from rev 169812, mdadm/trunk/mdadm.conf)
  mdadm/repos/testing-i686/mdadm.service
    (from rev 169812, mdadm/trunk/mdadm.service)
  mdadm/repos/testing-i686/mdadm_hook
    (from rev 169812, mdadm/trunk/mdadm_hook)
  mdadm/repos/testing-i686/mdadm_install
    (from rev 169812, mdadm/trunk/mdadm_install)
  mdadm/repos/testing-i686/mdadm_udev_install
    (from rev 169812, mdadm/trunk/mdadm_udev_install)
  mdadm/repos/testing-x86_64/
  mdadm/repos/testing-x86_64/PKGBUILD
    (from rev 169812, mdadm/trunk/PKGBUILD)
  mdadm/repos/testing-x86_64/disable-werror.patch
    (from rev 169812, mdadm/trunk/disable-werror.patch)
  mdadm/repos/testing-x86_64/linux-3.0.patch
    (from rev 169812, mdadm/trunk/linux-3.0.patch)
  mdadm/repos/testing-x86_64/mdadm
    (from rev 169812, mdadm/trunk/mdadm)
  mdadm/repos/testing-x86_64/mdadm.conf
    (from rev 169812, mdadm/trunk/mdadm.conf)
  mdadm/repos/testing-x86_64/mdadm.service
    (from rev 169812, mdadm/trunk/mdadm.service)
  mdadm/repos/testing-x86_64/mdadm_hook
    (from rev 169812, mdadm/trunk/mdadm_hook)
  mdadm/repos/testing-x86_64/mdadm_install
    (from rev 169812, mdadm/trunk/mdadm_install)
  mdadm/repos/testing-x86_64/mdadm_udev_install
    (from rev 169812, mdadm/trunk/mdadm_udev_install)

-------------------------------------+
 testing-i686/PKGBUILD               |   58 +++++++++++++++++++++++++++++
 testing-i686/disable-werror.patch   |   11 +++++
 testing-i686/linux-3.0.patch        |   45 ++++++++++++++++++++++
 testing-i686/mdadm                  |   42 +++++++++++++++++++++
 testing-i686/mdadm.conf             |   67 ++++++++++++++++++++++++++++++++++
 testing-i686/mdadm.service          |    8 ++++
 testing-i686/mdadm_hook             |   49 ++++++++++++++++++++++++
 testing-i686/mdadm_install          |   45 ++++++++++++++++++++++
 testing-i686/mdadm_udev_install     |   24 ++++++++++++
 testing-x86_64/PKGBUILD             |   58 +++++++++++++++++++++++++++++
 testing-x86_64/disable-werror.patch |   11 +++++
 testing-x86_64/linux-3.0.patch      |   45 ++++++++++++++++++++++
 testing-x86_64/mdadm                |   42 +++++++++++++++++++++
 testing-x86_64/mdadm.conf           |   67 ++++++++++++++++++++++++++++++++++
 testing-x86_64/mdadm.service        |    8 ++++
 testing-x86_64/mdadm_hook           |   49 ++++++++++++++++++++++++
 testing-x86_64/mdadm_install        |   45 ++++++++++++++++++++++
 testing-x86_64/mdadm_udev_install   |   24 ++++++++++++
 18 files changed, 698 insertions(+)

Copied: mdadm/repos/testing-i686/PKGBUILD (from rev 169812, mdadm/trunk/PKGBUILD)
===================================================================
--- testing-i686/PKGBUILD	                        (rev 0)
+++ testing-i686/PKGBUILD	2012-10-30 07:44:56 UTC (rev 169813)
@@ -0,0 +1,58 @@
+# $Id$
+# Maintainer: Tobias Powalowski <tpowa at archlinux.org>
+# Contributor: Judd Vinet <jvinet at zeroflux.org>
+pkgname=mdadm
+pkgver=3.2.6
+pkgrel=1
+pkgdesc="A tool for managing/monitoring Linux md device arrays, also known as Software RAID"
+arch=(i686 x86_64)
+license=('GPL')
+url="http://neil.brown.name/blog/mdadm"
+groups=('base')
+conflicts=('mkinitcpio<0.7')
+depends=('glibc')
+backup=('etc/mdadm.conf')
+source=(ftp://ftp.kernel.org/pub/linux/utils/raid/mdadm/mdadm-$pkgver.tar.bz2
+        mdadm 
+        mdadm.conf 
+        mdadm_install
+        mdadm_hook
+        mdadm_udev_install
+        mdadm.service
+        disable-werror.patch)
+replaces=('raidtools')
+
+build() {
+  cd $srcdir/$pkgname-$pkgver
+  patch -Np0 -i ../disable-werror.patch
+  make CXFLAGS="$CFLAGS"
+  # build static mdassemble for Arch's initramfs
+  make MDASSEMBLE_AUTO=1 mdassemble
+  
+}
+
+package() {
+  cd $srcdir/$pkgname-$pkgver
+  make INSTALL=/usr/bin/install DESTDIR=$pkgdir install
+  install -D -m755 mdassemble $pkgdir/sbin/mdassemble
+  install -D -m644 ../mdadm.conf $pkgdir/etc/mdadm.conf
+  install -D -m755 ../mdadm $pkgdir/etc/rc.d/mdadm
+  install -D -m644 ../mdadm_install $pkgdir/usr/lib/initcpio/install/mdadm
+  install -D -m644 ../mdadm_hook $pkgdir/usr/lib/initcpio/hooks/mdadm
+  install -D -m644 ../mdadm_udev_install $pkgdir/usr/lib/initcpio/install/mdadm_udev
+  # symlink for backward compatibility
+  ln -sf /usr/lib/initcpio/hooks/mdadm  $pkgdir/usr/lib/initcpio/hooks/raid
+  # move /lib/* to /usr/lib/
+  mv $pkgdir/lib/udev $pkgdir/usr/lib/
+  rm -rf $pkgdir/lib
+  # systemd service file
+  install -D -m644 $srcdir/mdadm.service $pkgdir/usr/lib/systemd/system/mdadm.service
+}
+md5sums=('3e255dc71e5144bbcb872788ca647267'
+         '8333d405f550317c2bacd5510bf1cb60'
+         '00cbed931db4f15b6ce49e3e7d433966'
+         '609d10888727710cb20db7ac3e096116'
+         'fbb5542d9bdf87441a11dd7e7a0a17f8'
+         'd1d8e9eb81ce9347de74f3c84a9db09e'
+         'aafb5f9ac8437a284cbf948b9b13b179'
+         '4ad87b74a4bc9a34621280abe0e0c3e4')

Copied: mdadm/repos/testing-i686/disable-werror.patch (from rev 169812, mdadm/trunk/disable-werror.patch)
===================================================================
--- testing-i686/disable-werror.patch	                        (rev 0)
+++ testing-i686/disable-werror.patch	2012-10-30 07:44:56 UTC (rev 169813)
@@ -0,0 +1,11 @@
+--- Makefile.old	2011-06-17 09:38:03.269238332 +0200
++++ Makefile	2011-06-17 09:38:14.122398837 +0200
+@@ -42,7 +42,7 @@
+ 
+ CC = $(CROSS_COMPILE)gcc
+ CXFLAGS = -ggdb
+-CWFLAGS = -Wall -Werror -Wstrict-prototypes -Wextra -Wno-unused-parameter
++CWFLAGS = -Wall -Wstrict-prototypes -Wextra -Wno-unused-parameter
+ ifdef WARN_UNUSED
+ CWFLAGS += -Wp,-D_FORTIFY_SOURCE=2 -O
+ endif

Copied: mdadm/repos/testing-i686/linux-3.0.patch (from rev 169812, mdadm/trunk/linux-3.0.patch)
===================================================================
--- testing-i686/linux-3.0.patch	                        (rev 0)
+++ testing-i686/linux-3.0.patch	2012-10-30 07:44:56 UTC (rev 169813)
@@ -0,0 +1,45 @@
+From f161d047eed634b3380262767f955eb888502e88 Mon Sep 17 00:00:00 2001
+From: NeilBrown <neilb at suse.de>
+Date: Fri, 17 Jun 2011 22:49:24 +1000
+Subject: [PATCH 1/1] util: correctly parse shorter linux version numbers.
+
+The next version of Linux might be 3.0.  If it is, get_linux_version
+will fail.
+So make it more robust.
+
+Reported-by: Namhyung Kim <namhyung at gmail.com>
+Reported-by: Milan Broz <mbroz at redhat.com>
+Signed-off-by: NeilBrown <neilb at suse.de>
+---
+ util.c |   10 +++++-----
+ 1 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/util.c b/util.c
+index 10bbe56..55d171a 100644
+--- a/util.c
++++ b/util.c
+@@ -146,16 +146,16 @@ int get_linux_version()
+ {
+ 	struct utsname name;
+ 	char *cp;
+-	int a,b,c;
++	int a = 0, b = 0,c = 0;
+ 	if (uname(&name) <0)
+ 		return -1;
+ 
+ 	cp = name.release;
+ 	a = strtoul(cp, &cp, 10);
+-	if (*cp != '.') return -1;
+-	b = strtoul(cp+1, &cp, 10);
+-	if (*cp != '.') return -1;
+-	c = strtoul(cp+1, NULL, 10);
++	if (*cp == '.')
++		b = strtoul(cp+1, &cp, 10);
++	if (*cp == '.')
++		c = strtoul(cp+1, &cp, 10);
+ 
+ 	return (a*1000000)+(b*1000)+c;
+ }
+-- 
+1.7.2.3
+

Copied: mdadm/repos/testing-i686/mdadm (from rev 169812, mdadm/trunk/mdadm)
===================================================================
--- testing-i686/mdadm	                        (rev 0)
+++ testing-i686/mdadm	2012-10-30 07:44:56 UTC (rev 169813)
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+pidfile=/run/mdadm.pid
+if [[ -r $pidfile ]]; then
+  read -r PID <"$pidfile"
+  if [[ $PID && ! -d /proc/$PID ]]; then
+    # stale pidfile
+    unset PID
+    rm -f "$pidfile"
+  fi
+fi
+
+case $1 in
+  start)
+    stat_busy "Starting mdadm RAID Monitor"
+    if [[ -z $PID ]] && mdadm --monitor --scan -i "$pidfile" -f; then
+      add_daemon mdadm
+      stat_done
+    else
+      stat_fail
+    fi
+    ;;
+  stop)
+    stat_busy "Stopping mdadm RAID Monitor"
+    if [[ $PID ]] && kill "$PID" &>/dev/null; then
+      rm_daemon mdadm
+      stat_done
+    else
+      stat_fail
+    fi
+    ;;
+  restart)
+    $0 stop
+    sleep 1
+    $0 start
+    ;;
+  *)
+    echo "usage: $0 {start|stop|restart}"
+esac

Copied: mdadm/repos/testing-i686/mdadm.conf (from rev 169812, mdadm/trunk/mdadm.conf)
===================================================================
--- testing-i686/mdadm.conf	                        (rev 0)
+++ testing-i686/mdadm.conf	2012-10-30 07:44:56 UTC (rev 169813)
@@ -0,0 +1,67 @@
+# mdadm configuration file
+#
+# mdadm will function properly without the use of a configuration file,
+# but this file is useful for keeping track of arrays and member disks.
+# In general, a mdadm.conf file is created, and updated, after arrays
+# are created. This is the opposite behavior of /etc/raidtab which is
+# created prior to array construction.
+#
+#
+# the config file takes two types of lines:
+#
+#	DEVICE lines specify a list of devices of where to look for
+#	  potential member disks
+#
+#	ARRAY lines specify information about how to identify arrays so
+#	  so that they can be activated
+#
+
+
+# You can have more than one device line and use wild cards. The first 
+# example includes SCSI the first partition of SCSI disks /dev/sdb,
+# /dev/sdc, /dev/sdd, /dev/sdj, /dev/sdk, and /dev/sdl. The second 
+# line looks for array slices on IDE disks.
+#
+#DEVICE /dev/sd[bcdjkl]1
+#DEVICE /dev/hda1 /dev/hdb1
+#
+# The designation "partitions" will scan all partitions found in
+# /proc/partitions
+DEVICE partitions
+
+
+# ARRAY lines specify an array to assemble and a method of identification.
+# Arrays can currently be identified by using a UUID, superblock minor number,
+# or a listing of devices.
+#
+#	super-minor is usually the minor number of the metadevice
+#	UUID is the Universally Unique Identifier for the array
+# Each can be obtained using
+#
+# 	mdadm -D <md>
+#
+# To capture the UUIDs for all your RAID arrays to this file, run these:
+#    to get a list of running arrays:
+#    # mdadm -D --scan >>/etc/mdadm.conf
+#    to get a list from superblocks:
+#    # mdadm -E --scan >>/etc/mdadm.conf
+#
+#ARRAY /dev/md0 UUID=3aaa0122:29827cfa:5331ad66:ca767371
+#ARRAY /dev/md1 super-minor=1
+#ARRAY /dev/md2 devices=/dev/hda1,/dev/hdb1
+#
+# ARRAY lines can also specify a "spare-group" for each array.  mdadm --monitor
+# will then move a spare between arrays in a spare-group if one array has a
+# failed drive but no spare
+#ARRAY /dev/md4 uuid=b23f3c6d:aec43a9f:fd65db85:369432df spare-group=group1
+#ARRAY /dev/md5 uuid=19464854:03f71b1b:e0df2edd:246cc977 spare-group=group1
+#
+
+
+# When used in --follow (aka --monitor) mode, mdadm needs a
+# mail address and/or a program.  To start mdadm's monitor mode, add
+# "mdadm" to your DAEMONS array in /etc/rc.conf
+#
+# If the lines are not found, mdadm will exit quietly
+#MAILADDR root at mydomain.tld
+#PROGRAM /usr/sbin/handle-mdadm-events

Copied: mdadm/repos/testing-i686/mdadm.service (from rev 169812, mdadm/trunk/mdadm.service)
===================================================================
--- testing-i686/mdadm.service	                        (rev 0)
+++ testing-i686/mdadm.service	2012-10-30 07:44:56 UTC (rev 169813)
@@ -0,0 +1,8 @@
+[Unit]
+Description=MDADM Event Monitor
+
+[Service]
+ExecStart=/sbin/mdadm --monitor --scan
+
+[Install]
+WantedBy=multi-user.target

Copied: mdadm/repos/testing-i686/mdadm_hook (from rev 169812, mdadm/trunk/mdadm_hook)
===================================================================
--- testing-i686/mdadm_hook	                        (rev 0)
+++ testing-i686/mdadm_hook	2012-10-30 07:44:56 UTC (rev 169813)
@@ -0,0 +1,49 @@
+#!/usr/bin/ash
+
+run_hook() {
+    local i= mdconfig=/etc/mdadm.conf
+
+    # for partitionable raid, we need to load md_mod first!
+    modprobe md_mod 2>/dev/null
+
+    if [ -n "$md" ]; then
+        echo 'DEVICE partitions' >"$mdconfig"
+        for i in $(cat /proc/cmdline); do
+            case $i in
+                # raid
+                md=[0-9]*,/*)
+                    device=${i%%,*}
+                    device=${device/=/}
+                    array=${i#*,}
+                    echo "ARRAY /dev/$device devices=$array"
+                    ;;
+                # partitionable raid
+                md=d[0-9]*,/*)
+                    device=${i%%,*}
+                    device=${device/=/_}
+                    array=${i#*,}
+                    echo "ARRAY /dev/$device devices=$array"
+                    ;;
+                # raid UUID
+                md=[0-9]*,[0-9,a-fA-F]*)
+                    device=${i%%,*}
+                    device=${device/=/}
+                    array=${i#*,}
+                    echo "ARRAY /dev/$device UUID=$array"
+                    ;;
+                # partitionable raid UUID
+                md=d[0-9]*,[0-9,a-fA-F]*)
+                    device=${i%%,*}
+                    device=${device/=/_}
+                    array=${i#*,}
+                    echo "ARRAY /dev/$device UUID=$array"
+                    ;;
+            esac
+        done >>"$mdconfig"
+    fi
+
+    # assemble everything
+    [ -s "$mdconfig" ] && /sbin/mdassemble
+}
+
+# vim: set ft=sh ts=4 sw=4 et:

Copied: mdadm/repos/testing-i686/mdadm_install (from rev 169812, mdadm/trunk/mdadm_install)
===================================================================
--- testing-i686/mdadm_install	                        (rev 0)
+++ testing-i686/mdadm_install	2012-10-30 07:44:56 UTC (rev 169813)
@@ -0,0 +1,45 @@
+#!/bin/bash
+
+build() {
+    add_checked_modules -f 'dm-' 'drivers/md/*'
+
+    # check if a custom mdadm.conf exists
+    if grep -q ^ARRAY /etc/mdadm.conf; then
+        echo "Custom /etc/mdadm.conf file will be used in initramfs for assembling arrays."
+        add_file "/etc/mdadm.conf"
+    fi
+    add_binary "/sbin/mdassemble"
+
+    add_runscript
+}
+
+help() {
+  cat <<HELPEOF
+This hook loads the necessary modules for any raid root device,
+and assembles the raid device when run.
+
+If arrays are defined in /etc/mdadm.conf, the file will be used instead
+of command line assembling.
+
+Command Line Setup:
+- for raid arrays with persistent superblocks:
+  md=<md device no.>,dev0,dev1,...,devn
+  md=<md device no.>,uuid
+- for partitionable raid arrays with persistent superblocks:
+  md=d<md device no.>,dev0,dev1,...,devn
+  md=d<md device no.>,uuid
+
+Parameters:
+- <md device no.> = the number of the md device: 
+  0 means md0, 1 means md1, ...
+- <dev0-devn>: e.g. /dev/hda1,/dev/hdc1,/dev/sda1,/dev/sdb1
+                 or 0900878d:f95f6057:c39a36e9:55efa60a
+Examples:
+- md=d0,/dev/sda3,/dev/sda4 md=d1,/dev/hda1,/dev/hdb1
+  This will setup 2 md partitionable arrays.
+- md=0,/dev/sda3,/dev/sda4 md=1,/dev/hda1,/dev/hdb1
+  This will setup 2 md arrays with persistent superblocks.
+HELPEOF
+}
+
+# vim: set ft=sh ts=4 sw=4 et:

Copied: mdadm/repos/testing-i686/mdadm_udev_install (from rev 169812, mdadm/trunk/mdadm_udev_install)
===================================================================
--- testing-i686/mdadm_udev_install	                        (rev 0)
+++ testing-i686/mdadm_udev_install	2012-10-30 07:44:56 UTC (rev 169813)
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+build() {
+    add_checked_modules -f 'dm-' 'drivers/md/*'
+
+    # check if a custom mdadm.conf exists
+    if grep -qw ^ARRAY "$BASEDIR/etc/mdadm.conf"; then
+        echo "Custom /etc/mdadm.conf file will be used in initramfs for assembling arrays."
+        add_file "/etc/mdadm.conf"
+    fi
+
+    add_binary "mdadm"
+    add_file "/usr/lib/udev/rules.d/64-md-raid.rules"
+}
+
+help() {
+  cat <<HELPEOF
+This hook loads the necessary modules for a RAID array and uses incremental
+assembly via udev at runtime to create the devices. This hook with NOT work
+without the udev hook included on the image.
+HELPEOF
+}
+
+# vim: set ft=sh ts=4 sw=4 et:

Copied: mdadm/repos/testing-x86_64/PKGBUILD (from rev 169812, mdadm/trunk/PKGBUILD)
===================================================================
--- testing-x86_64/PKGBUILD	                        (rev 0)
+++ testing-x86_64/PKGBUILD	2012-10-30 07:44:56 UTC (rev 169813)
@@ -0,0 +1,58 @@
+# $Id$
+# Maintainer: Tobias Powalowski <tpowa at archlinux.org>
+# Contributor: Judd Vinet <jvinet at zeroflux.org>
+pkgname=mdadm
+pkgver=3.2.6
+pkgrel=1
+pkgdesc="A tool for managing/monitoring Linux md device arrays, also known as Software RAID"
+arch=(i686 x86_64)
+license=('GPL')
+url="http://neil.brown.name/blog/mdadm"
+groups=('base')
+conflicts=('mkinitcpio<0.7')
+depends=('glibc')
+backup=('etc/mdadm.conf')
+source=(ftp://ftp.kernel.org/pub/linux/utils/raid/mdadm/mdadm-$pkgver.tar.bz2
+        mdadm 
+        mdadm.conf 
+        mdadm_install
+        mdadm_hook
+        mdadm_udev_install
+        mdadm.service
+        disable-werror.patch)
+replaces=('raidtools')
+
+build() {
+  cd $srcdir/$pkgname-$pkgver
+  patch -Np0 -i ../disable-werror.patch
+  make CXFLAGS="$CFLAGS"
+  # build static mdassemble for Arch's initramfs
+  make MDASSEMBLE_AUTO=1 mdassemble
+  
+}
+
+package() {
+  cd $srcdir/$pkgname-$pkgver
+  make INSTALL=/usr/bin/install DESTDIR=$pkgdir install
+  install -D -m755 mdassemble $pkgdir/sbin/mdassemble
+  install -D -m644 ../mdadm.conf $pkgdir/etc/mdadm.conf
+  install -D -m755 ../mdadm $pkgdir/etc/rc.d/mdadm
+  install -D -m644 ../mdadm_install $pkgdir/usr/lib/initcpio/install/mdadm
+  install -D -m644 ../mdadm_hook $pkgdir/usr/lib/initcpio/hooks/mdadm
+  install -D -m644 ../mdadm_udev_install $pkgdir/usr/lib/initcpio/install/mdadm_udev
+  # symlink for backward compatibility
+  ln -sf /usr/lib/initcpio/hooks/mdadm  $pkgdir/usr/lib/initcpio/hooks/raid
+  # move /lib/* to /usr/lib/
+  mv $pkgdir/lib/udev $pkgdir/usr/lib/
+  rm -rf $pkgdir/lib
+  # systemd service file
+  install -D -m644 $srcdir/mdadm.service $pkgdir/usr/lib/systemd/system/mdadm.service
+}
+md5sums=('3e255dc71e5144bbcb872788ca647267'
+         '8333d405f550317c2bacd5510bf1cb60'
+         '00cbed931db4f15b6ce49e3e7d433966'
+         '609d10888727710cb20db7ac3e096116'
+         'fbb5542d9bdf87441a11dd7e7a0a17f8'
+         'd1d8e9eb81ce9347de74f3c84a9db09e'
+         'aafb5f9ac8437a284cbf948b9b13b179'
+         '4ad87b74a4bc9a34621280abe0e0c3e4')

Copied: mdadm/repos/testing-x86_64/disable-werror.patch (from rev 169812, mdadm/trunk/disable-werror.patch)
===================================================================
--- testing-x86_64/disable-werror.patch	                        (rev 0)
+++ testing-x86_64/disable-werror.patch	2012-10-30 07:44:56 UTC (rev 169813)
@@ -0,0 +1,11 @@
+--- Makefile.old	2011-06-17 09:38:03.269238332 +0200
++++ Makefile	2011-06-17 09:38:14.122398837 +0200
+@@ -42,7 +42,7 @@
+ 
+ CC = $(CROSS_COMPILE)gcc
+ CXFLAGS = -ggdb
+-CWFLAGS = -Wall -Werror -Wstrict-prototypes -Wextra -Wno-unused-parameter
++CWFLAGS = -Wall -Wstrict-prototypes -Wextra -Wno-unused-parameter
+ ifdef WARN_UNUSED
+ CWFLAGS += -Wp,-D_FORTIFY_SOURCE=2 -O
+ endif

Copied: mdadm/repos/testing-x86_64/linux-3.0.patch (from rev 169812, mdadm/trunk/linux-3.0.patch)
===================================================================
--- testing-x86_64/linux-3.0.patch	                        (rev 0)
+++ testing-x86_64/linux-3.0.patch	2012-10-30 07:44:56 UTC (rev 169813)
@@ -0,0 +1,45 @@
+From f161d047eed634b3380262767f955eb888502e88 Mon Sep 17 00:00:00 2001
+From: NeilBrown <neilb at suse.de>
+Date: Fri, 17 Jun 2011 22:49:24 +1000
+Subject: [PATCH 1/1] util: correctly parse shorter linux version numbers.
+
+The next version of Linux might be 3.0.  If it is, get_linux_version
+will fail.
+So make it more robust.
+
+Reported-by: Namhyung Kim <namhyung at gmail.com>
+Reported-by: Milan Broz <mbroz at redhat.com>
+Signed-off-by: NeilBrown <neilb at suse.de>
+---
+ util.c |   10 +++++-----
+ 1 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/util.c b/util.c
+index 10bbe56..55d171a 100644
+--- a/util.c
++++ b/util.c
+@@ -146,16 +146,16 @@ int get_linux_version()
+ {
+ 	struct utsname name;
+ 	char *cp;
+-	int a,b,c;
++	int a = 0, b = 0,c = 0;
+ 	if (uname(&name) <0)
+ 		return -1;
+ 
+ 	cp = name.release;
+ 	a = strtoul(cp, &cp, 10);
+-	if (*cp != '.') return -1;
+-	b = strtoul(cp+1, &cp, 10);
+-	if (*cp != '.') return -1;
+-	c = strtoul(cp+1, NULL, 10);
++	if (*cp == '.')
++		b = strtoul(cp+1, &cp, 10);
++	if (*cp == '.')
++		c = strtoul(cp+1, &cp, 10);
+ 
+ 	return (a*1000000)+(b*1000)+c;
+ }
+-- 
+1.7.2.3
+

Copied: mdadm/repos/testing-x86_64/mdadm (from rev 169812, mdadm/trunk/mdadm)
===================================================================
--- testing-x86_64/mdadm	                        (rev 0)
+++ testing-x86_64/mdadm	2012-10-30 07:44:56 UTC (rev 169813)
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+pidfile=/run/mdadm.pid
+if [[ -r $pidfile ]]; then
+  read -r PID <"$pidfile"
+  if [[ $PID && ! -d /proc/$PID ]]; then
+    # stale pidfile
+    unset PID
+    rm -f "$pidfile"
+  fi
+fi
+
+case $1 in
+  start)
+    stat_busy "Starting mdadm RAID Monitor"
+    if [[ -z $PID ]] && mdadm --monitor --scan -i "$pidfile" -f; then
+      add_daemon mdadm
+      stat_done
+    else
+      stat_fail
+    fi
+    ;;
+  stop)
+    stat_busy "Stopping mdadm RAID Monitor"
+    if [[ $PID ]] && kill "$PID" &>/dev/null; then
+      rm_daemon mdadm
+      stat_done
+    else
+      stat_fail
+    fi
+    ;;
+  restart)
+    $0 stop
+    sleep 1
+    $0 start
+    ;;
+  *)
+    echo "usage: $0 {start|stop|restart}"
+esac

Copied: mdadm/repos/testing-x86_64/mdadm.conf (from rev 169812, mdadm/trunk/mdadm.conf)
===================================================================
--- testing-x86_64/mdadm.conf	                        (rev 0)
+++ testing-x86_64/mdadm.conf	2012-10-30 07:44:56 UTC (rev 169813)
@@ -0,0 +1,67 @@
+# mdadm configuration file
+#
+# mdadm will function properly without the use of a configuration file,
+# but this file is useful for keeping track of arrays and member disks.
+# In general, a mdadm.conf file is created, and updated, after arrays
+# are created. This is the opposite behavior of /etc/raidtab which is
+# created prior to array construction.
+#
+#
+# the config file takes two types of lines:
+#
+#	DEVICE lines specify a list of devices of where to look for
+#	  potential member disks
+#
+#	ARRAY lines specify information about how to identify arrays so
+#	  so that they can be activated
+#
+
+
+# You can have more than one device line and use wild cards. The first 
+# example includes SCSI the first partition of SCSI disks /dev/sdb,
+# /dev/sdc, /dev/sdd, /dev/sdj, /dev/sdk, and /dev/sdl. The second 
+# line looks for array slices on IDE disks.
+#
+#DEVICE /dev/sd[bcdjkl]1
+#DEVICE /dev/hda1 /dev/hdb1
+#
+# The designation "partitions" will scan all partitions found in
+# /proc/partitions
+DEVICE partitions
+
+
+# ARRAY lines specify an array to assemble and a method of identification.
+# Arrays can currently be identified by using a UUID, superblock minor number,
+# or a listing of devices.
+#
+#	super-minor is usually the minor number of the metadevice
+#	UUID is the Universally Unique Identifier for the array
+# Each can be obtained using
+#
+# 	mdadm -D <md>
+#
+# To capture the UUIDs for all your RAID arrays to this file, run these:
+#    to get a list of running arrays:
+#    # mdadm -D --scan >>/etc/mdadm.conf
+#    to get a list from superblocks:
+#    # mdadm -E --scan >>/etc/mdadm.conf
+#
+#ARRAY /dev/md0 UUID=3aaa0122:29827cfa:5331ad66:ca767371
+#ARRAY /dev/md1 super-minor=1
+#ARRAY /dev/md2 devices=/dev/hda1,/dev/hdb1
+#
+# ARRAY lines can also specify a "spare-group" for each array.  mdadm --monitor
+# will then move a spare between arrays in a spare-group if one array has a
+# failed drive but no spare
+#ARRAY /dev/md4 uuid=b23f3c6d:aec43a9f:fd65db85:369432df spare-group=group1
+#ARRAY /dev/md5 uuid=19464854:03f71b1b:e0df2edd:246cc977 spare-group=group1
+#
+
+
+# When used in --follow (aka --monitor) mode, mdadm needs a
+# mail address and/or a program.  To start mdadm's monitor mode, add
+# "mdadm" to your DAEMONS array in /etc/rc.conf
+#
+# If the lines are not found, mdadm will exit quietly
+#MAILADDR root at mydomain.tld
+#PROGRAM /usr/sbin/handle-mdadm-events

Copied: mdadm/repos/testing-x86_64/mdadm.service (from rev 169812, mdadm/trunk/mdadm.service)
===================================================================
--- testing-x86_64/mdadm.service	                        (rev 0)
+++ testing-x86_64/mdadm.service	2012-10-30 07:44:56 UTC (rev 169813)
@@ -0,0 +1,8 @@
+[Unit]
+Description=MDADM Event Monitor
+
+[Service]
+ExecStart=/sbin/mdadm --monitor --scan
+
+[Install]
+WantedBy=multi-user.target

Copied: mdadm/repos/testing-x86_64/mdadm_hook (from rev 169812, mdadm/trunk/mdadm_hook)
===================================================================
--- testing-x86_64/mdadm_hook	                        (rev 0)
+++ testing-x86_64/mdadm_hook	2012-10-30 07:44:56 UTC (rev 169813)
@@ -0,0 +1,49 @@
+#!/usr/bin/ash
+
+run_hook() {
+    local i= mdconfig=/etc/mdadm.conf
+
+    # for partitionable raid, we need to load md_mod first!
+    modprobe md_mod 2>/dev/null
+
+    if [ -n "$md" ]; then
+        echo 'DEVICE partitions' >"$mdconfig"
+        for i in $(cat /proc/cmdline); do
+            case $i in
+                # raid
+                md=[0-9]*,/*)
+                    device=${i%%,*}
+                    device=${device/=/}
+                    array=${i#*,}
+                    echo "ARRAY /dev/$device devices=$array"
+                    ;;
+                # partitionable raid
+                md=d[0-9]*,/*)
+                    device=${i%%,*}
+                    device=${device/=/_}
+                    array=${i#*,}
+                    echo "ARRAY /dev/$device devices=$array"
+                    ;;
+                # raid UUID
+                md=[0-9]*,[0-9,a-fA-F]*)
+                    device=${i%%,*}
+                    device=${device/=/}
+                    array=${i#*,}
+                    echo "ARRAY /dev/$device UUID=$array"
+                    ;;
+                # partitionable raid UUID
+                md=d[0-9]*,[0-9,a-fA-F]*)
+                    device=${i%%,*}
+                    device=${device/=/_}
+                    array=${i#*,}
+                    echo "ARRAY /dev/$device UUID=$array"
+                    ;;
+            esac
+        done >>"$mdconfig"
+    fi
+
+    # assemble everything
+    [ -s "$mdconfig" ] && /sbin/mdassemble
+}
+
+# vim: set ft=sh ts=4 sw=4 et:

Copied: mdadm/repos/testing-x86_64/mdadm_install (from rev 169812, mdadm/trunk/mdadm_install)
===================================================================
--- testing-x86_64/mdadm_install	                        (rev 0)
+++ testing-x86_64/mdadm_install	2012-10-30 07:44:56 UTC (rev 169813)
@@ -0,0 +1,45 @@
+#!/bin/bash
+
+build() {
+    add_checked_modules -f 'dm-' 'drivers/md/*'
+
+    # check if a custom mdadm.conf exists
+    if grep -q ^ARRAY /etc/mdadm.conf; then
+        echo "Custom /etc/mdadm.conf file will be used in initramfs for assembling arrays."
+        add_file "/etc/mdadm.conf"
+    fi
+    add_binary "/sbin/mdassemble"
+
+    add_runscript
+}
+
+help() {
+  cat <<HELPEOF
+This hook loads the necessary modules for any raid root device,
+and assembles the raid device when run.
+
+If arrays are defined in /etc/mdadm.conf, the file will be used instead
+of command line assembling.
+
+Command Line Setup:
+- for raid arrays with persistent superblocks:
+  md=<md device no.>,dev0,dev1,...,devn
+  md=<md device no.>,uuid
+- for partitionable raid arrays with persistent superblocks:
+  md=d<md device no.>,dev0,dev1,...,devn
+  md=d<md device no.>,uuid
+
+Parameters:
+- <md device no.> = the number of the md device: 
+  0 means md0, 1 means md1, ...
+- <dev0-devn>: e.g. /dev/hda1,/dev/hdc1,/dev/sda1,/dev/sdb1
+                 or 0900878d:f95f6057:c39a36e9:55efa60a
+Examples:
+- md=d0,/dev/sda3,/dev/sda4 md=d1,/dev/hda1,/dev/hdb1
+  This will setup 2 md partitionable arrays.
+- md=0,/dev/sda3,/dev/sda4 md=1,/dev/hda1,/dev/hdb1
+  This will setup 2 md arrays with persistent superblocks.
+HELPEOF
+}
+
+# vim: set ft=sh ts=4 sw=4 et:

Copied: mdadm/repos/testing-x86_64/mdadm_udev_install (from rev 169812, mdadm/trunk/mdadm_udev_install)
===================================================================
--- testing-x86_64/mdadm_udev_install	                        (rev 0)
+++ testing-x86_64/mdadm_udev_install	2012-10-30 07:44:56 UTC (rev 169813)
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+build() {
+    add_checked_modules -f 'dm-' 'drivers/md/*'
+
+    # check if a custom mdadm.conf exists
+    if grep -qw ^ARRAY "$BASEDIR/etc/mdadm.conf"; then
+        echo "Custom /etc/mdadm.conf file will be used in initramfs for assembling arrays."
+        add_file "/etc/mdadm.conf"
+    fi
+
+    add_binary "mdadm"
+    add_file "/usr/lib/udev/rules.d/64-md-raid.rules"
+}
+
+help() {
+  cat <<HELPEOF
+This hook loads the necessary modules for a RAID array and uses incremental
+assembly via udev at runtime to create the devices. This hook with NOT work
+without the udev hook included on the image.
+HELPEOF
+}
+
+# vim: set ft=sh ts=4 sw=4 et:




More information about the arch-commits mailing list