Package: os-prober
Version: 1.29
Severity: normal

Though the example is similar, this is a distinct bug from #534644
However to keep things self-contained, I will restate,

I have a second install of Debian Lenny on an other partion. It boots off yet 
an other partition.
It's relevant /etc/fstab entries are

/dev/sda2 /boot       ext3        defaults,noatime       0  0
/dev/sda6 /          auto        defaults,noatime       0  0

On my running sid, I have these partitions mounted
/dev/sda2 /mnt/sandbox/boot
/dev/sda6 /mnt/sandbox

The relevant menu entry in /mnt/sandbox/boot/grub/grub.cfg (i.e., residing on 
/dev/sda2) is

menuentry "Debian GNU/Linux, linux 2.6.30.012" {
        set root=(hd0,2)
        search --fs-uuid --set 234cc6d9-e0ef-4105-b817-f1c83edbc1a2
        linux   /vmlinuz-2.6.30.012 root=/dev/sda5 ro i915.modeset=1 selinux=0 
enforcing=0
resume=/dev/sda3  clocksource=hpet quiet
}

With the patch of #534644 applied or not, os-prober reports my image as 
residing at

/boot/vmlinuz-2.6.26-2-amd64

However, because vmlinuz-2.6.26-2-amd64 resides in the root of /dev/sda2, it 
should report

/vmlinuz-2.6.26-2-amd64 (i.e., mirror the grub.cfg entry above). 

The attached patch removes from /usr/lib/linux-boot-probes/mounted/40grub2 
lines which cause this behaviour. 

The comment in the removed code reads
# Systems with a separate /boot will not have
# theath to the kernel in grub.cfg.
however, as far as I understand, that means that we ought not to return /boot 
because 
you can't boot from the path /boot/vmlinuz-2.6.26-2-amd64.

Addmittedly I may be missing something, but the attached patch gives me the 
correct behaviour for my case.

Kevin


-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (600, 'unstable'), (500, 'testing'), (400, 'stable'), (300, 
'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.30.012 (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=en_GB, LC_CTYPE=en_GB (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/dash

-- no debconf information
--- 40grub2.old 2008-12-26 05:48:07.000000000 -0800
+++ 40grub2     2009-06-25 17:12:43.680472685 -0700
@@ -56,18 +56,9 @@
                                kernel="$(echo $2 | sed 's/(.*)//')"
                                shift 2
                                parameters="$@"
-                               # Systems with a separate /boot will not have
-                               # the path to the kernel in grub.cfg.
-                               if [ "$partition" != "$bootpart" ]; then
-                                       kernel="/boot$kernel"
-                               fi
                        ;;
                        initrd)
                                initrd="$(echo $2 | sed 's/(.*)//')"
-                               # Initrd same.
-                               if [ "$partition" != "$bootpart" ]; then
-                                       initrd="/boot$initrd"
-                               fi
                        ;;
                        "}")
                                entry_result

Reply via email to