datasone / grub-mod-setup_var

A modified grub allowing tweaking hidden BIOS settings.
GNU General Public License v3.0
378 stars 38 forks source link

Command line args support? #23

Closed ammargitham closed 2 years ago

ammargitham commented 3 years ago

Hi. I want to run 1 command with this efi to unlock Overclocking automatically at boot using refind. Is it possible to run a command passing as arguments?

If it is not possible, I think I may need to compile a custom efi to do it. I am not familiar with grub development, so I am not sure how to use your changes to create my own efi. If you can point out any place where I can start, it would be great.

datasone commented 3 years ago

I don't think it's possible to automatically run this program, this tool works like this: The UEFI executable is actually the usual grub bootloader, but the lack of configuration files let the grub fallback to the rescue shell, where the custom added commands can be used.

So if you want to get it to work automatically, you may need to change how grub works and thus modify grub's code (this project is more like a plugin).

korzhyk commented 2 years ago

@datasone I think @ammargitham want to pass commands to execute in grub env. Like

modGRUBShell.efi --exec setup_var 0xabc 0x01; setup_var 0xcba 0x02; exit
datasone commented 2 years ago

@korzhyk

Yes, but if we need to achieve this, we need to change the code to:

which requires lots of changes into the core of grub codes and just doesn't worth it (this shell is a dirty hack, grub is a bootloader and is never designed to work in this environment normally, the shell is orginally for rescuring and debugging purpose).

It's more ideal that a tool can do all the things above and doesn't depend on grub, but that's a completely new project.

datasone commented 2 years ago

As the tool is rewritten, now it is able to execute from UEFI shell directly and automate it in startup.nsh.