Package: partman-md
Version: 70
Severity: normal
Tags: patch

finish-install.d/65partman-md reads:

 CF=/target/etc/mdadm/mdadm.conf
 if ... then
        mkdir -p /target/etc/mdadm
        echo "# Autogenerated by partman-md. See mdadm.conf(5) for more details 
on this file." > /etc/mdadm.conf
        echo "DEVICE partitions" >> $CF
        ...

and all subsequent lines adds information to $CF.
But the very first line, the "Autogenerated.." header
line, is put into d-i filesystem, where it is not used.
The intention was, obviously, to put it to target
mdadm.conf, ie, to $CF.

Appended patch does just that.  While at it, it also
replaces argument of mkdir to be ${CF%/*}, to keep
path info in only one place, in CF variable assignment
( ${var%pattern} construct works with dash too).

Thanks,

/mjt
--- partman-md/finish-install.d/65partman-md.orig
+++ partman-md/finish-install.d/65partman-md
@@ -2,8 +2,8 @@
 CF=/target/etc/mdadm/mdadm.conf
 if [ ! -s "$CF" ] && [ -e /proc/mdstat ] && \
    grep ^md /proc/mdstat >/dev/null; then
-	mkdir -p /target/etc/mdadm
-	echo "# Autogenerated by partman-md. See mdadm.conf(5) for more details on this file." > /etc/mdadm.conf
+	mkdir -p ${CF%/*}
+	echo "# Autogenerated by partman-md. See mdadm.conf(5) for more details on this file." > $CF
 	echo "DEVICE partitions" >> $CF
 	if [ "$(udpkg --print-os)" = "kfreebsd" ]; then
 		mount -t linprocfs proc /target/proc

Reply via email to