Wednesday, April 15, 2015

Adding submenus to initial GRUB boot menu

Works on Icaros 2.0.4 are going on, even if I recently forgot to add any status update on this page. So I decided to write a little tutorial about a nice customization I'm adding to the distribution. Unluckily, only whoever will install v2.0.4 from scratch (Live! or Light versions) will see that, while users of current editions will need to manually make some modifications to a single text file to reach the same results. LiveUpdater, unluckily, isn't smart enough to do that by itself (which is obviously a poor exscuse: please read it as "I am not able to automate the process, forgive me!"). As you may see from the screenshot, next boot menu will show only two lines:

Icaros Desktop
Advanced boot options for Icaros Desktop

Eventually, people installing Icaros onto a blank partition after a Windows installation, will also see a option to boot the system into Windows as well. By the way, choosing the latter option ("Advanced etc etc") will give user access to other boot options, the classic ones with 1024x768, VGA and other resolutions, with or without TLSF and floppy support. In a nutshell, those options you'll normally not run unless you got some weird behavior by standard Icaros setup. This will be just a cosmetic change. But how can you reach the same result on your already-installed Icaros environment as well? It's quite easy.

1) First of all, whatever GRUB-fired OS you're running, you must have a grub.cfg file hidden somewhere in your boot partition. On Icaros Desktop, this file is placed into the SYS:Arch/PC/Grub drawer. Copy it to another location, to keep a safe backup somewhere. Now open it with your favourite text editor and look for this line:

set default=

whatever will be the following number, set it to 0:

set default=0

this will make Icaros' default boot option the first one in the list.

2) Now move after the first block of kernel modules, just between these lines:
    module /Libs/oop.library
    module /Libs/utility.library

| <--- place cursor here!!!
menuentry "Icaros Desktop (true colour VESA graphics)" {
    multiboot /Arch/pc/bootstrap.gz vesa=32bit ATA=32bit floppy=disabled nomonitors


3) once you've placed the cursor where shown just above, add these lines:

submenu "Advanced boot options for Icaros Desktop" {
 if loadfont /Arch/pc/grub/unicode.pf2 ; then

they will actually add a new submenu, using the same colors as the main one.

4) now close the submenu, moving the cursor to the last line, and add a new } character at the end of document

    module /Libs/oop.library
    module /Libs/utility.library
<----- add this one!!!

You're done! Save and quit.