To try to respond to the posts.
Trying to make a simple way to setup my project for users. Many of whom are not experts.
In past, used syslinux in which the iso image could be burned to a CD or copied to a flash since it was a hybrid iso.
Also, had a process where the kernel and ramdisk could be booted from a flash using grub4dos.
Recently had a user that got 140 new systems Dell 3080s that no longer offer non-UEFI booting, so neither the syslinux cd or regular usb would work. Was able to create a flash image that had both grub4dos to boot the regular usb, and had an EFI setup to boot using grub2 the same kernel files and ramdisk.lzma file. Thus having a single usb that could boot either as a normal flash with grub4dos or UEFI flash to boot grub2.
Found that it was reporting that GRLDR was not found on the flash, or any other device if machine if it was formatted as FAT32??
File was obviously there on the partition, but booting failed. Tried formatting as FAT16 instead of FAT32, and it worked? Don't know why.
Later redid the flash to using grub4dos efi to do the booting as well as with the regular. So, having one menu.lst basic setup. Also, the font file used by grub4dos was different that the grub2, so reduced size. Figured that it would work as FAT16 on all machines.
Did just look at the grubinst that was mentioned but it shows that it is 7 years old, and the setup uses the bootlace install the the --gpt option, since the UEFI boot requires the partition to be gpt?? So don't see that working. Also looked at the rpmprep, and it doesn't show anything abou the gpt partition installation of grldr?
Using an iso image that already has the grldr installed via the bootlace using windows works. With linux, once can copy the iso file to the flash device, and it installs the boot loader and the partition with all the files. One advantage over the syslinux hybrid, the extra space of flash can be used, instead of it being setup as a read-only device.
Again, thought everything would work with the FAT16 setup, but ran into the issue with the PNY flash, where it doesn't work with FAT16, but does with FAT32.
Ideal was that I would create a iso image that anyone could download, and then just burn to a flash to use in one simple step. Similar to the syslinux version with a cd or flash.
So, don't know what the FAT16/FAT32 issue , or if it is an issue with the bios or flash or what.
Script that I use to create the image and burn (write) to flashes. -F16 is Fat16 and changing that to -F32 does Fat32, so nothing else is changed in the creation. This creates the ISO file and copies the files, and uses the bootlace.com to install the boot loader. It then shows the usb devices that are available, and gives the option to actually copy the iso to the flash. I've also taken the iso and writing it using rufus, and it then boots as well.
#!/usr/bin/bash
ver="-0.60"
#create a 64M blank file to create Image
dd if=/dev/zero of=g4lefi$ver.iso bs=1M count=64
#create gpt disk format
parted -s g4lefi$ver.iso mklabel gpt
#create single partition, set esp on and boot flag
parted -s g4lefi$ver.iso mkpart G4L 1MiB 100%
parted -s g4lefi$ver.iso set 1 esp on
parted -s g4lefi$ver.iso set 1 boot on
#Use fdisk to display the status
fdisk -l g4lefi$ver.iso
#Create a loop setup to access the partition within file
#losetup --offset $((512*2048)) --sizelimit $((512*131038)) --show --find g4lefi$ver.iso
sectors=$(sfdisk -l g4lefi$ver.iso | tail -n 1 |tr -s ' ' | cut -f4 -d' ');
losetup --offset $((512*2048)) --sizelimit $((512*sectors)) --show --find g4lefi$ver.iso
#Format the Partition a Fat16 (For some reason using Fat32 fails to fine boot loader??
mkfs.fat -F16 /dev/loop0 -n G4L
#Now that partition exist, mount and copy files
mount /dev/loop0 /mnt
cd /mnt || exit
unzip /home/msetzerii/g4l0.60alpha/g4l-lite-fc33.zip
cd /root || exit
umount /mnt
losetup -d /dev/loop0
#Installation of the grub4dos boot loader onto gpt disk image file
#bootlace programs don't seem to work from windows 64bit at all??
./bootlace.com --gpt g4lefi$ver.iso
#Two be able to transfer image to flash, have system find what it shows as.
#Filters out my CD/DVD, primary disk, and ramdisk.
#Only get lines with sd and then only need 1st line. Located in bytes 26-28
#Flash most times shows as sdb, but sometimes shows as sdc??
disks="none none on"
fsarchiver probe 2>&1 | sed '/^$/Q' >/tmp/fsarchiver
for a in $(ls -l /dev/disk/by-path/*usb* 2>/dev/null | grep -v part |sed 's_^.*/s_s_g' | sort) ; do
b=$(grep "$a" </tmp/fsarchiver | cut -b21-51);b=$(echo ${b} |tr ' ' '_')
disks="$disks $a $b OFF ";
done
Xdialog --radiolist "Select USB to be overwritten\nAll data will be lost on it." 15 60 4 $disks 2>/tmp/flash
flash=$(cat /tmp/flash)
rm /tmp/flash
##flash=$(grep -v "sr0\|sda\|zram" </proc/partitions | grep sd |head -n 1 |cut -b 26-28)
#If a value is returned proceed with copy of the g4lefi$ver.iso to flash.
if [[ "$flash" > "sd " ]] ; then
clear
echo copying g4lefi$ver.iso to /dev/"$flash"
dd if=g4lefi$ver.iso bs=64MiB of=/dev/"$flash" & PID=$!
echo "THIS MAY TAKE A WHILE, PLEASE BE PATIENT WHILE WGET IS RUNNING..."
while ps hp $PID >/dev/null ; do
printf "▓"
sleep .25
done
echo copy finished
#copy of 64M image to a flash that is larger results in an error in setup.
#The flash will work with error, but using parted -l, it will offer to fix issue.
#This will then allow the other space to be used. Don't know if windows has a similar process.
echo fix GPT layout by running parted -l
# echo "Enter Fix (after warning message displays)"
echo -e "Fix" | parted -l ---pretend-input-tty
# parted -l
else
echo "No selection"
fi
#At this point, the flash should have dual boot capabilities.
#Can be booted as a regular USB using the grub4os boot loader
#Can be booted as UEFI USB using the EFI boot loader.
#Have asked question on why it works using Fat16 but not Fat32 on grub4dos
#Sees the gpt or regular grub4dos bootloader placed by bootlace
#But fails with message that it can't find grldr program on actual partition??
Don't want end users to have to deal with something like this. Ideally was hoping to just have them download the iso, and use rufus to write it to the flash. Now it looks like I'll need two iso's one with Fat16 and one with Fat32, and they will have to just try one and see if it works, and if not try the other one. So, downloading about 128MB of files?
Been doing the G4L project since 2004, so trying to keep things simple.. (sort of).
Since I don't know what is causing the issue with FAT16/FAT32, and have not way to control machine bios' out there. Might not be a nice clean solution..
Getting the UEFI booting process requires adding 100 lines to the kernel config file to support the framebuffers and fbcon setup.
Again, thanks for the feedback.