Program for creating gfx themes. Creating a bootable GRUB4DOS USB flash drive using grubinst


Hello friends! My name is Vitaly Vladimirovich. I recently read on your website http://site an article by reader Andrey about, made in the WinSetupFromUSB program. To be honest, I didn’t like the method described in the article and I want to offer you my own version of creating such a background image.

The theme files are located in the cpio archive and the theme file is a binary file, so in order to make any changes you need to compile the Gfxboot theme again from the source files (codes). It sounds very scary, but fortunately everything turned out to be quite simple. I will tell you in detail, with pictures, so that everything will be clear.

Looking inside you will see a lot of files, the first thing we are interested in is the files gfxboot.cfg And back.jpg.

We need to slip in our image. The file is back.jpg, this is an image in the format 1024x768x24b jpeg 1.1.

You can replace the image with whatever you want by renaming it back.jpg and placing it in the folder with the source files (replacing the old one, of course). Don't forget that the format should be jpeg 1.1, not 2.0 or Progressive. You can save photos in jpeg 1.1 using GIMP 2.6.

GIMP, if you save the image in jpeg with the default settings, you will get exactly what you need (one clarification: you need to download the program that needs to be installed. The portable version gives an error).

I chose this picture:

Its original resolution was 1680x1050, that is, the resolution of my monitor. The image for the flash drive must have a resolution of 1024x768 (or 800x600). This limitation is due to the GRUB bootloader. Well, in Photoshop we cut off the excess (we cut it off, not just change the resolution, otherwise the proportions will change) and bring the resolution to 1024x768. How to work with Photoshop is beyond the scope of this article, but believe me, it’s a matter of a few minutes. After Photoshop the picture looked like this:

Let's look at its properties:

For a picture on a flash drive, it has very good quality. I mean the number of dots per inch. So that you don’t repeat my mistakes (I tried to use the image in this quality, but it didn’t work), I’ll say right away that the number of dots per inch should be reduced, well, at least to 200 dots per inch. The deterioration in quality is almost invisible to the eye. But there is one caveat here: we reduce the number of dots per inch, but the width and height must remain unchanged in order to use the entire screen size! This trick will not work in Photoshop - if we reduce the number of dots per inch, the dimensions will also decrease. But there is a way out! Open this image in GIMP, go to “Image” --> “Image Size”:

We leave the width and height the same, and reduce the X and Y resolution to 200 and click “Change”:

Save the image. Let's look at its properties:

Now we will change the colors of the elements and menu positions.

To make the remaining changes we will edit the configuration file gfxboot.cfg by changing some of the following parameters:

boot_show(default: 0)

If set to 1, "Boot Options" will be displayed.

Grub4dos does not use this option, so it is best not to display it.

xmenu_hide_current(default: 0)

Set it to 1, Hide the current selected position (you don’t have to touch it).

menu_start_x, menu_start_y

Menu item.

Using these options, you can move a block of text anywhere on the screen. As a result of experiments, I chose X=50, Y=250. It looks more organic in this picture.

menu_max_entries(default: 20)

Number of loading points. If you have more than 20 or you decrease the parameter, the list will work with scrolling. I reduced it to 15.

menu_bar_min_width

menu_text_normal

Load item text color, use RGB codes, for example: 0xff002f. This is red. RGB codes can be generated in GIMP:

menu_text_select

boot_text_options

boot_text_normal

Load options text color

infobox_bg

Information field background

infobox_text_normal

Information field text color

menu_bar_color

hide_reboot(default: 0)

Set it to 1, the reboot button will disappear (F9)

hide_poweroff(default: 0)

Set it to 1, the poweroff button (F10) will disappear

disable_num_key(default: 0)

This option allows you to select download items by pressing the appropriate key, for example by pressing "1" you will select the first download item. If you don't need it, feel free to put it at 1.

hide_help(default: 0)

Let's set it to 1, we'll be left without the ability to call for help (F1), it's quite possible to survive

hide_lang(default: 0)

Set it to 1, hide the language selection button (F2)

custom_width, custom_height, custom_depth

By default, the image resolution is 800x600x16, if you want to make the image larger, do it as in the example: custom_width=1024

custom_height=768

The selected parameters must be supported by the BIOS.

panel_normal

Color of Headings in Help and the help item itself

panel_title

Function key display text color (Fn)

Well, now, after the work done, we assemble and install our theme file.

Now that the image has been replaced and all the settings in the configuration file have been made, you need to compile (assemble) the theme file.

Unzip it and run it msys.bat:

If you unpacked the archive to the address C:\, then write the command in the console:

cd /c/gfxboot- this will move the action to the target folder (space only after cd and no colons!).

If you unpacked the source files to another location, then write your own command, it will start with “cd” and write the rest according to the example -

cd /drive letter/folder where the files are located

Then enter the make command and press Enter again:

