datasone / grub-mod-setup_var

A modified grub allowing tweaking hidden BIOS settings.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Command line args support?

ammargitham opened this issue · comments

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.

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).

@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

@korzhyk

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

  • Let grub automatically enter the rescue shell mode.
  • Let grub load commands from the parameters.
  • Let grub quit and chainload another efi executable after the commands are executed.

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.

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