Bug#605562: [PATCH] Second try at fixing bug#605562 (installing the boot loader to the wrong device)
Amend changes from 1.57: call device_to_disk on the device mounted as
cdrom. Booting from a disk or usb device, that may end up being
/dev/sda1 instead of /dev/sda, defeating the "we shouldn't install GRUB
to the installation device" test.
Many thanks to Alexander Reichle-Schmehl and Michael Tokarev for the
tests.
Signed-off-by: Julien Cristau <jcristau@debian.org>
---
debian/changelog | 9 +++++++++
grub-installer | 2 +-
2 files changed, 10 insertions(+), 1 deletions(-)
Tolimar's syslog at http://www.schmehl.info/tmp/d-i-bug/syslog shows
cdsrc=/dev/sda1 and default_bootdev=/dev/sda.
Joachim's issue seems to be a different one, with the stick (sda1)
mounted on /hd-media, and /cdrom mounted from a loop device. Maybe the
tests for /cdrom need to be duplicated for /hd-media?
diff --git a/debian/changelog b/debian/changelog
index 59079ef..be29b6d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+grub-installer (1.59) UNRELEASED; urgency=low
+
+ * Amend changes from 1.57: call device_to_disk on the device mounted as
+ cdrom. Booting from a disk or usb device, that may end up being
+ /dev/sda1 instead of /dev/sda, defeating the "we shouldn't install GRUB to
+ the installation device" test.
+
+ -- Julien Cristau <jcristau@debian.org> Tue, 11 Jan 2011 17:41:21 +0100
+
grub-installer (1.58) unstable; urgency=low
[ Christian Perrier ]
diff --git a/grub-installer b/grub-installer
index 463ebdf..13e9f8a 100755
--- a/grub-installer
+++ b/grub-installer
@@ -554,7 +554,7 @@ hybrid=false
if db_get cdrom-detect/hybrid; then
hybrid="$RET"
fi
-if [ "$cdsrc" = "$default_bootdev" ] || \
+if [ "$(device_to_disk $cdsrc)" = "$default_bootdev" ] || \
([ "$default_bootdev" = '(hd0)' ] && \
(([ -n "$cdfs" ] && [ "$cdfs" != "iso9660" ]) || \
[ "$hybrid" = true ])); then
--
1.7.2.3
Reply to: