From: Michael Prokop Date: Wed, 8 Jul 2009 00:34:09 +0000 (+0200) Subject: Apply patch which address the /dev/cciss/c0d0* issue X-Git-Tag: v0.29~7 X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=commitdiff_plain;h=413d77e0e867f7b8222a1bb70f228d0821587576;hp=91e412240c9fec18eef9534ed407aeac0e879f9e Apply patch which address the /dev/cciss/c0d0* issue --- diff --git a/debian/changelog b/debian/changelog index d1f5178..b163b75 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,8 +15,10 @@ grml-debootstrap (0.29) UNRELEASED; urgency=low * Do not try to create /etc/debootstrap if it already exists (which might be the case when installing to a directory). * Mention hostname in configuration check dialog. + * Apply patch by Zoran Dzelajlija which addresses the partition + calculation problem when installing to /dev/cciss/c0d0*. Thanks! - -- Michael Prokop Wed, 08 Jul 2009 02:26:14 +0200 + -- Michael Prokop Wed, 08 Jul 2009 02:27:09 +0200 grml-debootstrap (0.28) unstable; urgency=low diff --git a/grml-debootstrap b/grml-debootstrap index 9bda8e3..9babb26 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -203,22 +203,39 @@ prompt_for_target() prompt_for_bootmanager() { ADDITIONAL_PARAMS="" - for device in sda hda; do - if [ /dev/$device != ${TARGET%[0-9]} ]; then + + if echo "$TARGET" | grep -q "/dev/md" ; then + MBRPART="all disks of Software RAID $TARGET" + else + # figure out whole disk device + found= + for device in /dev/disk/by-id/* + do + [ $(readlink -f $device) = ${TARGET} ] || continue + found=1 + break + done + [ -n "$found" ] && MBRDISK=$(echo ${device}|sed -e 's/-part[0-9][0-9]*$//') + if [ -e "$MBRDISK" ]; then + MBRDISK=$(readlink -f $MBRDISK) + else + # fall back to old behaviour + MBRDISK=$(echo ${TARGET} | sed -e 's/[0-9][0-9]*$/') + fi + + MBRPART="MBR of $MBRDISK" + fi + + for device in cciss/c0d0 sda hda; do + if [ /dev/$device != ${MBRDISK} ]; then grep -q $device /proc/partitions && \ - ADDITIONAL_PARAMS=:$device:"install bootmanager grub into MBR of /dev/${device}" + ADDITIONAL_PARAMS="$ADDITIONAL_PARAMS:$device:install bootmanager grub into MBR of /dev/$device" fi done ADDITIONAL_PARAMS=${ADDITIONAL_PARAMS#:} OIFS="$IFS"; IFS=: - if echo $TARGET | grep -q "/dev/md" ; then - MBRPART="all disks of Software RAID $TARGET" - else - MBRPART="MBR of ${TARGET%[0-9]}" - fi - GETMBR=$(dialog --stdout --title "$PN" --default-item mbr \ --menu "Where do you want to install the bootmanager grub?" 0 0 0 \ mbr "install bootmanager into $MBRPART" \ @@ -231,10 +248,10 @@ prompt_for_bootmanager() case "$GETMBR" in mbr) # /dev/md0: has to be installed in MBR of /dev/md0 and not in /dev/md: - if echo $TARGET | grep -q "*md*" ; then - BOOT_PARTITION="${TARGET}" + if echo "$TARGET" | grep -q "/dev/md" ; then + BOOT_PARTITION="$TARGET" else - BOOT_PARTITION="${TARGET%[0-9]}" + BOOT_PARTITION="$MBRDISK" fi ;; partition)