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

Bug#666764: [os-prober] 20microsoft is stuck on Vista (newer Windows versions sometimes detected as Vista, encoding problem)



Package: os-prober
Version: 1.51
Severity: normal

20microsoft's detection of Windows Vista and ulterior is problematic. First, it's stuck in Vista times. The comment and the fallback case should be updated. Perhaps "Windows Vista or superior", "Unrecognized Windows version" or "Recent Windows version". In my previous install, both my Windows 7 partition and its recovery partition were showing as "Windows Vista (loader)" (identical labels).

This test is grepping a binary file for strings. While the presence of these strings in the file may be reliable, grepping a binary file is unfortunately not nice and this apparently causes issues when os-prober runs in the installer's context, where the test always falls back to "Windows Vista (loader)". I'm not sure what's going on, but this shows the problem:

/target/mnt/Boot # ../../bin/grep "W.i.n.d.o.w.s" BCD
Binary file BCD matches
# grep "W.i.n.d.o.w.s" BCD
# ../../bin/busybox grep "W.i.n.d.o.w.s" BCD
[Much randomness (works)]

So it seems there's a problem with the *installer's* busybox grep. The installed busybox grep works fine. It's not the pattern syntax that's different.

This test works when run after installation, or in-target (as is the case when grub-installer runs update-grub).
# Vista (previously Longhorn)
if item_in_dir -q bootmgr "$2"; then
    # there might be different boot directories in different case as:
    # boot Boot BOOT
    for boot in $(item_in_dir boot "$2"); do
        bcd=$(item_in_dir bcd "$2/$boot")
        if [ -n "$bcd" ]; 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. .V.i.s.t.a" "$2/$boot/$bcd"; then
                long="Windows Vista (loader)"
elif grep -qs "W.i.n.d.o.w.s. .S.e.r.v.e.r. .2.0.0.8. .R.2." "$2/$boot/$bcd"; then
                long="Windows Server 2008 R2 (loader)"
elif grep -qs "W.i.n.d.o.w.s. .S.e.r.v.e.r. .2.0.0.8." "$2/$boot/$bcd"; then
                long="Windows Server 2008 (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)"
elif grep -qs "W.i.n.d.o.w.s. .S.e.t.u.p" "$2/$boot/$bcd"; then
                long="Windows Recovery Environment (loader)"
            else
                long="Windows Vista (loader)"
            fi
            short=Windows

            found=true

            break
        fi
    done
fi




Reply to: