#!/bin/sh
#
# downloads and installs the patched grub in /target

cd /target/tmp/

wget http://honk.sigxcpu.org/projects/multipath-tools/lenny/latest_i386.deb -O /target/tmp/grub_i386.deb

cat <<EOF >/target/boot/grub/device.map
(hd0) /dev/mapper/mpath0
EOF

chroot /target dpkg -i /tmp/grub_i386.deb
cat <<EOF | chroot /target grub --batch --device-map=/boot/grub/device.map
root (hd0,0)
setup (hd0)
EOF

