Bug#623297: grub-efi-amd64: update-grub doesn't work at all

Marcus Jodorf trap at killfile.de
Tue Apr 19 02:47:01 UTC 2011


Package: grub-efi-amd64
Version: 1.99~rc1-13
Severity: important


I converted my system to boot with efi and found this to be quite hard
to try with this package (not the tiniest bit of documentation, leaves
the system without working bootmanager after install, etc).

So that is what I did to get this sort of working:
- made the efi system partition
- put an efi shell in it to be able to start the loader by hand
  in case of emergency
- installed grub-efi-amd64
  ...and learned this package does absolutely nothing to make the
  system bootable
- mounted the efi system partition at /boot/efi
- made the needed /boot/efi/efi subdir
- installed grub using
    grub-install --boot-directory=/boot/efi/efi -bootloader-id=grub\
    --no-floppy --recheck
  which made the required /boot/efi/efi/grub directory at the
  correct place with almost the correct content
- copied /usr/share/grub/unicode.pf2 into said directory because the
  installer didn't do this and it seems to be needed for text with
  efi_gop

and then ran update-grub which failed completely:

~# update-grub
Generating grub.cfg ...
cat: /boot/grub/video.lst: No such file or directory
Found linux image: /boot/vmlinuz-2.6.38.3
Found linux image: /boot/vmlinuz-2.6.38-2-amd64
Found initrd image: /boot/initrd.img-2.6.38-2-amd64
error: syntax error.
error: Incorrect command.
error: syntax error.
error: line no: 29
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
/boot/grub/grub.cfg.new file attached.
done
~#

Besides generating a faulty configuration file it more
importantly is put at the completely wrong place.

update-grub puts it in the standard place for grub-pc
(/boot/grub/) whereas in case of uefi it just belongs into
/boot/efi/efi/grub/

Although from using grub-install before the correct path is in
principle known - it is not used and therefore each subsequent
usage of grub-update is destined to fail because the config file
is saved in the wrong place by default.

I finally got it working writing my own very basic grub.cfg and
placing this in the correct place
(/etc/boot/efi/efi/grub/grub.cfg)
side by side to the grub.efi bootloader.

After first starting it by hand from efi shell and then using
efibootmgr to make it the default bootloader the system is booting
well now.

But since update-grub doesn't work I have to adapt grub.cfg by hand
each time I install another kernel.


I hope this information is helpfull.


Best regards,

Marcus



The broken grub.cfg.new file:

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
}

insmod part_gpt
insmod ext2
set root='(hd0,gpt2)'
search --no-floppy --fs-uuid --set=root 27ed2ae9-9693-4ef1-9432-1ddd9d38c7fc
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=640x480
  load_video
  insmod gfxterm
fi
terminal_output gfxterm
set timeout=15
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Debian GNU/Linux, with Linux 2.6.38.3' --class debian --class gnu-linux --class gnu --class os {
	insmod part_gpt
	insmod ext2
	set root='(hd0,gpt2)'
	search --no-floppy --fs-uuid --set=root 27ed2ae9-9693-4ef1-9432-1ddd9d38c7fc
	echo	'Loading Linux 2.6.38.3 ...'
	linux	/boot/vmlinuz-2.6.38.3 root=/dev/sda2 ro  quiet
}

menuentry 'Debian GNU/Linux, with Linux 2.6.38.3 (recovery mode)' --class debian --class gnu-linux --class gnu --class os {
	insmod part_gpt
	insmod ext2
	set root='(hd0,gpt2)'
	search --no-floppy --fs-uuid --set=root 27ed2ae9-9693-4ef1-9432-1ddd9d38c7fc
	echo	'Loading Linux 2.6.38.3 ...'
	linux	/boot/vmlinuz-2.6.38.3 root=/dev/sda2 ro single 
}
menuentry 'Debian GNU/Linux, with Linux 2.6.38-2-amd64' --class debian --class gnu-linux --class gnu --class os {
	insmod part_gpt
	insmod ext2
	set root='(hd0,gpt2)'
	search --no-floppy --fs-uuid --set=root 27ed2ae9-9693-4ef1-9432-1ddd9d38c7fc
	echo	'Loading Linux 2.6.38-2-amd64 ...'
	linux	/boot/vmlinuz-2.6.38-2-amd64 root=UUID=27ed2ae9-9693-4ef1-9432-1ddd9d38c7fc ro  quiet
	echo	'Loading initial ramdisk ...'
	initrd	/boot/initrd.img-2.6.38-2-amd64
}

menuentry 'Debian GNU/Linux, with Linux 2.6.38-2-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os {
	insmod part_gpt
	insmod ext2
	set root='(hd0,gpt2)'
	search --no-floppy --fs-uuid --set=root 27ed2ae9-9693-4ef1-9432-1ddd9d38c7fc
	echo	'Loading Linux 2.6.38-2-amd64 ...'
	linux	/boot/vmlinuz-2.6.38-2-amd64 root=UUID=27ed2ae9-9693-4ef1-9432-1ddd9d38c7fc ro single 
	echo	'Loading initial ramdisk ...'
	initrd	/boot/initrd.img-2.6.38-2-amd64
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###





-- Package-specific info:

*********************** BEGIN /proc/mounts
/dev/root / ext4 rw,relatime,errors=remount-ro,barrier=1,data=ordered 0 0
/dev/sda1 /boot/efi vfat rw,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=utf8,shortname=mixed,errors=remount-ro 0 0
/dev/md0 /usr/local/share/export ext4 rw,noatime,errors=remount-ro,barrier=1,journal_checksum,stripe=128,data=writeback,noauto_da_alloc 0 0
*********************** END /proc/mounts


-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.38.3 (SMP w/8 CPU cores; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages grub-efi-amd64 depends on:
ii  debconf [debconf-2.0]        1.5.38      Debian configuration management sy
ii  efibootmgr                   0.5.4-2     Interact with the EFI Boot Manager
ii  grub-common                  1.99~rc1-13 GRand Unified Bootloader, version 
ii  ucf                          3.0025+nmu1 Update Configuration File: preserv

grub-efi-amd64 recommends no packages.

Versions of packages grub-efi-amd64 suggests:
ii  os-prober                     1.44       utility to detect other OSes on a 

-- debconf information excluded





More information about the Pkg-grub-devel mailing list