Jump to content











Photo
- - - - -

a1ive's grub2 and File Manager has great UEFI support!


  • Please log in to reply
190 replies to this topic

#101 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 25 March 2020 - 02:19 PM

But what has that got to do with AIOBoot???  :questionmark:



#102 ktp

ktp

    Silver Member

  • Advanced user
  • 773 posts

Posted 25 March 2020 - 02:22 PM

Again it's my fault. Sorry! I should have post in this thread, where AIOboot is mentioned :

http://reboot.pro/to...-boot-optional/



#103 ktp

ktp

    Silver Member

  • Advanced user
  • 773 posts

Posted 28 March 2020 - 03:01 PM

In the latest agFM_download_files.zip (version 1.33 2020-03-23), there is a new /efi/Clover directory to add Clover support (x86/x64), version 4458. This version is a little old, but it works, together with updated boot files (boot3, boot6, boot7). The new boot7 is excellent, it solves my previous black screen problem when starting Clover in CSM mode.
 
Just to mention that there is missing APFS driver for Clover, so after booting it does not recognize APFS volumes.
 
Question: where can I find in the zip the grubfmia32.efi? Only grubfmx64.efi is found.
 


#104 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 28 March 2020 - 03:02 PM

\EFI\boot\bootia32.efi



#105 ktp

ktp

    Silver Member

  • Advanced user
  • 773 posts

Posted 28 March 2020 - 03:44 PM

\EFI\boot\bootia32.efi

I am sorry, but the /efi/boot/bootia32.efi (less than 1 MB) is in fact the 32-bit version of shim used in Super-UEFIinSecureBoot-Disk_v3.zip.
The grubfmia32.efi file I currently use has about 6 MB-size.


#106 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 28 March 2020 - 03:47 PM

Doh! Sorry - I meant

 

\EFI\boot\grubia32.efi

 

i.e. the EFI file that has the same date as grubfmx64.efi!



#107 ktp

ktp

    Silver Member

  • Advanced user
  • 773 posts

Posted 01 April 2020 - 08:27 AM

Just to share some information about detection of Secure Boot status (enabled or disabled) with GRUB2 UEFI.
I found this code in agFM \boot\grubfm\init.sh:
 
if [ "${grub_platform}" = "efi" ];
then
    search -s -f -q /efi/microsoft/boot/bootmgfw.efi;
    if [ "${grub_cpu}" = "i386" ];
    then
        search -s -f -q /efi/boot/bootia32.efi;
    else
        search -s -f -q /efi/boot/bootx64.efi;
    fi;
    efiload --nc ${prefix}/CrScreenshotDxe.efi;
    getenv -t uint8 SecureBoot grub_secureboot;
    if [ "${grub_secureboot}" = "1" ];
    then
        export grub_secureboot="Enabled";
    else
        export grub_secureboot="Disabled";
    fi;
else
    search -s -f -q /fmldr;
    export grub_secureboot="Not available";
fi; 
 
 
What is strange with GRUB2 : if Secure boot is disabled, the variable SecureBoot is not defined.
(getenv command failed, with message: "error: no such variable" => no variable SecureBoot).
If Secure boot is enabled, then the getenv command is OK, and SecureBoot variable is defined with value 1.
 
So the question is: when SecureBoot variable can get 0 as value?


#108 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 01 April 2020 - 09:01 AM

Why does it need to be 0?

Either the EFI firmware variable exists and is 1, or it doesn't exist.



#109 ktp

ktp

    Silver Member

  • Advanced user
  • 773 posts

Posted 01 April 2020 - 09:11 AM

Well, probably I am quite old-school: I am used to have boolean variable with value 0/1, yes/no, enabled/disabled :-).



#110 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 25 April 2020 - 11:16 AM

The latest version of a1ive's grub2 and agFM now reliably supports non-USA keyboards.

 

This is great improvement because previously the non-USA keyboard support in grub2 was not reliable.

