grub-imageboot doesn't like nonstandard image locations

Bug #1277533 reported by Alexander List
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
grub-imageboot (Debian)
New
Unknown
grub-imageboot (Ubuntu)
Confirmed
Undecided
Unassigned
Trusty
Confirmed
Undecided
Unassigned

Bug Description

# apt-cache policy grub-imageboot grub-pc
grub-imageboot:
  Installed: 0.6
  Candidate: 0.6
  Version table:
 *** 0.6 0
        500 http://ch.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
        100 /var/lib/dpkg/status
grub-pc:
  Installed: 2.02~beta2-6
  Candidate: 2.02~beta2-6
  Version table:
 *** 2.02~beta2-6 0
        500 http://ch.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status
grub-common:
  Installed: 2.02~beta2-6
  Candidate: 2.02~beta2-6
  Version table:
 *** 2.02~beta2-6 0
        500 http://ch.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status

My /boot partition is rather small, so I tried an alternate location for .iso/.img files:

-----
# cat /etc/default/grub-imageboot
# Where to find the iso/floppy images

IMAGES="/var/lib/boot/images"

# You can override the boot options for iso/floppy images here
# see http://syslinux.zytor.com/wiki/index.php/MEMDISK for details

#IMAGEOPTS="rawimg"
#ISOOPTS="iso"
-----

update-grub2 finds everything:

-----
# update-grub2
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.13.0-7-generic
Found initrd image: /boot/initrd.img-3.13.0-7-generic
Found linux image: /boot/vmlinuz-3.13.0-5-generic
Found initrd image: /boot/initrd.img-3.13.0-5-generic
Found linux image: /boot/vmlinuz-3.2.54-030254-generic
Found initrd image: /boot/initrd.img-3.2.54-030254-generic
Found memtest86+ image: /memtest86+.elf
Found memdisk: /memdisk
Found iso image: /var/lib/boot/images/biosupdate.iso
Found iso image: /var/lib/boot/images/grml64-full_2013.09.iso
Found floppy image: /var/lib/boot/images/netboot.img
done
-----

When I reboot, I get:

-----
                         GNU GRUB version 2.02~beta2-6

 +----------------------------------------------------------------------------+
 | Ubuntu |
 | Advanced options for Ubuntu |
 | Memory test (memtest86+) |
 | Memory test (memtest86+, serial console 115200) |
 |*Bootable ISO Image: biosupdate |
 | Bootable ISO Image: grml64-full_2013.09 |
 | Bootable Floppy Image: netboot |
 | |
 | |
 | |
 | |
 | |
 +----------------------------------------------------------------------------+

      Use the ^ and v keys to select which entry is highlighted.
      Press enter to boot the selected OS, `e' to edit the commands
      before booting or `c' for a command-line.
-----

I select one of the image options, and get:

-----
error: file `/memdisk' not found.
-----

I reboot, and edit the commandline:

-----
setparams 'Bootable ISO Image: biosupdate' |
 | |
 | insmod part_msdos |
 | insmod lvm |
 | insmod ext2 |
 | set root='lvmid/V3HrbD-skk5-Fpvd-T6Yk-LXD6-4sKI-RyZdx3/jaqIpu-QacO-\|
 |dXRK-0A4f-A6vY-2JrG-NsJBVp' |
 | if [ x$feature_platform_search_hint = xy ]; then |
 | search --no-floppy --fs-uuid --set=root --hint='lvmid/V3HrbD-skk5\|
 |-Fpvd-T6Yk-LXD6-4sKI-RyZdx3/jaqIpu-QacO-dXRK-0A4f-A6vY-2JrG-NsJBVp' c12575\|
 |c9-ad18-4656-a169-384c2556499b |
 | else |v

                         GNU GRUB version 2.02~beta2-6

 +----------------------------------------------------------------------------+
 |dXRK-0A4f-A6vY-2JrG-NsJBVp' |^
 | if [ x$feature_platform_search_hint = xy ]; then |
 | search --no-floppy --fs-uuid --set=root --hint='lvmid/V3HrbD-skk5\|
 |-Fpvd-T6Yk-LXD6-4sKI-RyZdx3/jaqIpu-QacO-dXRK-0A4f-A6vY-2JrG-NsJBVp' c12575\|
 |c9-ad18-4656-a169-384c2556499b |
 | else |
 | search --no-floppy --fs-uuid --set=root c12575c9-ad18-4656-a169-3\|
 |84c2556499b |
 | fi |
 | linux16 /boot/memdisk iso |
 | initrd16 /var/lib/boot/images/biosupdate.iso |
 | |
 +----------------------------------------------------------------------------+

      Minimum Emacs-like screen editing is supported. TAB lists
      completions. Press Ctrl-x or F10 to boot, Ctrl-c or F2 for
      a command-line or ESC to discard edits and return to the GRUB menu.
-----

--> it works

When I set the image location back to the default of /boot/images, everything works as expected:

-----
root@zimba:/boot/images# update-grub2
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.13.0-7-generic
Found initrd image: /boot/initrd.img-3.13.0-7-generic
Found linux image: /boot/vmlinuz-3.13.0-5-generic
Found initrd image: /boot/initrd.img-3.13.0-5-generic
Found linux image: /boot/vmlinuz-3.2.54-030254-generic
Found initrd image: /boot/initrd.img-3.2.54-030254-generic
Found memtest86+ image: /memtest86+.elf
Found memdisk: /memdisk
Found iso image: /boot/images/biosupdate.iso
done
-----

The problem is that the grub root is set incorrectly if images are configured to reside outside /boot, and/or that memdisk isn't copied to IMAGEPATH/memdisk. MEMDISKPATH

-----
$ diff -ur grub.cfg-bootpart grub.cfg-varpart
--- grub.cfg-bootpart 2014-02-07 15:24:11.261689248 +0100
+++ grub.cfg-varpart 2014-02-07 15:25:32.661693188 +0100
@@ -284,16 +284,43 @@
 ### END /etc/grub.d/41_custom ###

 ### BEGIN /etc/grub.d/60_grub-imageboot ###
-menuentry "Bootable Floppy Image: dosdisk32M" {
+menuentry "Bootable ISO Image: biosupdate" {
  insmod part_msdos
+ insmod lvm
  insmod ext2
- set root='hd0,msdos1'
+ set root='lvmid/V3HrbD-skk5-Fpvd-T6Yk-LXD6-4sKI-RyZdx3/jaqIpu-QacO-dXRK-0A4f-A6vY-2JrG-NsJBVp'
  if [ x$feature_platform_search_hint = xy ]; then
- search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 a96dc997-c4ef-4beb-9fc7-89ce40bb2489
+ search --no-floppy --fs-uuid --set=root --hint='lvmid/V3HrbD-skk5-Fpvd-T6Yk-LXD6-4sKI-RyZdx3/jaqIpu-QacO-dXRK-0A4f-A6vY-2JrG-NsJBVp' c12575c9-ad18-4656-a169-384c2556499b
  else
- search --no-floppy --fs-uuid --set=root a96dc997-c4ef-4beb-9fc7-89ce40bb2489
+ search --no-floppy --fs-uuid --set=root c12575c9-ad18-4656-a169-384c2556499b
+ fi
+ linux16 /memdisk iso
+ initrd16 /var/lib/boot/images/biosupdate.iso
+}
-----

It is not entirely clear to me if the problem is in grub-imageboot or /usr/lib/grub/grub-mkconfig_lib, which is part of grub-common.

Changed in grub-imageboot (Debian):
status: Unknown → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in grub-imageboot (Ubuntu Trusty):
status: New → Confirmed
Changed in grub-imageboot (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.