RAID1 and grub - again

Cristian Ionescu-Idbohrn cristian.ionescu-idbohrn at axis.com
Thu Jan 28 21:06:58 CET 2010


On Thu, 28 Jan 2010, Darshaka Pathirana wrote:

> diff -r 282adc0454ed class/50-host-classes
> --- a/class/50-host-classes     Mon Jan 25 12:38:32 2010 +0100
> +++ b/class/50-host-classes     Thu Jan 28 18:27:11 2010 +0100
> @@ -29,5 +29,5 @@
>         echo "FAIBASE DHCPC" ;;
>  esac
>
> -(ifclass I386 || ifclass AMD64) && echo GRUB
> +(ifclass I386 || ifclass AMD64) && [ ! ifclass GRUB_PC ] && echo GRUB

To avoid forking a subshell and getting a syntax error, I think you want
to use this instead:

{ ifclass I386 || ifclass AMD64; } && ! ifclass GRUB_PC && echo GRUB

> diff -r 282adc0454ed scripts/GRUB_PC/10-setup
> --- a/scripts/GRUB_PC/10-setup  Mon Jan 25 12:38:32 2010 +0100
> +++ b/scripts/GRUB_PC/10-setup  Thu Jan 28 18:27:11 2010 +0100
> @@ -3,7 +3,11 @@
>  error=0 ; trap "error=$((error|1))" ERR
>
>  $ROOTCMD grub-mkdevicemap -n -m /boot/grub/device.map
> -$ROOTCMD grub-mkconfig -o /boot/grub/grub.cfg
> -$ROOTCMD grub-install --no-floppy "(hd0)"
> +$ROOTCMD update-grub
> +
> +for device in $(echo $BOOT_DEVICE); do

To avoid forking a subshell, I think you want to use this instead:

for device in $BOOT_DEVICE; do

There's no error check here:

> +       GROOT=$(device2grub $device)

so you may end up executing:

> +       $ROOTCMD grub-install --no-floppy "$GROOT"

with an empty 3rd argument (1st grub-install argument), which will produce
an error (which is not handled).


Cheers,

-- 
Cristian


More information about the linux-fai mailing list