grub-install fails to run due to missing grub_mkdevicemap

Bug #702707 reported by Jason Gunthorpe on 2011-01-14
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
High
Colin Watson

Bug Description

Binary package hint: grub2

This is a bug in the grub-install included in grub-efi-amd64

Running it gives:

$ grub-install
/usr/sbin/grub-install: 391: : Permission denied
/usr/sbin/grub-install: 391: : Permission denied
BootCurrent: 0004
Timeout: 1 seconds
BootOrder: 0000,0001,0002,0003
Boot0000* Windows Boot Manager
Boot0001* Hard Drive
Boot0002* Network Card
Boot0003* UEFI: 0.00
/usr/sbin/grub-install: 636: --device-map=/dev/stdout: not found
Could not open disk : No such file or directory
Installation finished. No error reported.

Notice there is no 'ubuntu' entry in the listing from efibootmgr. Oops.

Easy fix:
--- grub-install 2011-01-13 19:37:55.125032970 -0700
+++ /usr/sbin/grub-install 2011-01-11 16:58:32.000000000 -0700
@@ -38,7 +38,6 @@

 grub_setup="${sbindir}/`echo grub-setup | sed ${transform}`"
 grub_mkimage="${bindir}/`echo grub-mkimage | sed ${transform}`"
+grub_mkdevicemap="${sbindir}/`echo grub-mkdevicemap | sed ${transform}`"
 grub_probe="${sbindir}/`echo grub-probe | sed ${transform}`"
 grub_editenv="${bindir}/`echo grub-editenv | sed ${transform}`"
 grub_mkrelpath="${bindir}/`echo grub-mkrelpath | sed ${transform}`"

Works fine after:
$ grub-install
BootCurrent: 0004
Timeout: 1 seconds
BootOrder: 0004,0000,0001,0002,0003
Boot0000* Windows Boot Manager
Boot0001* Hard Drive
Boot0002* Network Card
Boot0003* UEFI: 0.00
Boot0004* ubuntu
Installation finished. No error reported.

Also, this bit fails:

