Questions tagged [grub2]

GENERAL GRUB2 SUPPORT IS OFF-TOPIC. Support questions may be asked on https://superuser.com. GRUB2 is a boot loader with support for modern day computer systems. It is meant to replace the older GRUB boot loader (now referred to as "GRUB Legacy").

Copied from https://wiki.gentoo.org/wiki/GRUB2:

GRUB2 is a boot loader with support for modern day computer systems. It is meant to replace the older GRUB boot loader (now referred to as "GRUB Legacy").

56 questions
2
votes
1 answer

Grub throws "can't find command `['." when adding conditional to grub.cfg

It was my understanding that grub supports a small subset of bash. Their documentation doesn't go into super detail, other than it "supports conditionals", etc. I am trying to run a simple if. grub> if [ "${myvar}" = "fred" ]; then > echo "test" >…
Paul Knopf
  • 9,568
  • 23
  • 77
  • 142
2
votes
1 answer

Get total avaiable RAM from the GRUB2 multiboot info structure

I managed to access the GRUB multiboot info structure (multiboot_info_t) in my i386 kernel, and there are two fields called mem_lower and mem_upper respectively. How do I use them to get the total available RAM (in bytes)?
SpilledMango
  • 575
  • 7
  • 25
2
votes
3 answers

How do I install a custom kernel on a google compute engine instance?

I would like to install a custom kernel image on a Google Compute Engine instance. I have an instance running with: foo@instance-1:/boot/efi$ uname -a Linux instance-1 4.10.0-22-generic #24-Ubuntu SMP Mon May 22 17:43:20 UTC 2017 x86_64 x86_64…
MemoryWrangler
  • 335
  • 2
  • 10
2
votes
1 answer

How does GRUB load the kernel at 0x100000

I'm writing a bootloader and kernel from scratch and my goal is to create a kernel that can both be loaded by GRUB and my bootloader. The issue isn't with the kernel, though. I don't know how to load the kernel at 0x100000 which is where grub…
Mike
  • 175
  • 1
  • 13
2
votes
1 answer

How to install grub on image file WITHOUT root privilege?

I'm doing a project that needs to generate a vm image file which will then be used as qemu bootable disk image. Previously, our product is like an modified linux system and is made into a USB installation drive and then boot and install into an bare…
skywalker
  • 45
  • 3
2
votes
2 answers

Read file contents to variable in grub.cfg file

Q1. Wanted to know how do you read the contents of a file to a variable at boot time in grub.cfg? Q2. Could that be extended to read an .ini type file where you can read the values for various name…
user3161924
  • 1,849
  • 18
  • 33
1
vote
0 answers

Read and test BIOS vendor from grub

Recently due to supply shortage, we have been tasked with replacing a COMe module in our product. It has become necessary to determine which module is inserted since the serial redirection for boot output is different and other reasons. I can use…
Jeff
  • 23
  • 4
1
vote
1 answer

How to load userland with grub in this case?

I learn usermode by tutorial. In the tutorial they built kernel image by this code: nasm -f bin -o boot.bin boot.asm nasm -f bin -o loader.bin loader.asm nasm -f elf64 -o kernel.o kernel.asm nasm -f elf64 -o trapa.o trap.asm nasm -f elf64 -o liba.o…
JustOneMan
  • 231
  • 1
  • 9
  • 34
1
vote
1 answer

Grub report that "NOT SUPPORT TAG 0x0a"

I'm making a OS Grub report that "NOT SUPPORT TAG 0x0a",if its real.Then I will not be able to specify the address where the kernel is loaded. So how do I link? Or is the target address specified in the standard by grub? this is my header .section…
AlanCui
  • 137
  • 9
1
vote
1 answer

Remove GRUB cursor (before kernel)

I am trying to remove cursor that appears even before Boot menu and kernel (I am using GRUB2). I can remove "GRUB loading" and "Welcome" messages but the cursor still remains. I tried modifying registers (AH, CH) with INT 10H routine in…
scarably
  • 333
  • 1
  • 4
  • 11
1
vote
1 answer

How to run shim from inside grub2 code?

I am new to grub. I am trying to enable UEFI secure boot from grub. I have decided to use shim to verify kernel's signature. Grub can be verified from UEFI. I have pulled patches from Ubuntu's grub git repository. Grub uses…
1
vote
0 answers

Installing grub2 in yocto rootfs

I am working on yocto, I want to include grub2 exectables such as grub2-mkconfig in my filesystem. I am able to install grub in yocto, by adding below line. MACHINE_ESSENTIAL_EXTRA_RDEPENDS = "grub" PREFERRED_VERSION_grub ?= "1.99" when I change…
anikhan
  • 1,147
  • 3
  • 18
  • 44
1
vote
2 answers

Why does big black box appear over my GRUB2 theme when booting?

I have created a GRUB2 theme, which gives me a screen like this: But when I select one of the items to boot, before it boots, for about 5 seconds, it writes a big black box over the screen, like this: Where is this black box coming from? It is…
Edward Hartnett
  • 882
  • 7
  • 16
1
vote
0 answers

Passing data from GRUB2 module to kernel during boot-up

Is there any way to pass data from a custom GRUB2 module to kernel, so that a kernel driver module can use it? I am writing a GRUB2 module that process some data and need to get this data output passed to kernel. The data consists of some integers…
electro
  • 911
  • 4
  • 12
  • 28
1
vote
2 answers

grub2-mkpasswd-pbkdf2 - can it accept standard input?

On CentOS 6 we currently encrypt the grub password using the password --md5 option and we are able to script this into our standard server build. We are busy migrating to CentOS 7 and it appears that the password --md5 option has been removed in…
Pancho
  • 2,043
  • 24
  • 39