No subject


Wed Jul 30 17:08:51 UTC 2008


displayed in verbose mode.

Of course this made debugging difficult.


Ok, if you really don't want to replace the device.map on the fly,
let me propose yet another solution: in case of grub-probe failure, we
regenerate a device.map in a temporary file and we try grub-probe again
but with --device-map pointing to this temporary file. That way the
default device.map doesn't get modified and we still have a chance to mak=
e
it work by default. We would display a message saying that the device.map
has to be verified if we succeed through the fallback solution.

Please find the corresponding patch attached.

Cheers,
--=20
Rapha=C3=ABl Hertzog

Le best-seller fran=C3=A7ais mis =C3=A0 jour pour Debian Etch :
http://www.ouaza.com/livre/admin-debian/

--SLDf9lqlvOQaIe6s
Content-Type: text/plain; charset=iso-8859-15
Content-Disposition: attachment; filename=patch
Content-Transfer-Encoding: quoted-printable

Index: update-grub
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- update-grub	(r=C3=A9vision 1095)
+++ update-grub	(copie de travail)
@@ -152,7 +152,17 @@
 	if ! test -e ${device_map} ; then
 		echo quit | grub --batch --no-floppy --device-map=3D${device_map} > /d=
ev/null
 	fi
-	GRUB_LEGACY_0_BASED_PARTITIONS=3D1 grub-probe --device-map=3D${device_m=
ap} -t drive -d "$1" 2> /dev/null
+	GRUB_LEGACY_0_BASED_PARTITIONS=3D1 grub-probe --device-map=3D${device_m=
ap} -t drive -d "$1" 2> /dev/null || {=20
+		echo "warning: grub-probe can't find drive for $1." >&2
+		tmp_map=3D$(mktemp -t device.map.XXXXXXXX)
+		grub-mkdevicemap --device-map=3D${tmp_map} --no-floppy >/dev/null 2>&1=
 || true
+		GRUB_LEGACY_0_BASED_PARTITIONS=3D1 grub-probe --device-map=3D${tmp_map=
} -t drive -d "$1" || {
+			rm -f ${tmp_map}
+			return 1
+		}
+		echo "Please check ${device_map}, you might have to update it with gru=
b-mkdevicemap." >&2
+		rm -f ${tmp_map}
+	}
 }
=20
 # Usage: convert_default os_device

--SLDf9lqlvOQaIe6s--





More information about the Pkg-grub-devel mailing list