You had to use the terminal_input at_keyboard command which is buggy and caused corruption within grub2 (menus don't work correctly, etc.)

insmod at_keyboard
terminal_input at_keyboard
keymap laptop

The new method uses the 'setkey' module and can 'map' a new key code to an old key code in a very similar way to that used by grub4dos.

setkey y z

will map the bottom left key (z on a USA keyboard) to show y when pressed.

 

Shift and Alt key codes are also supported.

However, the OEM7 key (called oem102 in grub4dos) is not supported. This is the extra key on 102-key keyboards between left-shift and Z.

 

The latest version of agFM (as used by Easy2Boot) contains the new module and key map files.

 

At last you can type 'easy2boot' on a German keyboard in grub2 and not get 'easz2boot' !

 

So now grub2 supports dd, partnew, setkey, map, hexdump, stat -c for a contiguous file test, stat -r to get the Total RAM size, etc. At last we have a UEFI bootloader\manager that is almost as good as grub4dos is for Legacy systems!


Edited by steve6375, 25 April 2020 - 02:01 PM.

  • ktp likes this

#111 paraglider

paraglider

    Gold Member

  • .script developer
  • 1743 posts
  • Location:NC,USA
  •  
    United States

Posted 25 April 2020 - 12:46 PM

Are there any versions of grub2 that allow you to copy files like bcd?



#112 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 25 April 2020 - 01:27 PM

Are there any versions of grub2 that allow you to copy files like bcd?

 

Copy from where to where?

 

The a1ive's version has a FAT FS module support:

https://translate.go...o/grub2_zh.html

https://translate.go...2_fatfs_zh.html

 

 

 

Copy file

cp SRC_FILE DST_FILE

The source file can be either a GRUB file path or a FatFs file path

Example:

cp 1:/foo/bar/sys.vhd 2:/boot.vhd

cp (hd0,2)/foo/bar/sys.vhd 2:/boot.vhd

 

:duff:

Wonko



#113 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 25 April 2020 - 01:55 PM

You can mount up to 9 devices (1-9) and then use cp, ren etc.

mount hd0,2 9
rename 9:/efi 9:/efiXXX
umount 9

only on FAT flesystems though.



#114 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 25 April 2020 - 01:58 PM

P.S. grubFM includes wimboot, so you can specify whatever BCD, boot.wim, bootmgr, bootfmw.efi etc you want. No need to copy files...



#115 Rootman

Rootman

    Frequent Member

  • Advanced user
  • 382 posts
  • Location:USA

Posted 25 April 2020 - 02:56 PM

steve6375, thanks again for a cool utility.  I can't count the times I;ve used E2B and now aGFM.

 

I keep up to date with aGFM and download and install new versions when I see them.

 

I have a couple of suggestions / request.

 

Can you break out the USER portion of 'startup_menu.txt' into a separate file?  When I get a new version of aGFM I have to transfer the menu entries I created to the new 'startup_menu.txt' file.  I see you often make changes to it so I need to add my custom menu entries every time.  If the 'startup_menu.txt' file called another file like 'custom-menu.txt' we wouldn't have to edit the 'startup_menu.txt' each time.  Don't know if it's possible or not. Adding the default selection and timeout to this would also be nice.

 

I make all my updates to both E2B and aGFM easy by fixing up ONE drive. I then back it up using a sync tool then restore both to the rest of my drives.  I have both MBR and GPT based USB HDD disks.  When I edit my 'startup_menu.txt' I have to go through it and change the menu entry line from msdos1 to gpt1 for the few of my GPT drives. Would it be possible to have this as a variable like the timeout and default entries are?  And if possible split it out to the above mentioned 'custom-menu.txt' file?   If it had a variable like 'DiskType=' then only a single change would need to be made.

 

I am really excited to see the way this is all going. It makes it so easy to have so many bootable ISOs, .imgPTNs and utilites in my pocket.  



#116 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 25 April 2020 - 03:06 PM

The download does not contain startup_menu.txt. It contains SAMPLE_startup_menu.txt.

 

So your startup_menu.txt will not change and should continue to work as before.

 

If you want any new entries in your startup_menu.txt, then use WinMerge to compare it with SAMPLE_startup_menu.txt. Using WinMerge makes it very easy to add in missing lines, etc. and compare the files.

 

I didn't think anyone would be running this on GPT disks! It is not even considered and I have never tested it as it won't MBR boot to E2B. Also god knows what happens if you try to use .imgPTN files with it! Sorry, but I just can't support that usage.

 

You can try the format  (hd0,1)  instead of (hd0,msdos1)  if that helps you.



#117 Rootman

Rootman

    Frequent Member

  • Advanced user
  • 382 posts
  • Location:USA

Posted 25 April 2020 - 05:06 PM

The download does not contain startup_menu.txt. It contains SAMPLE_startup_menu.txt.

 

So your startup_menu.txt will not change and should continue to work as before.

 

If you want any new entries in your startup_menu.txt, then use WinMerge to compare it with SAMPLE_startup_menu.txt. Using WinMerge makes it very easy to add in missing lines, etc. and compare the files.

 

I didn't think anyone would be running this on GPT disks! It is not even considered and I have never tested it as it won't MBR boot to E2B. Also god knows what happens if you try to use .imgPTN files with it! Sorry, but I just can't support that usage.

 

You can try the format  (hd0,1)  instead of (hd0,msdos1)  if that helps you.

 

Right, but the SAMPLE_startup_menu.txt contains changes that are not in my older startup_menu.txt, so I need to make a new version to support whatever changes and features that were added by the latest upgrade. A while back a few things were not working that I had read about in your history notes for aGfm, the reason was my startup_menu.txt was from 3 or 4 versions back.  It would be so much easier if the added menu entries were in a separate file or at least at the very top of the current one all the time.  At one point the menu entries were towards the top, now they're about 60 lines down. 
 
I'll try the hd0,1 designation, since all of my devices have that as the EFI boot partition regardless of partition layout. I do notice that variable (${bootdev} is used instead of hdo, should I just use (${bootdev},0) then?
 
I use GPT USB HDD drives just to get the greater than 2 TB for storage of backups.  I use a sync utility to copy the E2B and aGFM files to ALL the drives no matter the partition type for simplicity sake I just realize that CSM and .imgPTN booting is not possible on the GPT drives.  I use the GPT drives to boot to WinPE and utility ISOs on GPT only computers.  When I really must have a CSM boot I use the pendrive in my pocket.  My payload files are always in the same place regardless of drive type, the 1st partition for E2B. 


#118 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 25 April 2020 - 07:07 PM

OK, I will try to tidy up the SAMPLE_startup_menu.txt file for the next version of agFM.

Of course, that means it is going to be even harder for you to work out what has changed next time ;-)



