Bug#513216: /usr/sbin/grub-install: line 374: [: =: unary operator expected

Thomas Lange lange at debian.org
Tue Jan 27 12:02:50 UTC 2009


Package: grub
Version: 0.97-47lenny2
Severity: normal

When I use grub-install for a chroot environment (during an
installation with FAI) I get following error:


# /usr/sbin/grub-install --no-floppy --root-directory=/target /dev/sda
grub-probe: error: Cannot open `/boot/grub/device.map'
/usr/sbin/grub-install: line 374: [: =: unary operator expected
Installation finished. No error reported.
This is the contents of the device map /target/boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

(hd0)   /dev/sda


This command is run form a nfsroot (which does no have a device.map),
the new system is located in /target on /dev/sda, were I like to
install the grub. grub-install is now checking which type of file
system I had created. This is a part of sh -x output of the command above:

+ sync
++ grub-probe -t fs /target/boot/grub
grub-probe: error: Cannot open `/boot/grub/device.map'
+ '[' = xfs ']'
/usr/sbin/grub-install: line 374: [: =: unary operator expected


I think this grub-probe should be called in this way:

grub-probe --device-map=/target/boot/grub/device.map -t fs /target/boot/grub 
which will report ext2 in my situation.



-- System Information:
Debian Release: 5.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-1-686 (SMP w/1 CPU core)
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash

Versions of packages grub depends on:
ii  grub-common             1.96+20080724-12 GRand Unified Bootloader, version 
ii  libc6                   2.7-18           GNU C Library: Shared libraries
ii  libncurses5             5.7+20081213-1   shared libraries for terminal hand

grub recommends no packages.

Versions of packages grub suggests:
ii  grub-legacy-doc            0.97-47lenny2 Documentation for GRUB Legacy
pn  mdadm                      <none>        (no description available)
ii  multiboot-doc              0.97-47lenny2 The Multiboot specification

-- no debconf information





More information about the Pkg-grub-devel mailing list