help-grub
[Top][All Lists]
Advanced

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

Re: C code you would compile to run within GRUB2 (is that possible?) ...


From: Albretch Mueller
Subject: Re: C code you would compile to run within GRUB2 (is that possible?) ...
Date: Tue, 12 Dec 2023 04:56:50 +0000

 My exploratory question is based on the fact that I don't know if
there is that possibility and on which stage there already is enough
of an environment to run C code that was compiled using gcc on a
regular Linux-based machine. Or, should assembly be used? I think C
should be OK because dmidecode was written in C:
 https://github.com/mirror/dmidecode/blob/master/dmidecode.c
 and the sha*sum code doesn't seem to be missing any necessary library:
 https://github.com/rhuitl/uClinux/blob/master/user/netflash/sha256sum.c
 Also, if you can't use a diff utility within GRUB, parsing a text
file is a straightforward operation; so, in a sense, I have all I
need. You should be able to extract various information from the
BIOS/UEFI, even dump a binary with all of it and get its sha*sum.
 What I meant is that I will not alter GRUB2 itself, just use that
code to customize, strategize around GRUB's configuration file(s) on
the fly and/or keep various signature configuration files based on
selected machines.
 The way I am thinking about it is, if you were to sha*sum the file
and this value would be the same as a previous run, you would know
with almost total certainty that:
 a) you are booting the same machine(s you had selected, know of),
 b) its internal BIOS/UEFI data (and with it, the machine's hardware
components) haven't been changed.
 Probably, I should learn more about GRUB2 and how it relates to
Linux' run levels. Any "in-depth" and "on-hands" books or tutorials
you would recommend?
 Thank you,
 lbrtchx



reply via email to

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