Wednesday, July 10, 2013

Create Gfxmenu

This guid is copied from: http://diddy.boot-land.net/grub4dos/files/gfxmenu.htm All necessary files on Here . But you should read it to know ^_^

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. or
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 -
  • Pressing the [c] key will not open a command prompt - a commandline menu entry will however function normally.
  • In memory editing of menu entries (pressing the [e] key) does not work.
  • Password options are not fully supported, although individual menu items can still be password protected.
  • timeout command does not work.
  • default command does not work.
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) -
boot_show (default: 0) if set to 1, show the "Boot Options" box. As grub4dos currently don't use this feature, it might be better to hide it.xmenu_hide_current (default: 0) if set to 1, hide the current selection item below the bottom menu.menu_start_x, menu_start_y Position of menumenu_max_entries (default: 8) Maximum number of menu entry to display.menu_bar_min_width The minimum width of menu select bar.menu_text_normal Normal text color, use RGB value such as 0xffffff.menu_text_select Color of selected textboot_text_options Color of boot options labelboot_text_normal Color of boot options textinfobox_bg Background color of info boxinfobox_text_normal Text color of info boxmenu_bar_color Color of menu barloading_color Color of load bartitle_bg Background color of dialog backgroundhide_reboot (default: 0) If set to 1, hide the reboot button (F9) hide_poweroff (default: 0) If set to 1, hide the poweroff button (F10) disable_num_key (default: 0) This message file has added keyboard shortcut function, for example, pressing '1' would choose the first menu item. If you don't want it, set this variable to 1. hide_help (default: 0) If set to 1, hide the help button (F1) hide_lang (default: 0) If set to 1, hide the language button (F2) custom_width, custom_height, custom_depth By default, the screen resolution is 800x600x16, if you want a higher resolution, set these three variables, for example: custom_width=1024 custom_height=768 custom_depth=16 The mode must be supported by bios, otherwise, it just fallback to default. panel_normal Color of panel text panel_title Color of panel title panel_high Color of panel hotkey (Fn) panel_bg Background color of panel pop-up box panel_border Border color of panel pop-up box
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) -
boot_show (default: 0) if set to 1, show the "Boot Options" box. As grub4dos currently don't use this feature, it might be better to hide it.xmenu_hide_current (default: 0) if set to 1, hide the current selection item below the bottom menu.menu_start_x, menu_start_y Position of menumenu_max_entries (default: 8) Maximum number of menu entry to display.menu_bar_min_width The minimum width of menu select bar.menu_text_normal Normal text color, use RGB value such as 0xffffff.menu_text_select Color of selected textboot_text_options Color of boot options labelboot_text_normal Color of boot options textinfobox_bg Background color of info boxinfobox_text_normal Text color of info boxmenu_bar_color Color of menu barloading_color Color of load bartitle_bg Background color of dialog backgroundhide_reboot (default: 0) If set to 1, hide the reboot button (F9) hide_poweroff (default: 0) If set to 1, hide the poweroff button (F10) disable_num_key (default: 0) This message file has added keyboard shortcut function, for example, pressing '1' would choose the first menu item. If you don't want it, set this variable to 1. hide_help (default: 0) If set to 1, hide the help button (F1) hide_lang (default: 0) If set to 1, hide the language button (F2) custom_width, custom_height, custom_depth By default, the screen resolution is 800x600x16, if you want a higher resolution, set these three variables, for example: custom_width=1024 custom_height=768 custom_depth=16 The mode must be supported by bios, otherwise, it just fallback to default. panel_normal Color of panel text panel_title Color of panel title panel_high Color of panel hotkey (Fn) panel_bg Background color of panel pop-up box panel_border Border color of panel pop-up box
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 -
****************************************************************************** *** gfxmenu support in grub4dos *** ******************************************************************************Gfxmenu support has been added to grub4dos. To use it, you must first find the message file you need, then load it in menu.lst with command like this:gfxmenu /messageThis should be a gloabl command, that is, not inside any menu item. Also, it can only be used in configure file, running it in console mode does not work.gfxmenu does not work in conjunction with the password feature.There are two major format of message file. Old format is created with gfxboot 3.2.* or older (size of message file is normally about 150K), while new format is created with gfxboot 3.3.* and later (size of message file is normally above 300K). Both format are supported in grub4dos.****************************************************************************** *** possibility to run another menu.lst after gfxmenu *** ******************************************************************************Notice the use of CONFIGFILE after GFXMENU in the following example:# The menu.lst file for gfxmenu default=0 timeout=5 gfxmenu /message configfile /another.lst title 0.......... ................ title 1.......... ................ title 2.......... ................ # End of menu.lst# Begin another.lst default=0 timeout=5 title 0.......... ................ title 1.......... ................ title 2.......... ................ # End of another.lstThis will try gfxmenu command first. On exit(or on failure) control will go to another.lst file.

No comments:

Post a Comment