Package: memtest86+
Version: 2.01-1
Severity: normal
Tags: patch

The file /etc/grub.d/20_memtest86+ contains the line

        linux   ${GRUB_DRIVE_BOOT}/memtest86+.bin

Unfortunately, /usr/share/doc/grub-pc/changelog.gz says:

# 2008-05-30  Robert Millan  <[EMAIL PROTECTED]>
[...]
#       * util/update-grub.in (GRUB_DEVICE_UUID, GRUB_DEVICE_BOOT)
#       (GRUB_DEVICE_BOOT_UUID): New variables.
#       (GRUB_DRIVE. GRUB_DRIVE_BOOT. GRUB_DRIVE_BOOT_GRUB): Remove.
                     ^^^^^^^^^^^^^^^
So the formula in 20_memtest86+ updates grub.cfg to say:

        linux   /memtest86+.bin

which looks for it in the toplevel directory of my boot partition;
since my /boot is just a directory of my rootfs, it doesn't find it.

Of course on the rare occasions that I need memtest86+ it's not much
of a hardship to type the path in correctly; the quick-and-dirty
workaround is to put a symlink at /memtest86+.bin.

The real fix is to rewrite 20_memtest86+ to use functions out of
/usr/lib/grub/update-grub_lib.  I can confirm that the attached
attempt Works For Me, though it's not clear whether I get any
benefit out of the call to is_path_readable_by_grub()...

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing'), (50, 'unstable')
Architecture: i386 (i586)

Kernel: Linux 2.6.25.custom
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

memtest86+ depends on no packages.

memtest86+ recommends no packages.

Versions of packages memtest86+ suggests:
ii  grub-pc [grub]           1.96+20080704-2 GRand Unified Bootloader, version 
pn  hwtools                  <none>          (no description available)
pn  kernel-patch-badram      <none>          (no description available)
ii  memtester                4.0.8-1         A utility for testing the memory s
ii  mtools                   3.9.11-1        Tools for manipulating MSDOS files

-- no debconf information
-- 
JBR
Ankh kak! (Ancient Egyptian blessing)
#!/bin/bash -e

source /usr/lib/grub/update-grub_lib

if test -e /boot/memtest86+.bin ; then
  MEMTESTPATH=`make_system_path_relative_to_its_root /memtest86+.bin`
  if `is_path_readable_by_grub "${MEMTESTPATH}"`; then
    echo "Found memtest86+ image: /boot/memtest86+.bin" >&2
    cat << EOF
menuentry "Memory test (memtest86+)" {
        linux   ${MEMTESTPATH}
}
EOF
  fi
fi

Reply via email to