[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: |
Thu, 16 Apr 2020 15:12:41 +0000 |
Hi Daniel,
> > grub> help version
> > Usage: version [OPTIONS]
> >
> > Print GRUB or GRUB+OEM version.
> > If --set is specified, the version is assigned to variable.
> >
> > -s, --set=VARNAME Assign return value to variable VARNAME.
> > -o, --oem Add OEM version.
> > -h, --help Display this help and exit.
> > -u, --usage Display the usage of this command and exit.
> > grub>
>
> Do we really need a module for that? I do not think so. I would prefer
> if the GRUB sets a number of variables immediately after load. Please
> take a look at grub_cpu or grub_platform variables currently available
> in the GRUB. They are good examples. Going that way we should have, e.g.
> grub_ver variable. Additionally, I would add for convenience grub_major,
> grub_minor, grub_commit and grub_oem. So, let's assume that we have 2.06
> version. Then grub_major should be "2" and grub_minor "06". grub_commit
> and grub_oem should not exists. If we have 2.06.d5a32255d then
> grub_major should be "2", grub_minor "06" and grub_commit "d5a32255d".
> grub_oem should not exists. If we have 2.06.d5a32255d_1.0.0, then ...
> and grub_oem should be "1.0.0". There should not be any requirement to
> have grub_commit nor grub_oem. So, e.g. 2.06_1.0.0 would be a valid
> version too.
>
> grub_commit and grub_oem should be enabled at ./configure call. By
> default grub_major and grub_minor should be set only. I think that
> AC_DEFINE() autoconf macro could be useful for you.
>
> Last but not, version displayed at the GRUB load have to be consistent
> with what is set in the variables.
Good idea, I like your suggestion!
Thank you!
Flavio