After that we find in the folder gfxboot message_en file, this is the new GfxBoot theme.

You can rename the file, give it your own name and be sure to compress the archive into GZ (the 7z archiver can do this). Right-click on the file, select our 7-Zip archiver and select “Add to archive…” in the context menu:




It's simple here:
1. Download unifont.hex.gz


graphicsmode -1 640:480
font/unifont.hex.gz

timeout 30
default 0
graphicsmode -1 640:480

font/unifont.hex.gz

title Memtest86+ 4.20
map --mem /MEMTEST.IMG (fd0)
map --hook
chainloader(fd0)+1
rootnoverify(fd0)
map --floppies=1
boot

title Victoria 3.52 DOS

map --hook
chainloader(fd0)+1
rootnoverify(fd0)
map --floppies=1
boot



map() (hd0)
map(hd0)()
map --rehook
find --set-root --ignore-floppies --ignore-cd /ntldr
chainloader/ntldr



map() (hd0)
map(hd0)()
map --rehook
find --set-root --ignore-floppies --ignore-cd /bootmgr
chainloader/bootmgr

title Turning off the PC
halt





Using Gfxboot themes.

When copying an article, please indicate the author.
Best regards, GRomR1.

We have a bootable flash drive. We learned how to add programs to it. Now how to decorate it? I propose to add support for the Russian language and Gfxboot themes.


Russian language support in Grub4Dos.

It's simple here:
1. Download unifont.hex.gz
2. We throw it at the root of the flash drive (you can not at the root, but you will need to change the path)
3. Write at the very beginning of menu.lst:

graphicsmode -1 640:480
font/unifont.hex.gz
4. Rename the headings of our menu.
5. We get the following (I also added a command to automatically select 1 item after 30 seconds):
timeout 30
default 0
graphicsmode -1 640:480
#you can experiment with 640:480, i.e. change it to another value and see what happens
font/unifont.hex.gz

title Memtest86+ 4.20
map --mem /MEMTEST.IMG (fd0)
map --hook
chainloader(fd0)+1
rootnoverify(fd0)
map --floppies=1
boot

title Victoria 3.52 DOS
map --mem /Victoria-v.3.52.3.ima (fd0)
map --hook
chainloader(fd0)+1
rootnoverify(fd0)
map --floppies=1
boot

title Search and download Windows NT/2000/XP
find --set-root --ignore-floppies --ignore-cd /ntldr
map() (hd0)
map(hd0)()
map --rehook
find --set-root --ignore-floppies --ignore-cd /ntldr
chainloader/ntldr

title Search and download Windows Vista/7
find --set-root --ignore-floppies --ignore-cd /bootmgr
map() (hd0)
map(hd0)()
map --rehook
find --set-root --ignore-floppies --ignore-cd /bootmgr
chainloader/bootmgr

title Turning off the PC
halt

6. Save in UTF-8 encoding. In AkelPad it will look like this:

7. Done. We check in MobaLiveCD.

And as you probably noticed, it took a little longer to load, still, if the Russian language is not so necessary, I advise you to refuse to use it in the menu, who knows what will happen in the next version and how it will work there, the same applies to the use of GfxMenu, which will be discussed further.

Using Gfxboot themes.

1. Download the theme from

Allows you to create multiboot configurations.
This bootloader allows you to boot from various devices and partitions, supports loading various images (iso, img, ima, bin ...), understands the file systems FAT12, FAT16, FAT32, NTFS, EXT2, EXT3 and much more.

CREATION

Method one. For this we need a program grubinst which will write data about the grub4dos bootloader into the mbr area of ​​the required device, and the bootloader executable file grldr.

Contents of the archive grubinst_1.0.1_bin_win.zip.

Contents of the archive grub4dos-0.4.6a-2013-04-01.7z.

Unpack the contents of the grubinst archive. Insert the flash drive into the computer. Launch from unpacked files grubinst_gui.exe .
In the window that opens, next to the word Disk We select our flash drive from the list, usually the very last item from the drop-down list. If the drop-down list does not contain any values, then you need to click on the button Refresh.
In the dropdown list Part List select the value Whole disk (MBR). Likewise, if the list does not contain values, click on Refresh.


Click on the button Install . Then in response we will receive a window with a message that everything has been installed successfully.


Press the key ENTER .

Now all that remains is to copy the files to the root of our flash drive grldr And menu.lst . The latter is a configuration file for the displayed menu that we will see after loading from our flash drive. We take these files from the archive grub4dos-0.4.6a-2013-04-01.7z. File menu.lst is in the folder sample.

It should look like this...


The creation of the grub4dos bootable USB flash drive is complete.

Now we set the boot priority in the computer’s BIOS to our flash drive, and boot from it. The download result is shown below.

Various PEtoUSB, there are more universal ones like in this topic. A bunch of utilities essentially install the grub, isolinux bootloader (less often BCDW or lilo, even less often your own like Win7), and then put the files offered to it (Windows7,WindowsXP, Ubuntu, etc.) into folders. This is where the demand for images comes from (as they wrote in the comments to this topic).

Meanwhile, the vast majority of disks posted on the Internet (especially USB) use isolinux and grub, what prevents them from simply being combined? never mind!

I will try with examples tell you how to make a bootable, installation, or just a Live flash drive, all in one without utilities tailored for a specific distribution. And be able, if necessary, to easily add something else to the flash drive, without reformatting it again.

Not all of the antivirus images were successfully “attached” to a flash drive, if someone can and will share their experience, I will be glad (I haven’t downloaded them for a long time, perhaps in the latest versions this is already made much easier). The image from Dr.Web, for example, even contains instructions for installation on flash drives.
For reference, Live images of antiviruses:
Dr.Web
BitDefender
Avast! already paid :(
Symantec NAV
Panda
Avira

8. DOS. It’s worth dividing here: if we need DOS for some serious work, then it makes sense to find DOS-Live images, for example this one, and load it as in step 3. We run DOS so that we can then launch the installation of Windows XP from it. From DOS we need:
AUTOEXEC.BAT
COMMAND.COM
CONFIG.SYS
EMM386.EXE
HIMEM.SYS
IO.SYS
SMARTDRV.EXE

Preferred, but not required:
Mouse.com
MOUSE.INI
OAKCDROM.SYS

We copy all this to the root of the flash drive, and in menu.lst add
title DOS (Install WinXP?)
root(hd0,0)
makeactive
chainloader/io.sys
Here you can either enjoy DOS, or in advance in AUTOEXEC.BAT register (the answer file is of course optional):
smartdrv
cd\WinXP\i386
winnt /U:\WinXP\i386\winnt.sif

9. Installing Windows 7. As I wrote above, just unzip the ISO to the root of the flash drive, and in menu.lst add (already with hd0.0)
root(hd0,0)
chainloader/bootmgr
boot

10. Well, just for good measure, I’ll tell you about one more type of utility. Some (not all!) ISO images can be loaded directly from grub. Among these I found: Acronis True Image, Acronis Disk Director, Active Password Changer. These are specially prepared images (not a simple copy from a CD), they can be loaded as follows:
title Active Password Changer
map (hd0,0)/Pwdchanger.iso (hd32)
map --hook
chainloader (hd32)

Removal

What to do if you accidentally installed grub in the MBR of the main disk, and not the flash drive, or you need to remove it from the flash drive? You can use the utility bootsect.exe as I wrote above.
If you have not rebooted yet (if you have rebooted, then use grub to load Windows using the method described above), and run bootsect.exe
To restore Windows XP bootsect /nt52 c: /mbr
To restore Windows Vista/7 bootsect /nt60 c: /mbr
bootsect is in the folder boot Windows disk, and is also in my posted archive at the end of the article.
It's easy enough to format a flash drive.

Conclusion

I hope that the examples will help someone figure it out, and someone will be interested in this bootloader, and the utilities for creating bootable flash drives will make you smile (I don’t want to offend anyone, I respect all developers, moreover, I started with such utilities myself). And of course, I highly recommend studying grub itself in more detail, and GRUB4DOS, for example here

I’ve been wanting to write for a long time about how to create my own themes for grub4dos, and now I had some time, and I decided to spend it usefully. If you use "grub4dos" to create " bootable flash drives", then you might be interested, I'll show you how easy it is to create a theme for "grub4dos"

To create your own themes for “grub4dos” you only need Photoshop and an archive with the files necessary for this matter. Which you can download from the blog!

How are themes created for grub4dos?

Download. It contains a folder called “gfxmenu”, put it in the root of the “C:\” drive. Now you need to take either a ready-made picture from the Internet or draw your own in Photoshop. I propose the second option.

In Photoshop, create a new project, and the size should be “800×600”. In principle, everything is at your discretion, draw what you need.

Once the image is ready, save it to the “files” folder, which is located in the “gfxmenu” folder. The name of the image should be “back.jpg” and most importantly:

The value, quality should not exceed more than “32” otherwise, in place of the picture, when you boot the computer from the flash drive, you will just get a black window without your theme!

It’s also worth adding about the resolution of the image itself “800×600”, it all depends on your “BIOS” - some bios will support large extensions, but some won’t!

After the picture has been saved in the “files” folder with the name “back” and in the “jpg” format, find the “repack.bat” BAT file in the “gfxmenu” folder, now all you have to do is run it, after which the file “” will appear in the same folder message" demon extension.

This file is your theme for “grub4dos”, now you can use it in “bootable flash drives”. Link on topic.

This was the first option on how to create your own themes for grub4dos! In my opinion, the most convenient and simplest. There will be another post about other options. To apply the resulting theme to the “menu.lst” file, add the line!







2024 gtavrl.ru.