[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#589676: [os-prober] Confuses the Vista partitions

I've quickly created a patch for my Acer Aspire 7220 with Windows Vista préinstalled against version 1.39 of os-prober (Debian Sid/unstable).

Explanation :

/dev/sda1 is my rescue Vista partition
fdisk reports it as ID 12  Compaq diagnostics (Ah, Acer has something to do with Compaq ?)
/mnt/sda1/boot/bcd reports it as "Windows Setup"

/dev/sda2 is my Vista partition
fdisk reports it as ID 6  FAT16 (I don't know why Acer didn't format it as NTFS)
/mnt/sda2/boot/bcd reports it as "Microsoft Windows Vista"

Before my patch
/dev/sda1:Windows Vista (loader):Windows:chain
/dev/sda2:Windows Recovery Environment (loader):Windows1:chain

After my patch
/dev/sda1:Windows Recovery Environment (loader):Windows:chain
/dev/sda2:Windows Vista (loader):Windows1:chain

Of course, this patch would not solve all issues. For that we'll need to know all the various rescue bcd labels used by manufacturers for their rescue partitions but at least it gives a hint on how to fix this issue.

Hope it helps,

--- 20microsoft.orig	2010-03-23 14:29:02.000000000 +0100
+++ 20microsoft	2010-07-23 18:44:30.000000000 +0200
@@ -19,8 +19,18 @@
 # Vista (previously Longhorn)
 if item_in_dir -q bootmgr "$2" && boot="$(item_in_dir boot "$2")" &&
    bcd="$(item_in_dir bcd "$2/$boot")"; then
-	if grep -qs "W.i.n.d.o.w.s. .7" "$2/$boot/$bcd"; then
+	# jdegreef at gmail dot com
+	# Debian bug#589676: [os-prober] Confuses the Vista partitions
+	# see also https://bugs.launchpad.net/ubuntu/+source/os-prober/+bug/476625 for more info
+	# if grep -qs "W.i.n.d.o.w.s. .7" "$2/$boot/$bcd"; then
+	#	long="Windows 7 (loader)"
+	if grep -qs "W.i.n.d.o.w.s. .V.i.s.t.a" "$2/$boot/$bcd"; then
+		long="Windows Vista (loader)"
+	elif grep -qs "W.i.n.d.o.w.s. .7" "$2/$boot/$bcd"; then
 		long="Windows 7 (loader)"
+	elif grep -qs "W.i.n.d.o.w.s. .S.e.t.u.p" "$2/$boot/$bcd"; then
+		long="Windows Recovery Environment (loader)"
+	# jdegreef end
 	elif grep -qs "W.i.n.d.o.w.s. .R.e.c.o.v.e.r.y. .E.n.v.i.r.o.n.m.e.n.t" "$2/$boot/$bcd"; then
 		long="Windows Recovery Environment (loader)"
 	elif grep -qs "W.i.n.d.o.w.s. .S.e.r.v.e.r. . .R.2." "$2/$boot/$bcd"; then
@@ -28,7 +38,8 @@
 	elif grep -qs "W.i.n.d.o.w.s. .S.e.r.v.e.r. ." "$2/$boot/$bcd"; then
 		long="Windows Server 2008 (loader)"
-		long="Windows Vista (loader)"
+		# jdegr long="Windows Vista (loader)"
+		long="Unknown Windows Partition (loader)"
 # 2000/XP/NT4.0

Reply to: