diff options
author | martin f. krafft <madduck@debian.org> | 2009-07-21 10:19:43 +0200 |
---|---|---|
committer | martin f. krafft <madduck@debian.org> | 2009-07-21 11:05:38 +0200 |
commit | 2e0548313b4259d0fb70ef9605cf26a7f10a2616 (patch) | |
tree | 3bf4b7f9605b7c2cb1b9d53477875dc594d8d8a0 /debian/initramfs | |
parent | 770cf5d6f6c80c93759769cc3821651be2d3b538 (diff) |
only store MD_HOMEHOST if config does not
Signed-off-by: martin f. krafft <madduck@debian.org>
Diffstat (limited to 'debian/initramfs')
-rw-r--r-- | debian/initramfs/hook | 12 | ||||
-rw-r--r-- | debian/initramfs/script.local-top | 2 |
2 files changed, 5 insertions, 9 deletions
diff --git a/debian/initramfs/hook b/debian/initramfs/hook index 6e6066dc..24a0a14b 100644 --- a/debian/initramfs/hook +++ b/debian/initramfs/hook @@ -90,21 +90,17 @@ INITRDSTART=all DESTMDADMCONF=$DESTDIR/etc/mdadm/mdadm.conf DESTCONFIG=$DESTDIR/conf/conf.d/md -# save the homehost for now, even if we don't use it yet -if [ -f $CONFIG ]; then - homehost="$(sed -ne 's,^[[:space:]]*HOMEHOST[[:space:]]*,,p' $CONFIG)" -fi +homehost="$(sed -ne 's,^[[:space:]]*HOMEHOST[[:space:]]*,,p' $CONFIG)" if [ -z "${homehost:-}" ] || [ "${homehost:-}" = '<system>' ]; then - homehost="$(hostname)" + echo "MD_HOMEHOST='$(hostname)'" > $DESTCONFIG fi -echo "MD_HOMEHOST='$homehost'" > $DESTCONFIG install_config() { # install the configuration file mkdir -p ${2%/*} - # only copy ARRAY and DEVICE lines, and merge continuation lines into one - sed -e :a -re '$!N;s/\n[[:space:]]+/ /;ta' -ne '/^(ARRAY|DEVICE)/P;D' $1 > $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 $CONFIG ]; then diff --git a/debian/initramfs/script.local-top b/debian/initramfs/script.local-top index db89fac5..0148f24b 100644 --- a/debian/initramfs/script.local-top +++ b/debian/initramfs/script.local-top @@ -76,7 +76,7 @@ if [ "$MD_DEVS" = all ]; then verbose && log_begin_msg "Assembling all MD arrays" extra_args='' - [ -n "$MD_HOMEHOST" ] && extra_args="--homehost='$MD_HOMEHOST'" + [ -n "${MD_HOMEHOST:-}" ] && extra_args="--homehost='$MD_HOMEHOST'" if $MDADM --assemble --scan --run --auto=yes $extra_args; then verbose && log_success_msg "assembled all arrays." else |