#605857 installation in d-i triggered uninitialized value warnings from debconf (and debconf questions were not displayed)

Package:
grub-pc
Source:
grub2
Description:
GRand Unified Bootloader, version 2 (PC/BIOS version)
Submitter:
Joey Hess
Date:
2010-12-04 21:24:03 UTC
Severity:
normal
#605857#5
Date:
2010-12-04 05:15:08 UTC
From:
To:
Boot method: USB stick
Image version: http://cdimage.debian.org/cdimage/squeeze_di_beta1/i386/iso-cd/debian-squeeze-di-beta1-i386-CD-1.iso

Machine: Toshiba Satellite C655-S5119 laptop
Partitions:

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         192     1536000   27  Unknown
/dev/sda2             192        6368    49609375    7  HPFS/NTFS
/dev/sda3           37733       38914     9486336   17  Hidden HPFS/NTFS
/dev/sda4            6368       37733   251937793    5  Extended
/dev/sda5            6368       37491   249999360   83  Linux
/dev/sda6           37492       37733     1937408   82  Linux swap / Solaris


Base System Installation Checklist:
[O] = OK, [E] = Error (please elaborate below), [ ] = didn't try it

Initial boot:           [O]
Detect network card:    [O]
Configure network:      [O] wifi works with no non-free firmware needed
Detect CD:              [O]
Load installer modules: [O]
Detect hard drives:     [O]
Partition hard drives:  [O]
Install base system:    [O]
Clock/timezone setup:   [O]
User/password setup:    [O]
Install tasks:          [ ] first CD no longer comtains desktop environment
Install boot loader:    [O] os-prober created 3 separate menu items for
                            Windows Vista (some really OEM/recovery partitions?)
Overall install:        [O]

Comments/Problems:

All hardware works well, including wifi (with no nonfree firmware needed),
brightness controls, audio, X, and even suspend/resume.

Had to manually run isohybrid on the CD to boot it from USB stick.

The lack of any desktop environment was an unpleasant quasi-surprise,
as it would have added an hour to the install to download it from a mirror.
Especially since I was already looking at getting home after midnight,
and snow was expected. The first CD thus seems basically useless compared
to say, a netinst. Ended up installing the desktop task after d-i, using
a handy mirror on a USB drive.

Here are some parition contents listings to possibly improve os-prober
to not call various OEM/recovery partitions "Windows Vista"

root@grebe:/home/joey>mount -o ro /dev/sda1 /mnt
root@grebe:/home/joey>dir /mnt
total 389K
drwxrwxrwx  1 root root 4.0K Nov  4 09:55 ./
drwxr-xr-x 21 root root 4.0K Dec  3 21:20 ../
drwxrwxrwx  1 root root 4.0K Nov  4 10:54 Boot/
drwxrwxrwx  1 root root    0 Dec  3 16:10 Recovery/
drwxrwxrwx  1 root root    0 Dec  3 16:25 System\ Volume\ Information/
-rwxrwxrwx  2 root root  187 Oct 14 19:24 WinREPartition.ini*
-rwxrwxrwx  1 root root 375K Jul 13  2009 bootmgr*
root@grebe:/home/joey>mount -o ro /dev/sda3 /mnt
root@grebe:/home/joey>dir /mnt
total 421K
-rwxrwxrwx  2 root root    0 Jun 29  2009 !V6_00_03.VRP*
-rwxrwxrwx  2 root root    0 Jul 15  2009 !V6_00_04.VRP*
drwxrwxrwx  1 root root 4.0K Oct 14 18:50 ./
drwxr-xr-x 21 root root 4.0K Dec  3 21:20 ../
drwxrwxrwx  1 root root  28K Oct 14 19:50 BIN/
drwxrwxrwx  1 root root    0 Oct 14 18:49 BOOT/
-rwxrwxrwx  1 root root 375K Jul 13  2009 BOOTMGR*
-rwxrwxrwx  1 root root  187 Oct 14 19:24 DATA.INI*
-rwxrwxrwx  1 root root 1.6K Jul 19 04:08 EDITAF.BAT*
drwxrwxrwx  1 root root    0 Jul 19 04:07 IMAGES_BOOT/
-rwxrwxrwx  1 root root 1.8K Jul 19 04:07 PLANDATA.INI*
drwxrwxrwx  1 root root    0 Oct 14 18:49 PLANFOLDER/
drwxrwxrwx  1 root root    0 Oct 14 18:50 SOURCES/
drwxrwxrwx  1 root root    0 Jul 19 04:07 ZZIMAGES/

