grub-devel
[Top][All Lists]
Advanced

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

RE: [PATCH v2] version: add a module to get GRUB version


From: Flavio Suligoi
Subject: RE: [PATCH v2] version: add a module to get GRUB version
Date: Wed, 15 Apr 2020 14:26:08 +0000

Hi Len,
 
> On Wed, Apr 15, 2020 at 02:04:36PM +0200, Flavio Suligoi wrote:
> > Sometimes, writing a custom grub.cfg configuration file,
> > especially with embedded systems, it is indispensable
> > to know the version of the running GRUB.
> > This is essential for every automatic sw update procedure.
> 
> You can't actually assume that the grub binary on the running system is
> the same version as the one currently booting the system.  It probably
> tends to be if the distribution takes care to auto upgrade it when a
> new grub is installed, but it doesn't always happen.
> 
> Of course in the case of a distribution, it's package management would
> already have that information.

Our embedded distro doesn't have any package manager,
we update the whole rootfs.
We use swupdate and the storage has a redundant rootfs,
with rootfs-A and rootfs-B.

> I am not saying adding this is a bad idea, I just don't believe it does
> anything useful.  I just believe it is trying to solve a problem that
> doesn't actually exist.

We use swupdate to update both the rootfs and grub.

So, at every boot, the grub.cfg script, before running the kernel,
saves the grub version in an environment variable.

Then, after the boot, the update application, using the swupdate
command "fw_printenv", reads the version and then decides
about the grub updating.

For this reason, the "version" command is so essential
in our application.

Flavio




reply via email to

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