Bug#547382: Detect windows recovery partitions (fix provided)

2009-12-16 Thread anomie
I'm not sure if it came that way or if it got changed by the Debian
installer (snapshot from 2009-12-11), but the recovery partition on my
new Thinkpad T500 is type 7 rather than 27. The recovery partition is
also detected as Vista rather than 7, FWIW.

This check along the same lines as the Windows 7 check seems to work for
me:

@@ -21,6 +21,8 @@
bcd=$(item_in_dir bcd $2/$boot); then
if 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. .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)
else
long=Windows Vista (loader)
fi

Of course, if that generic naming is used then grub-common's
30_os-prober probably has to be updated to match.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#547382: Detect windows recovery partitions (fix provided)

2009-09-19 Thread r.c.volgers
Package: os-prober
Version: 1.33

The version of os-prober in ubuntu 9.10 alpha 6 fails to detect the recovery 
partition on my acer laptop, instead detecting it as a second vista install. 
This leads to two identical options in grub, which is confusing.

After a little reading I think this can be fixed in a generic way, since 
Microsoft has some guidelines for marking recovery partitions.

After adding the following lines to /usr/lib/os-probes/mounted/20microsoft 
(near the bottom) my recovery partition is properly labeled in Grub.

This code should be safe, since the FS was already confirmed to be a MS one.

Apologies for the sed ugliness, but sfdisk wants the partition id as a separate 
parameter ('/dev/sda 1' instead of '/dev/sda1'), so I couldn't see any other 
way.

# Detect recovery partitions by comparing partition id to 27 (hex value, so 
string comparison)
# For more details on recovery partitions:
# 
http://blogs.msdn.com/winre/archive/2007/01/12/how-to-install-winre-on-the-hard-disk.aspx
if partid=$(sfdisk --print-id $(echo $partition | sed 's/^\(.*\)\([0-9]\)$/\1 
\2/'))  [ $partid = 27 ] ; then
long=Recovery partition for $long
fi




--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#547382: Detect windows recovery partitions (fix provided)

2009-09-19 Thread Otavio Salvador
Hello,

On Sat, Sep 19, 2009 at 6:27 AM,  r.c.volg...@student.utwente.nl wrote:
 Package: os-prober
 Version: 1.33

 The version of os-prober in ubuntu 9.10 alpha 6 fails to detect the recovery 
 partition on my acer laptop, instead detecting it as a second vista install. 
 This leads to two identical options in grub, which is confusing.

I agree it is confusing and we ought to do something about it.

 After adding the following lines to /usr/lib/os-probes/mounted/20microsoft 
 (near the bottom) my recovery partition is properly labeled in Grub.

 This code should be safe, since the FS was already confirmed to be a MS one.

 Apologies for the sed ugliness, but sfdisk wants the partition id as a 
 separate parameter ('/dev/sda 1' instead of '/dev/sda1'), so I couldn't see 
 any other way.

 # Detect recovery partitions by comparing partition id to 27 (hex value, so 
 string comparison)
 # For more details on recovery partitions:
 # 
 http://blogs.msdn.com/winre/archive/2007/01/12/how-to-install-winre-on-the-hard-disk.aspx
 if partid=$(sfdisk --print-id $(echo $partition | sed 's/^\(.*\)\([0-9]\)$/\1 
 \2/'))  [ $partid = 27 ] ; then
        long=Recovery partition for $long
 fi

I don't think this matching is generic enough for other possible
devices name. I ended up with following patch (untested):

Index: os-probes/mounted/x86/20microsoft
===
--- os-probes/mounted/x86/20microsoft   (revisão 60796)
+++ os-probes/mounted/x86/20microsoft   (cópia de trabalho)
@@ -53,6 +53,11 @@
long=Windows NT/2000/XP (loader)
fi
fi
+# Detect recovery partitions by comparing partition id to 27.
+# Details about MS guidelines  on recovery partitions:
+# 
http://blogs.msdn.com/winre/archive/2007/01/12/how-to-install-winre-on-the-hard-disk.aspx
+elif partid=$(sfdisk --print-id $(echo $partition | sed
's/^\([a-z/]*\)\([0-9]*\)$/\1 \2/'))  [ $partid = 27 ] ; then
+long=Recovery partition for $long
 # MS-DOS
 elif [ -d $(item_in_dir dos $2) ]; then
long=MS-DOS 5.x/6.x/Win3.1

Could you test it?

-- 
Otavio Salvador  O.S. Systems
E-mail: ota...@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org