#119 paraglider

paraglider

    Gold Member

  • .script developer
  • 1743 posts
  • Location:NC,USA
  •  
    United States

Posted 26 April 2020 - 12:07 PM

Wonko, So I can do something similar to grub:

 

dd if=()/boot/bcd.wdo32 of=()/boot/bcd
find --set-root /BOOTMGR
chainloader /BOOTMGR

This is so I can avoid using windows boot manager text mode graphics menu on my USB drive when in uefi mode.

 

Probably should not have asked the question in this thread.



#120 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 26 April 2020 - 02:00 PM

Wonko, So I can do something similar to grub:

 

dd if=()/boot/bcd.wdo32 of=()/boot/bcd
find --set-root /BOOTMGR
chainloader /BOOTMGR

This is so I can avoid using windows boot manager text mode graphics menu on my USB drive when in uefi mode.

 

Probably should not have asked the question in this thread.

Yes and no.

 

With cp you are restricted to a FAT or exFAT target.

 

If you dd (and the target file already exists and the filesize is the same,  as it would be needed in grub4dos to use dd) you can use the GRUB2 dd:

https://translate.go...o/grub2_zh.html

https://translate.go...ub2_cmd_zh.html

 

 

 

dd OPTIONS

Write file / string / hexadecimal number to file

Warning: This command will cause the loss of data

  • --if = FILE, -i specify input file
  • --str = STRING, -s specify the input string
  • --hex = HEX, -h specify input hexadecimal number
  • --of = FILE, -o specify output file
  • --bs = BYTES, -b specify block size
  • --count = n, -c specify the number of blocks
  • --skip = n Skip the first n blocks of input
  • --seek = n Skip the first n blocks of output

 

 most if not all the commands in this GRUB2 version are very similar to the grub4dos ones, including (possibly useful to check file size before using dd) blocklist.

 

:duff:
Wonko



#121 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 04 May 2020 - 09:20 PM

agFM v1.49 latest Beta now supports direct MBR and UEFI booting of WinPE ISOs such as Sergei Strelec, Bob Omb's, Medicat, DLCBoot (also requires a .cfg file), HBCDPe, Gandalf's PE. Just copy over the ISOs and UEFI64 Secure boot!

See my blog for more articles on agFM.



#122 paraglider

paraglider

    Gold Member

  • .script developer
  • 1743 posts
  • Location:NC,USA
  •  
    United States

Posted 05 May 2020 - 02:55 AM

I did experiment with the dd command. It was so slow its unusable. It copies the 24Kb BCD file at 200B/s taking over a minute.



#123 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 05 May 2020 - 08:44 AM

I did experiment with the dd command. It was so slow its unusable. It copies the 24Kb BCD file at 200B/s taking over a minute.

Never used this GRUB2 dd command, on grub4dos it is a tad bit slowish but more than bearable.

 

Have you experimented with different block sizes?

 

Usually (at least on other implementations of dd) the "appropriate" block size can speed up the transfer dramatically.

 

:duff:

Wonko



#124 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 05 May 2020 - 08:47 AM

Yes, you must use a blocksize, otherwise it is very slow. Max block size is 4096.



#125 paraglider

paraglider

    Gold Member

  • .script developer
  • 1743 posts
  • Location:NC,USA
  •  
    United States

Posted 05 May 2020 - 11:46 AM

Thanks. That fixed it. Never would have guessed it defaulted to a very small block size.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users