#605857#10
Date:
2010-12-04 06:31:46 UTC
From:
To:
Quoting Joey Hess (joeyh@debian.org):

I think that os-prober 1.40 (which is not on beta1 CDs) is meant to
fix those Vista partitions recognition problems.

From the different release dates, I'd say that beta1 CDs do not have
this version of os-prober, so that might explain. Can you confirm?

#605857#15
Date:
2010-12-04 15:19:07 UTC
From:
To:
Christian PERRIER wrote:

root@grebe:/home/joey>os-prober
  No volume groups found
/dev/sda1:Windows 7 (loader):Windows:chain
/dev/sda2:Windows 7 (loader):Windows1:chain
/dev/sda3:Windows Recovery Environment (loader):Windows2:chain

Ok, the problem with sda3 turns out to be the order os-prober
greps for strings.

root@grebe:~>mount -o ro /dev/sda1 /mnt
root@grebe:~joey>grep 'W.i.n.d.o.w.s. .7' /mnt/Boot/BCD
Binary file /mnt/Boot/BCD matches
root@grebe:~joey>grep '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' /mnt/Boot/BCD
Binary file /mnt/Boot/BCD matches

This patch fixes that, is there a reason it tested for windows 7
before windows recovery?

Index: 20microsoft
===================================================================
--- 20microsoft	(revision 65838)
+++ 20microsoft	(working copy)
@@ -19,7 +19,9 @@
 # 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
+	if 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. .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)"
@@ -27,8 +29,6 @@
 		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

BTW: os-prober was not installed into /target, despite being a
recommends of grub-common. It was not on the ISO used, and I
installed without a full mirror available.

Also, the syslog has some interesting messages during the grub-pc install:

Dec  4 01:33:05 in-target: Creating config file /etc/default/grub with new version
Dec  4 01:33:06 in-target: Use of uninitialized value $template in exists at /usr/share/perl5/Debconf/Template.pm line 81, <GEN2> line 66.
Dec  4 01:33:06 in-target: Use of uninitialized value $item in exists at /usr/share/perl5/Debconf/DbDriver/Cache.pm line 39, <GEN2> line 66.
Dec  4 01:33:06 in-target: Use of uninitialized value $item in exists at /usr/share/perl5/Debconf/DbDriver/Cache.pm line 39, <GEN2> line 66.
Dec  4 01:33:06 in-target: Use of uninitialized value $template in exists at /usr/share/perl5/Debconf/Template.pm line 81, <GEN2> line 75.
Dec  4 01:33:06 in-target: Use of uninitialized value $item in exists at /usr/share/perl5/Debconf/DbDriver/Cache.pm line 39, <GEN2> line 75.
Dec  4 01:33:06 in-target: Use of uninitialized value $item in exists at /usr/share/perl5/Debconf/DbDriver/Cache.pm line 39, <GEN2> line 75.

(I saw no debconf questions from grub at all, IIRC.)

#605857#20
Date:
2010-12-04 15:59:06 UTC
From:
To:
Joey Hess wrote:

#589676 involved reordering Windows 7 to before Windows Recovery.
It seems that neither order will work 100% reliably; some Windows 7
BCDs contain "Windows Recovery Environment", while some recovery
BCDs contain "Windows 7".

#605857#37
Date:
2010-12-04 16:15:05 UTC
From:
To:
This bug is only regarding the following except of the installation
report from which it was cloned:

This could be a debconf bug underneath but well, Colin maintains both. ;)

#605857#44
Date:
2010-12-04 21:19:40 UTC
From:
To:
I can reproduce this bug easily on multiple machines. Here's a d-i
syslog with DEBCONF_DEBUG cracked to the max. In this case grub did ask
me if I wanted to install to the MBR. The uninitialized value problems seem
related to grub-pc/install_devices and grub-pc/install_devices_empty.