OSDN Git Service

Use a grub device map so that e.g. virtio disks will boot
authorOliver Henshaw <oliver.henshaw@gmail.com>
Fri, 12 Dec 2014 12:44:10 +0000 (12:44 +0000)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Tue, 16 Dec 2014 08:43:21 +0000 (16:43 +0800)
grub seems to detect sda and hda disks fine but needs a little guidance
to find vda disks.

install/scripts/1-install

index b8cb4a6..7b21e94 100644 (file)
@@ -237,10 +237,12 @@ install_to()
                        d=$(($d+1))
                done
                p=$((`echo $1 | cut -b4-`-1))
+               disk=`echo $1 | cut -b-3`
                create_menulst $p
                create_winitem $1 $d
                rm -f /hd/boot/grub/stage1
-               echo "setup (hd$d) (hd$d,$p)" | grub > /dev/tty5
+               echo "(hd$d) /dev/$disk" > /hd/grub/device.map
+               echo "setup (hd$d) (hd$d,$p)" | grub --device-map /hd/grub/device.map > /dev/tty5
                [ $? -ne 0 ] && return 255
        fi