Grub4dos Guide - Gfxmenu


Gfxmenu (also referred to as gfxboot) is an external package supported by Grub4dos, which allows the use of background images (in .jpg format) and animation in menus. Gfxmenu is not particularly easy to configure and any major changes require the files to be compiled from source code, creating new themes is therefore beyond the scope of this guide. Adding a new background image is fortunately relatively straightforward and is covered in this section.

figure 1.

Gfxmenu files are contained within a cpio archive. A binary file (init) within the archive controls the menu position and colours, etc. Bean, one of the Grub4dos developers, has compiled a version that uses a text based configuration file for tweaking gfxmenu (see here). Any references to gfxmenu in the remainder of this section refer explicitly to the version compiled by Bean.

A word of caution, certain Grub4dos features will not function if using Gfxmenu. Pressing the [Esc] key will give you the option to return to a normal Grub4dos menu. Affected features include -

For instructions on editing gfxmenu using Windows see here

For instructions on editing gfxmenu using Linux see here

For menu.lst entry see here

Windows

To customise gfxmenu, create folder(s) C:\gfxmenu\files and C:\gfxmenu\cpio. Now download Bean's gfxboot-3.3-custom.zip (from here or here) and extract message_en to C:\gfxmenu.

You will also require a program capable of packing and unpacking cpio archives in order to change the background image and other gfxmenu settings. Download GnuWin32 Cpio for Windows (tested using version 2.6) - download the binaries .zip file and extract bin\cpio.exe to the C:\gfxmenu\cpio directory, then download the dependencies .zip file and extract bin\libiconv2.dll and bin\libintl3.dll files to the C:\gfxmenu\cpio directory.

Create batch file C:\gfxmenu\unpack.cmd and copy/paste the following text into it -

@echo off
CD %~dp0files
%~dp0cpio\cpio.exe -i < %~dp0message_en
pause

Unpack the cpio archive message_en by running C:\gfxmenu\unpack.cmd - this will extract the contents of C:\gfxmenu\message_en to C:\gfxmenu\files directory.

To use your own .jpg file as a background (splash) image, rename it as back.jpg (case sensitive) and replace C:\gfxmenu\files\back.jpg with the new image. Note - use an 800x600 image to get it to display properly, or edit the relevant settings in c:\gfxmenu\files\gfxboot.cfg (see below).

To edit the menu position, colours, etc - edit the configuration file c:\gfxmenu\files\gfxboot.cfg. Note - this is a sample file and all settings have been commented out with the # character. To ensure that the relevant line is processed remove the # character. The following options are currently supported (copied from here) -

Once you have finished editing gfxboot.cfg you will need to create a new cpio archive. Create batch file C:\gfxmenu\repack.cmd and copy/paste the following text into it -

@echo off
DIR %~dp0files /A-D /B /ON > %~dp0cpio_contents.txt
CD %~dp0files
%~dp0cpio\cpio.exe -ov < %~dp0cpio_contents.txt > %~dp0message
DEL %~dp0cpio_contents.txt
pause

Create a new cpio archive by running C:\gfxmenu\repack.cmd - this will archive the contents of the C:\gfxmenu\files directory to the file C:\gfxmenu\message

See here for instructions on how to add a menu.lst entry.

Linux

The following has been tested using a Puppy Linux (Version 4.0) Live CD. All files and folders were created on /mnt/sda1 - you will need to change the following instructions to reflect your own setup.

To customise gfxmenu, create folder(s) /mnt/sda1/gfxmenu/files. Now download Bean's gfxboot-3.3-custom.zip (from here or here) and extract message_en to /mnt/sda1/gfxmenu/.

Unpack the cpio archive message_en by opening a terminal and running the following commands (this will extract the contents of /mnt/sda1/gfxmenu/message_en to the /mnt/sda1/gfxmenu/files directory.

# cd /mnt/sda1/gfxmenu/files
# cpio -i < /mnt/sda1/gfxmenu/message_en

To use your own .jpg file as a background (splash) image, rename it as back.jpg (case sensitive) and replace /mnt/sda1/gfxmenu/files/back.jpg with the new image. Note - use an 800x600 image to get it to display properly, or edit the relevant settings in /mnt/sda1/gfxmenu/files/gfxboot.cfg (see below).

To edit the menu position, colours, etc - edit the configuration file /mnt/sda1/gfxmenu/files/gfxboot.cfg. Note - this is a sample file and all settings have been commented out with the # character. To ensure that the relevant line is processed remove the # character. The following options are currently supported (copied from here) -

Once you have finished editing gfxboot.cfg you will need to create a new cpio archive. Open a terminal and run the following commands (this will archive the contents of the /mnt/sda1/gfxmenu/files directory to the file /mnt/sda1/gfxmenu/message).

# cd /mnt/sda1/gfxmenu/files
# ls | cpio -o > /mnt/sda1/gfxmenu/message

See here for instructions on how to add a menu.lst entry.

menu.lst Entry

To add a menu.lst enty for .cpio archive message, copy C:\gfxmenu\message (or /mnt/sda1/gfxmenu/message) to the drive containing your menu.lst file and add the following entry to menu.lst (add the entry before your title entries).

gfxmenu /message

Alternatively, a hardcoded path can be used (e.g. to use gfxmenu archive message saved in 1st partition on 1st hard disk drive) -

gfxmenu (hd0,0)/message

The following notes (from README_GRUB4DOS.txt) may also be of use -