fix using grub device name as install device

Shell version of grub-install called grub-setup which resolved
install device name and called main setup routine. C version of
grub-install calls main setup routine directly, which leads
to the error:

grub2-install: info: grub-bios-setup  --verbose  --force  --skip-fs-probe --directory='/boot/grub2/i386-pc' --device-map='/boot/grub2/device.map' '(hd2)'.
grub2-install: info: reading /boot/grub2/i386-pc/boot.img.
grub2-install: info: reading /boot/grub2/i386-pc/core.img.
grub2-install: info: root is `(null)', dest is `(hd2)'.
grub2-install: info: Opening dest.
grub2-install: info: drive = -1.
grub2-install: error: disk `(hd2)' not found.

Move resolving of destination device name into main setup routine
so it is done consistently in both cases.
This commit is contained in:
Andrey Borzenkov 2013-11-29 11:32:34 +04:00
parent eec893ae49
commit 69ca97c820
3 changed files with 34 additions and 41 deletions

View file

@ -1,3 +1,11 @@
2013-11-29 Andrey Borzenkov <arvidjaar@gmail.com>
* util/grub-setup.c (main): Move parsing of (hdX) syntax to ...
* util/setup.c (SETUP): ... here. Fixes regression: grub-install
failed to install on (hdX).
* util/grub-setup.c (get_device_name): Remove, not needed after
above change.
2013-11-29 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/kern/emu/hostfs.c (is_dir): Remove variable length arrays.