Wednesday, January 19, 2011

How do I chain boot from grub to syslinux?

I am expanding my rescue usb flash disk. The USB's partition is bootable, and I have installed GRUB to the MBR of the jump drive. It works pretty well - I can boot Freedos and run some utilities,and I can boot PING.

I would like to add the Ubuntu 9.10 LiveCD to this rescue usb drive. I have a working jumpdrive, so I can pretty easily copy over the files. I could hunt down the needed menu.lst entries needed for GRUB, but the Ubuntu LiveUSB uses a fairly complicated syslinux configuration. Besides, I would like to keep as much of the current LiveCD/LiveUSB look-n-feel without porting the syslinux config over to GRUB.

At the suggestion of ~quack I tried a menu.lst entry of:

 title Ubuntu 9.10 LiveCD
 root=(hd0,0)
 kernel /ubuntu-9.10/syslinux/isolinux.bin

but GRUB responded with an Error 13: Invalid or unsupported executable format. At the GRUB commandline I then tried:

 grub> root=(hd0,0)
 grub> kernel /syslinux/isolinux.bin

because I have a second isolinux.bin file in that location, but GRUB responded with the same error. I also tried:

 grub> chainloader /syslinux/isolinux.bin

and once again received the Error 13. Finally, I tried at the GRUB command line:

 grub> root=(hd0,0)
 grub> kernel /ubuntu-9.10/install/mt86plus
 grub> boot

and that worked

What I would really like is a way to have GRUB call syslinux/isolinux bootloader. Then syslinux could load its own menu and whatnot.

Anyone know how to do this?

  • Update: Based on your entry, I found the article "Grub chainloads syslinux and back", which basically says "patch grub":

    • Chainloading syslinux from GRUB seems not to be possible without a patch. I don't know about GRUB2. This could be useful for multi-booting (syslinux-based) partitions.

    • Chainloading syslinux from GRUB4dos (on different partitions) is possible. I managed it through the mapping, explained (again) here. It solves some problems in multi-booting usb devices.

    The patch page mentions a similar patch was posted to grub-devel for Grub v2; this post may be that patch. Or this message, which points to this bug report (dated Nov.2009, so it's very recent) for a Grub v2 patch.

    To use one of the patches, you'd need to download the Grub source code for your preferred Grub version, check that it doesn't include the patch already, try applying the patch, and recompile and reinstall your new Grub.


    Original answer:

    I'd try testing a simple Grub entry first. This is a standard Grub entry for the Memtest86+ utility on a Debian system:

    title           Debian, memtest86+
    root            (hd0,0)
    kernel          /boot/memtest86+.bin
    

    Just try tweaking those with your values (change the root partition or kernel path as necessary):

    title           Ubuntu LiveUSB SysLinux boot
    root            (hd0,0)
    kernel          /syslinux/isolinux.bin
    

    I don't think you'd need the chainloader+ command for this task.

    EricJLN : Tried suggestion. It didn't seem to work. See updated question.
    EricJLN : Great find with the article. I need to play with it.
    Tom O'Connor : I haven't tried it for this, but Grub2 has significantly greater capability than GRUB, perhaps that way, a later version can do what the OP wants?
    quack quixote : i followed up on Grub vs Grub2 below the article quote. essentially, the Grub patch was forward-ported. there's also another patch that claims to enable the same functionality.
  • title UBUNTU 9.1 ISO Boot

    find --set-root /ubuntu9.1.iso

    map /ubuntu9.1.iso (hd32)

    map --hook

    root (hd32)

    chainloader (hd32)

    add this to ur menu.lst, and copy ubuntu9.1.iso to the drive on which menu.lst exists.

    EricJLN : Do I copy the files in the iso image, or the iso image itself?

0 comments:

Post a Comment