[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question on boot device information

From: Pascal Hambourg
Subject: Re: Question on boot device information
Date: Fri, 7 Feb 2020 20:04:17 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

Le 07/02/2020 à 11:52, Felipe Franciosi a écrit :

I have a doubt around what information grub provides to initramfs
regarding the boot device (Linux). IIUC, grub uses the system's
firmware (or its own drivers?)

GRUB can use either the platform firmware or its own drivers to access devices.

to load the kernel and initramfs, later
jumping into the kernel entry point.

At that point, what information does initiramfs has about where it was
loaded from?

AFAIK, none. All the initramfs knows from GRUB is the kernel command line.

In the simple case where both the kernel and the initramfs came from
an NVMe drive (or a disk behind a PCI SCSI controller), is it possible
for initramfs to find out that device's BDF?

You could pass the device to the kernel command line. But the mapping between GRUB device names (hd0, hd1...) and Linux device names (/dev/sda, /dev/nvme0...) is neither straightforward nor persistent, so that may not be very useful. You could use the "probe" function to retrieve a persistent identifier (UUID, label...) from the device, or simply an arbitrary value unique for each menu entry.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]