Wednesday 19 February 2020

Configure a startup menu with a background for agFM

Currently, the agFM menu system can either use the internal theme ('slack') or you can switch it to Terminal mode

However, you can define a startup menu and populate the menu entry with specific payload entries of your choice.

The startup menu will use the same 'slack' theme, but you can change it to use a non-themed menu.

You can specify the resolution (1024x768 recommended), text colours and either a pure colour background or a wallpaper image (stretched or normal and you can use .png, .tga, .jpg or .jpeg).



Note that the text colours that you set will also be used if you set Terminal mode (F4 - T):



Here is an example:

\boot\grubfm\startup_menu.txt

#Rename this file to startup_menu.txt to be active.
#Displays up to five menu options (uncomment lines and change paths as required).
#Menu items are only listed if the file exists.
#type can be e2biso to boot immediately using partnew or wininst for Windows Install ISO or do not set a type to allow user choice from menu.
#for .cfg and .imgptn files, do not set a type and they will auto-run.

#Uncomment the line below if you want agFM to show all files in each folder on startup
#grubfm_set --hide 0

############ USER MENU CONFIG ############
#comment out this section if you want to keep the agFM themed menu system
unset theme
set resolution (1024x768 recommended)
set gfxmode=1024x768
#menu colours - format: text/background  (black background=transparent)
#black,blue,brown,cyan,dark-gray,green,light-cyan,light-blue,light-green,light-gray,light-magenta,light-red,magenta,red,white,yellow
set menu_color_highlight=yellow/black
set menu_color_normal=light-green/black
set color_normal=light-gray/black
#add either your background image or a fill colour - use stretch or normal - .png, .tga, .jpg, or .jpeg
background_image -m stretch (${user})/boot/grubfm/seven.jpg
#valid fill_colors: black,blue,brown,cyan,green,gray,magenta,red,white,yellow
###background_color magenta
###########################################

set timeout=5
set default=0

#DIAG=1 to enable Partition Table info menu entry
set DIAG=1

#The grubfmx_type variable must either be "wininst", "e2biso" or ""

set grubfm0=(hd0,msdos1)/_ISO/WINDOWS/WIN10/Windows10-64-Nov2018.imgPTN23
set grubfm0_title="Windows 10 64-bit English (Secure Boot)"
set grubfm0_type=""

set grubfm1=(hd0,msdos1)/_ISO/WINDOWS/WIN10/Windows10x64UK.cfg
set grubfm1_title="Install Windows 10 64-bit Professional UK Auto-install (not Secure Boot)"
set grubfm1_type=""

set grubfm2=(hd0,msdos1)/_ISO/WINDOWS/WIN10/Windows10x64UK.iso
set grubfm2_title="Windows 10 x64 UK (ISO)"
set grubfm2_type="wininst"

set grubfm3=(hd0,msdos1)/_ISO/LINUX/ubuntu-18.04.3-desktop-amd64.iso
set grubfm3_title="Ubuntu 18.04.3 64-bit (ISO)"
set grubfm3_type="e2biso"

set grubfm4=(${user})/RESTORE_E2B.cfg
set grubfm4_title="Restore E2B partitions"
set grubfm4_type=""

# === DO NOT CHANGE ANY LINES BELOW HERE ===

#grubfm must not be menu entry 1 or above (either 0 or remove this entry)
menuentry "a1ive grub2 File Manager" {
grubfm
}

if [ -f "${grubfm0}" ] ; then 
menuentry "${grubfm0_title}" {
set grubfm_file="${grubfm0}"
if [ "${grubfm0_type}" = "wininst" ] ; then configfile (${user})/boot/grubfm/rules/iso/win.sh ; fi
if [ "${grubfm0_type}" = "e2biso" ]  ; then configfile (${user})/boot/grubfm/rules/iso/e2b.sh ; fi
grubfm_open ${grubfm0}
}
fi

if [ -f "${grubfm1}" ] ; then 
menuentry "${grubfm1_title}" {
set grubfm_file="${grubfm1}"
if [ "${grubfm1_type}" = "wininst" ] ; then configfile (${user})/boot/grubfm/rules/iso/win.sh ; fi
if [ "${grubfm1_type}" = "e2biso" ]  ; then configfile (${user})/boot/grubfm/rules/iso/e2b.sh ; fi
grubfm_open ${grubfm1}
}
fi

if [ -f "${grubfm2}" ] ; then 
menuentry "${grubfm2_title}" {
set grubfm_file="${grubfm2}"
if [ "${grubfm2_type}" = "wininst" ] ; then configfile (${user})/boot/grubfm/rules/iso/win.sh ; fi
if [ "${grubfm2_type}" = "e2biso" ]  ; then configfile (${user})/boot/grubfm/rules/iso/e2b.sh ; fi
grubfm_open ${grubfm2}
}
fi

if [ -f "${grubfm3}" ] ; then 
menuentry "${grubfm3_title}" {
set grubfm_file="${grubfm3}"
if [ "${grubfm3_type}" = "wininst" ] ; then configfile (${user})/boot/grubfm/rules/iso/win.sh ; fi
if [ "${grubfm3_type}" = "e2biso" ]  ; then configfile (${user})/boot/grubfm/rules/iso/e2b.sh ; fi
grubfm_open ${grubfm3}
}
fi

if [ -f "${grubfm4}" ] ; then 
menuentry "${grubfm4_title}" {
set grubfm_file="${grubfm4}"
if [ "${grubfm4_type}" = "wininst" ] ; then configfile (${user})/boot/grubfm/rules/iso/win.sh ; fi
if [ "${grubfm4_type}" = "e2biso" ]  ; then configfile (${user})/boot/grubfm/rules/iso/e2b.sh ; fi
grubfm_open ${grubfm4}
}
fi

if [ "$DIAG" = "1" ] ; then
menuentry "Display USB partition tables" {
echo "Partition type........||  (07=NTFS, 0B\0C\0E=FAT32, 0F=Extended\Logical"
echo "                      ||"
echo "hd0 MBR (LBA0)        vv           [  START  ] [ LENGTH  ]"
hexdump -s 0x1be -n 0x40 (hd0)0+1
echo
echo "hd0 MBR Copy (LBA30)"
hexdump -s 0x1be -n 0x40 (hd0)30+1
echo
echo "hd0 MBR Backup (LBA60)"
hexdump -s 0x1be -n 0x40 (hd0)60+1
echo
ls
echo -n Press a key...
read
}
fi


No comments:

Post a Comment