Custom code with GRUB?

Is it possible to run some custom code at the time of loading GRUB? In other words, does GRUB provide the ability to run any custom code before loading any operating system?

+3
source share
1 answer

Since GRUB supports the Multiboot specification , yes you can. You will get the code downloaded by GRUB, then you will have to load the operating system yourself (which you could do by supporting the Multiboot specification yourself ...). Depending on what you want to do, this may not be the easiest way to do this.

If you want to run some custom code before loading a Linux-based operating system, creating custom initramfs will be much easier.

+6
source

Source: https://habr.com/ru/post/1726250/


All Articles