Subject: pkg/24214: sysutils/grub: patch-al makes grub fail
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <jukka-netbsd@2004.salmi.ch>
List: netbsd-bugs
Date: 01/24/2004 14:59:56
>Number:         24214
>Category:       pkg
>Synopsis:       sysutils/grub: patch-al makes grub fail
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 24 14:00:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        NetBSD 1.6ZH
>Organization:
>Environment:
System: NetBSD himo.salmi.ch 1.6ZH NetBSD 1.6ZH (GENERIC) #0: Thu Jan 22 03:39:54 UTC 2004 root@himo.salmi.ch:/opt/obj/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
Compiling sysutils/grub from current pkgsrc on NetBSD current and NetBSD stable (1.6.2_RC3) results in a grub binary which is not able to "see" my IDE harddisks, and which seems to have problems with output formatting (curses...).

The following is on NetBSD 1.6.2_RC3:

# grub
`^;grub in realloc(): warning: pointer to wrong page.

    GRUB  version 0.93  (640K lower / 3072K upper memory)

                                                          [ Minimal BASH-like line editing is supported.  For the first word, TAB
                                                    lists possible command completions.  Anywhere else TAB lists the possible
                                                completions of a device/filename. ]

   grub> root (hd0,0,a)

                       Error 21: Selected disk does not exist

                                                             grub> quit

At least the output format problem can be solved by --no-curses:

# grub --no-curses
`^;

    GRUB  version 0.93  (640K lower / 3072K upper memory)

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename. ]
grub> root (hd0,0,a)

Error 21: Selected disk does not exist
grub> quit
#

On NetBSD-current essentially the same happens, except the realloc() error message and the `^; strings are not printed.

If I build grub on NetBSD stable without patches/patch-al, both problems have gone:

# grub

    GRUB  version 0.93  (640K lower / 3072K upper memory)

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename. ]

grub> root (hd0,0,a)
 Filesystem type is ffs, partition type 0xa9

grub> quit
#

The grub binary compiled on stable runs fine on current (I only had to cd /usr/lib && ln -s /lib/libutil.so.7.3 libutil.so.6).

There are only IDE disks on the two system I tested, so I don't know if this problem also exists with e.g. SCSI disks.
>How-To-Repeat:
build sysutils/grub from current pkgsrc on a i386 system with IDE disks running NetBSD stable or NetBSD current, execute the grub shell and issue a root (...) command.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: