Menu

Add menu support for booting ISO files.

Ed P
2016-12-16
2016-12-31
  • Ed  P

    Ed P - 2016-12-16

    Hi Dave,

    I know you have options to create menus for various Linux systems and was wondering if you could add the option for creating menus to boot Linux ISO systems. I do this manually now and there is some interest by others to do it. If grub2win could create a menu for them it would be helpful.

    Ed

     
  • Drummer

    Drummer - 2016-12-24

    Hi Ed,

    Something for you to mull over during the holidays. I've attached a grub.cfg file with a new function to perform loopback boots from ISO files.

    The function called loopboot is in the user section at the end of the file. I tried to make it as generic as possible so that the user would simply set four variables, then call the function. Any very specific code should be in the calling menu entry, not the function itself.

    I set up two entries for testing and one as a sample. The first entry "Porteus via loopback" contains the code you sent me, adapted to call the loopboot function. The entry works syntatically when I boot, but of course I have no way to test your environment. Please give it a try.

    The second entry "Ubuntu via loopback" boots Ubuntu from an ISO file residing on a USB drive. It runs perfectly on my machine.

    The third entry "Linux loopback sample" is the code that might be presented to the user as a basis for his customization.

    The grub.config file works fine at boot time as is. I thought you might like to try it and give me any suggestions before I set up this new function in Grub2Win. Remember, the goals here are to keep it simple for the user and have it work in diverse environments.

    I'll be away for a few days, visiting family. I look forward to your thoughts.

    Thanks again for your valued input and suggestions.

    Dave

     
  • Ed  P

    Ed P - 2016-12-25

    Thank you Dave. I will definitely check it out.

    Safe travels over the Christmas holiday my friend.

    BTW With a menu check using my current cfg file and the 8.0.8 version of Grub2Win I got this error:

        ** Warning. Custom code is missing for sync - Menu Entry 0    Windows Boot Loader
    

    Comparing the new cfg file with a previous one I see:

    menuentry   'Windows Boot Loader'       --class windows   --class icon-windows  {
    set windiagdelay=2
    

    verses

    menuentry   'Windows Boot Loader'       --class windows   --class icon-windows   --class custom_000  {
    set windiagdelay=2​
    

    Ed

     

    Last edit: Ed P 2016-12-25
  • Ed  P

    Ed P - 2016-12-26

    Dave,

    Some changes that I made:

    Porteus menu

        set review=30
    #
    
        set bootparms='from='$isopath' changes=EXIT:'$linux_drv'/changes/porteussave.dat volume=33 reboot=cold extramod='$linux_drv'/Modules'
    

    I added the top line in the specific-code section and the bottom as a replacement for what you had. I changed the name of the variable and added a space before changes=.

    function loopboot

    # start-grub2win-loopboot-section   ********************************************************
    
        if [ -z $bootparms ];  then echo "** Variable bootparms  is not set **"; set varcheck=failed; else echo "Variable bootparms  is set to '$bootparms'";  fi
        echo
        if [ $varcheck = ok ] ; then search -f $isopath --set=root; fi
    
        echo "Linux will boot from " ($root)$isopath
        if [ ! -z $review ]; then sleep -v -i $review; fi  
    
    # end-grub2win-loopboot-section     ********************************************************    
    

    The top line reflects the changed name of the boot parms variable. The varcheck test sets the root variable to the location of the iso file. The bottom lines display the full path of the iso to be booted and if the user specified a review variable in the menu code it pauses the execution for the user to view what's been set.

    Questions I'm reasonably sure you will encounter with this loopboot menu option is Windows users asking how do they find what to set the kernelpath, initrdpath and bootparms variables to. FWIW I use Elaborate Bytes' free Virtual CloneDrive app to open ISO files and examine their file structures. It shows me where the vmlinuz and initrd files are and it allows me to find cfg files that give clues to what to use for the bootparms.

    Ed

     

    Last edit: Ed P 2016-12-29
  • Ed  P

    Ed P - 2016-12-31

    hmmmm The changelog for the new 8.1 version of Grub2Win looks interesting. I may have to check it out sometime. :-)

     

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.