efivars

Ruben Safir ruben at mrbrklyn.com
Thu Sep 23 00:01:20 EDT 2021


On Wed, Sep 22, 2021 at 06:07:49PM +0200, Greg KH wrote:
> On Wed, Sep 22, 2021 at 11:47:42AM -0400, Ruben Safir wrote:
> > On Wed, Sep 22, 2021 at 08:35:15AM +0200, Greg KH wrote:
> > > On Wed, Sep 22, 2021 at 02:22:22AM -0400, Ruben Safir wrote:
> > > > What is this for?
> > > > 
> > > > efivarfs on /sys/firmware/efi/efivars type efivarfs
> > > > 
> > > > why would the OS need to know anything about the UEFI 
> > > > boot loader once it is up and running?
> > > 
> > > Because there are lots of needed system information that the OS, and
> > > userspace, needs to get from UEFI after the system has booted.
> > 
> > Such as what?  It is not needed when booting with LILO?
> 
> Do you really still use LILO?

whenever possible


> 
> > Once the OS is up and running, what possible reason does the OS need
> > anything about the booting enviroonment?
> 
> It needs to get up and running.  And even then, while running, it still
> needs to get some information from UEFI.  Fun things like device
> information, system information, and other things.
>

The OS has direct access to the hardware.  It can read it and identify
it.

> Look at what `dmidecode` gives you, that's one example.

Thanks, I will look

What is all this garbage?

~$ sudo ls /sys/firmware/efi/efivars/ |wc
    211     211   11511


> > 
> > Aside from the obvious security issues?  It is a huge problem for
> > installation from BIOS environments and it is an unneeded lock in.
> 
> What "lock in"?  Your system relies on the bootloader to interact with
> the system both to boot, 

And that should be it.  

>and for some system interactions while running.
> That's just how ACPI/UEFI works.

And if you are running out of a BIOS system, the system won't boot and
work?  Of course it will.

How about non-x86 platforms that don't have UEFI?

> 
> If you don't like this, wonderful, use a system based on a different
> type of bootloader.  But in the end, they end up all having to do the
> same thing somehow :)

Don't like it, that is for sure.  What it is doing is another problem.

If you are booted from an thumbdrive using BIOS, and installing a UEFI system, it
shouldn't need a bunch of UEFI firmware data to do the installation for
a UEFI installation.  The kernel OS should be independent once it is up
and running and building a UEFI boot chain shouldn't depend on being
already loaded UEFI environment.  

Why would the OS need to know what booted it?  Hence the question, what
does efivars provides that is needed for the OS to run... not BOOT but
run.

> 
> > All I want the boot loader to do is fine the kernel and run it.
> 
> Your bootloader also has to do a lot more things (initialize hardware,
> provide information to the OS as to what hardware is present, do
> system-level things like suspend/resume, etc.)
> 

Why does it need that?  The OS has access directly to all the hardware
and can read it and load any needed modules.


> > I can't think of anything that a bootload does that should be needed for
> > a running OS whatsoever.  What are EFI variables that are being stored
> > and manipulated?
> 
> Look at them and see, it's all there for you to read.  The whole UEFI
> spec is also public 

I've read it.  Refresh my memory.  Where does it say that the bootloader
actively speaks to the running OS after the OS is up and running?  Once
it hands off to GRUB or any other boot loader, and the OS is up and
running, why does the OS care what launched it?

I've been told that the OS needs to reload firmware to reboot atached
devices like network cards.  These devices phsycially are plugged into the system
Once they are IDed, the OS should be able to control them completely.

>as well as a working implementation of the code that
> is used for your system.

That has been called Kernel Modules.  Are we talking about binary firmware blobs 
that are not part of the kernel?

Thanks for the reply!

Reuvain

-- 
So many immigrant groups have swept through our town
that Brooklyn, like Atlantis, reaches mythological
proportions in the mind of the world - RI Safir 1998
http://www.mrbrklyn.com 

DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002
http://www.nylxs.com - Leadership Development in Free Software
http://www2.mrbrklyn.com/resources - Unpublished Archive 
http://www.coinhangout.com - coins!
http://www.brooklyn-living.com 

Being so tracked is for FARM ANIMALS and extermination camps, 
but incompatible with living as a free human being. -RI Safir 2013




More information about the Kernelnewbies mailing list