简体   繁体   中英

Custom code with GRUB?

Can I run some some custom code at the time when GRUB loads up? In other words does GRUB provide a facility to run some custom code before loading any operating system?

Since GRUB support the Multiboot specification , yes you can. You would get your code loaded by GRUB, then you'll have to load the operating system yourself (which you could do by supporting the Multiboot specification yourself...). Depending on what you want to do, that may not be the easiest way to do it.

If you want to run some custom code before loading a linux-based operation system, creating a custom initramfs would be a lot easier.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM