Menu

Trying to chainload grub2 from syslinux

2018-09-13
2018-10-09
  • Bradley Odell

    Bradley Odell - 2018-09-13

    I have been booting CloneZilla Live using UEFI for a while now and it's worked fine. I have been installing it to a USB drive with a customized grub.cfg file that adds menu options to run various OS installers. I was trying to use it to run an Ubuntu netinstall and soon realized I needed to boot the installer in legacy BIOS mode which I assumed meant that I needed to boot CloneZilla itself in BIOS mode. So I rebooted my system and selected the non-UEFI option in the boot menu but CloneZilla failed to boot. After some troubleshooting I realized that this was a pure GPT/EFI setup so I couldn't boot legacy, so I started working to make it support legacy booting...

    I converted to using MBR with a FAT32 partition set as bootable and I used the makeboot.sh script to configure the MBR bootsector with syslinux and voila! it booted to syslinux in BIOS mode.
    Unfortunately, syslinux has its own syslinux.cfg file so all of my custom configurations are not usable from this bootloader. I don't want to convert all my configurations over to this new syslinux format, so I thought to see if I can have syslinux run grub and I learned about this thing called "chainloading".

    I found out that syslinux has this COM32 module called "chain.c32" that allows it to run other bootloaders: https://www.syslinux.org/wiki/index.php?title=Comboot/chain.c32
    I tried the "file" and "grub" options with the file /EFI/images/efiboot.img but it doesn't work.
    After doing some research, it seems that grub has a core.img file but this file is not shipped with the CloneZilla zip file: https://www.gnu.org/software/grub/manual/grub/grub.html#Images

    It seems that grub is "baked in" to the "efiboot.img" or "bootx64.efi" files in some way. I have searched the CloneZilla directory tree for any other grub files but it doesn't seem like any are available.

    Are there other options for getting CloneZilla booting grub using one configuration from legacy BIOS mode and UEFI mode?

    Thanks for reading,
    Bradley

     
  • Steven Shiau

    Steven Shiau - 2018-09-30

    "Are there other options for getting CloneZilla booting grub using one configuration from legacy BIOS mode and UEFI mode?" -> I do not understand. The Clonezilla downloaded from
    https://clonezilla.org/downloads.php
    actually supports booting from legacy BIOS or uEFI. If you follow
    https://clonezilla.org/liveusb.php
    the created USB stick can boot on legacy BIOS.
    Or am I missing something?

    Steven

     
  • Bradley Odell

    Bradley Odell - 2018-10-05

    Hi Steven,

    I know CloneZilla supports booting from Legacy BIOS and UEFI. However, when booting from BIOS it uses the syslinux configuration file instead of grub (which it uses for UEFI). I want to only use grub for both BIOS and UEFI booting.

    I explain my original idea to chainload grub from syslinux but my ideas haven't worked in practice so maybe I'm missing something or CloneZilla currently doesn't include the necessary files to make it possible.

     
  • ndog37

    ndog37 - 2018-10-09

    If you use a tool like tuxboot to prepare the USB drive, typically you will have a seperate menu for grub2 (uefi) and syslinux (legacy BIOS)

    \syslinux\syslinux.cfg
    \EFI\boot\grub.cfg

    However if you insist grub2 only menu, format your usb pen, install grub2 as the boot loader and its required files, copy filesystem.squashfs, initrd.img, vmlinuz (from /clonezilla/live) somwhere to boot clonezilla and build your grub.cfg menu around that.
    I'm not sure if its possible - see here for more - https://unix.stackexchange.com/questions/273329/can-i-install-grub2-on-a-flash-drive-to-boot-both-bios-and-uefi

    Typical grub2 bootentry would search for the vmlinuz file, then load it and options and then finally call the ramdisk

    search --set -f /live/vmlinuz
    linux /live/vmlinuz boot=live ......
    initrd /live/initrd.img
    

    I prefer to just to create two boot menus and overwrite the pen drive versions after creating a new pen drive in tuxboot. Easy.

    Cheers

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.