* martin f krafft <madd...@debian.org> [Sat Aug 07, 2010 at 09:09:11AM +0200]:
> also sprach Michael Prokop <m...@debian.org> [2010.08.07.0213 +0200]:
> > While preparing the FAI version for Squeeze we noticed that
> > this bug is reproducable and shouldn't reach Squeeze.
> > I'm raising the severity therefore, Martin - if you need any help
> > please let me know, I'm willing to help out.

> At the moment I am so far from development that I would appreciate
> any help.

> However, I have built 3.1.3-1 and that solves a few problems I've
> had:

>   http://scratch.madduck.net/mdadm_3.1.3-1_source%2Bamd64%2Bi386_bundle.tar.gz

> Try it first…

No, this doesn't fix the problem.

I've created a bugfix for this issue which is against mdadm version
of unstable (3.1.2-2) and has been tested, see attached patch file.
I'd be happy to upload this as NMU so the issue is resolved, please
let me know whether that's fine for you.

regards,
-mika-
From 00736ee9dd7106ac3ddcfa604a020d118dce0ac4 Mon Sep 17 00:00:00 2001
From: Michael Prokop <m...@grml.org>
Date: Sat, 7 Aug 2010 11:12:58 -0400
Subject: [PATCH] initamfs/hook: make sure configuration file exists before accessing it. [Closes: #589836]

Signed-off-by: Michael Prokop <m...@grml.org>

diff --git a/debian/initramfs/hook b/debian/initramfs/hook
index 368b3ae..b7eab11 100644
--- a/debian/initramfs/hook
+++ b/debian/initramfs/hook
@@ -90,7 +90,9 @@ INITRDSTART=all
 DESTMDADMCONF=$DESTDIR/etc/mdadm/mdadm.conf
 DESTCONFIG=$DESTDIR/conf/conf.d/md
 
-homehost="$(sed -ne 's,^[[:space:]]*HOMEHOST[[:space:]]*,,p' $CONFIG)"
+if [ -f $CONFIG ]; then
+  homehost="$(sed -ne 's,^[[:space:]]*HOMEHOST[[:space:]]*,,p' $CONFIG)"
+fi
 if [ -z "${homehost:-}" ] || [ "${homehost:-}" = '<system>' ]; then
   echo "MD_HOMEHOST='$(hostname)'" > $DESTCONFIG
 fi
@@ -100,7 +102,9 @@ install_config()
   # install the configuration file
   mkdir -p ${2%/*}
   # only copy ARRAY/DEVICE/HOMEHOST lines, and merge continuation lines into one
-  sed -e :a -re '$!N;s/\n[[:space:]]+/ /;ta' -ne '/^(ARRAY|DEVICE|HOMEHOST)/P;D' $1 > $2
+  if [ -f "$1" ] ; then
+    sed -e :a -re '$!N;s/\n[[:space:]]+/ /;ta' -ne '/^(ARRAY|DEVICE|HOMEHOST)/P;D' $1 > $2
+  fi
 }
 
 if [ ! -f $CONFIG ]; then
-- 
1.7.1

Attachment: signature.asc
Description: Digital signature

Reply via email to