for file in "${grubdir}"/*.mod "${grubdir}"/*.lua "${grubdir}"/*.lst "${grubdir}"/*.img "${grubdir}"/efiemu??.o; do

(and others with *.lua) because there is no *.lua files in the grubdir, or included with the package. Probably should use
for file in `find ${grbudir} -name "*.mod" -or -name "*.lua" -or -name "*.lst" -or -name "*.img" [...]`

or so.

I'm running the natty version on maverick because the maverick version corrupts the initrd with my BIOS ...

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: grub-efi-amd64 1.99~20110111-1ubuntu1
ProcVersionSignature: Ubuntu 2.6.35-22.33-generic 2.6.35.4
Uname: Linux 2.6.35-22-generic x86_64
Architecture: amd64
Date: Thu Jan 13 19:48:11 2011
ProcEnviron:
 PATH=(custom, no user)
 LANG=C
 SHELL=/bin/bash
SourcePackage: grub2

Jason Gunthorpe (jgunthorpe) wrote :
Colin Watson (cjwatson) wrote :

Thanks! Fixed for my next upload.

Changed in grub2 (Ubuntu):
assignee: nobody → Colin Watson (cjwatson)
importance: Undecided → High
status: New → Fix Committed

Thanks Colin,

I also noticed that the missing lua file is from this:

grub.cfg: if lua ${prefix}/hwmatch.lua; then

when grub.cfg is built by the default scripts. Looks like the EFI packages
should also include this file, or something..

On Mon, Jan 17, 2011 at 1:49 PM, Colin Watson <email address hidden>wrote:

> Thanks! Fixed for my next upload.
>
> ** Changed in: grub2 (Ubuntu)
> Importance: Undecided => High
>
> ** Changed in: grub2 (Ubuntu)
> Status: New => Fix Committed
>
> ** Changed in: grub2 (Ubuntu)
> Assignee: (unassigned) => Colin Watson (cjwatson)
>
> --
> You received this bug notification because you are a direct subscriber
> of the bug.
> https://bugs.launchpad.net/bugs/702707
>
> Title:
> grub-install fails to run due to missing grub_mkdevicemap
>

Launchpad Janitor (janitor) wrote :
Download full text (3.9 KiB)

This bug was fixed in the package grub2 - 1.99~rc1-1ubuntu1

---------------
grub2 (1.99~rc1-1ubuntu1) natty; urgency=low

  * Resynchronise with Debian. Remaining changes:
    - Adjust for default Ubuntu boot options ("quiet splash").
    - Default to hiding the menu; holding down Shift at boot will show it.
    - Set a monochromatic theme and an aubergine background for Ubuntu.
    - Apply Ubuntu GRUB Legacy changes to legacy update-grub script: title,
      recovery mode, quiet option, tweak how memtest86+ is displayed, and
      use UUIDs where appropriate.
    - Fix backslash-escaping in merge_debconf_into_conf.
    - Remove "GNU/Linux" from default distributor string.
    - Add crashkernel option.
    - Bypass menu unless other OSes are installed or Shift is pressed.
    - Allow Shift to interrupt 'sleep --interruptible'.
    - Reduce visual clutter in normal mode.
    - Remove verbose messages printed before reading configuration.
    - Suppress kernel/initrd progress messages, except in recovery mode.
    - Handle filesystems loop-mounted on file images.
    - Ignore devices loop-mounted from files in Linux grub.d scripts.
    - Show the boot menu if the previous boot failed.
    - Don't generate device.map during grub-install or grub-mkconfig.
    - Adjust upgrade version checks for Ubuntu.
    - Suppress "GRUB loading" message unless Shift is held down.
    - Adjust versions of grub-doc and grub-legacy-doc conflicts.
    - Fix LVM/RAID probing in the absence of /boot/grub/device.map.
    - Look for .mo files in /usr/share/locale-langpack first.
    - Make sure GRUB_TIMEOUT isn't quoted unnecessarily.
    - Build-depend on qemu-kvm rather than qemu-system for grub-pc tests.
    - Use qemu rather than qemu-system-i386.
    - Add a grub-rescue-efi-amd64 package.
    - On Wubi, don't ask for an install device, but just update wubildr
      using the diverted grub-install.
    - Enable lua from grub-extras.
    - Incorporate the bitop library into lua.
    - Add enum_pci function to grub module in lua.
    - Check hardware support before using gfxpayload=keep.
    - Build part_msdos and vfat into EFI boot images.
    - Put second and subsequent Linux menu entries in a submenu.
    - Preferred resolution detection for VBE.
    - Set vt.handoff=7 for smooth handoff to kernel graphical mode.
  * Fix logic error in VBE resolution detection that meant EDID information
    was never used (LP: #693093).
  * Export linux_gfx_mode so that it's usable in submenus (LP: #702594).
  * Restore grub_mkdevicemap and associated options to grub-install, since
    it's needed when doing EFI installs (thanks, Jason Gunthorpe;
    LP: #702707).
  * Don't fail when there are no *.lua files in $pkglibdir (thanks, Jason
    Gunthorpe; LP: #702707).
  * If we're upgrading and /boot/grub/core.img doesn't exist, then don't ask
    where to install GRUB, since it probably means we're in some kind of
    specialised environment such as a live USB stick (LP: #591202).
  * Drop the default priority of grub2/linux_cmdline to medium. We only
    need to ask it if we're upgrading from GRUB Legacy and found an empty
    kopt in menu.lst (LP: #591202).

grub2 (1.99~rc1-1...

Read more...

Changed in grub2 (Ubuntu):
status: Fix Committed → Fix Released
Manoj Iyer (manjo) wrote :

I can confirm that this fixes installs of Natty on Intel UEFI 2.3 SDP.

ubuntu@ubuntu-uefi23:~$ cat /etc/issue
Ubuntu natty (development branch) \n \l

ubuntu@ubuntu-uefi23:~$ sudo fdisk -l
[sudo] password for ubuntu:

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.

Disk /dev/sda: 2500.5 GB, 2500495958016 bytes
255 heads, 63 sectors/track, 304001 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

   Device Boot Start End Blocks Id System
/dev/sda1 1 267350 2147483647+ ee GPT
Partition 1 does not start on physical sector boundary.

Disk /dev/sdb: 3000.6 GB, 3000592982016 bytes
255 heads, 63 sectors/track, 364801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

   Device Boot Start End Blocks Id System
/dev/sdb1 1 97452 782780353 83 Linux
Partition 1 does not start on physical sector boundary.
ubuntu@ubuntu-uefi23:~$

Colin Watson (cjwatson) wrote :

Jason: I think we're probably OK leaving out hwmatch.lua for now. The whole deal with graphical boot images is likely to be completely different on UEFI vs. BIOS anyhow ...

Jason Gunthorpe (jgunthorpe) wrote :

True enough - EFI should use the EFI console interface which hopefully works
reliably. But grub prints a warning message at boot that it cannot locate
hwmatch.lua, so maybe the grub.conf construction scripts should be updated
to not include that fragment if the lua script is not available.

On Thu, Jan 20, 2011 at 1:33 PM, Colin Watson <email address hidden>wrote:

> Jason: I think we're probably OK leaving out hwmatch.lua for now. The
> whole deal with graphical boot images is likely to be completely
> different on UEFI vs. BIOS anyhow ...
>
> --
> You received this bug notification because you are a direct subscriber
> of the bug.
> https://bugs.launchpad.net/bugs/702707
>
> Title:
> grub-install fails to run due to missing grub_mkdevicemap
>

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers