[Top][All Lists]

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

Re: in grub.cfg: how to initialze a variable from the contents of a file

From: Dr. Zimmermann
Subject: Re: in grub.cfg: how to initialze a variable from the contents of a file
Date: Tue, 4 Oct 2011 14:36:59 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1

Am 01.10.2011 23:52, schrieb Jordan Uggla:
On Thu, Sep 29, 2011 at 3:44 AM, Dr. Zimmermann
<address@hidden>  wrote:

a general question concerning variable initialization in grub.cfg:

As the subject says I'd like to initialize a variable in grub.cfg
(dynamically during runtime) from the contents of a file.

> What is your end goal? The easiest way to initialize a variable from a

Our SW is started from an USB stick by grub (several options, different versions). Since it gets updated frequently, it would be helpful to display the contents of its VERSION file directly within the startmenu of grub.

file is to have that file be a source-able grub script, for instance a
file containing only 'my_variable=foo' could be loaded by grub using
'source /path/to/file.cfg' and after sourcing the file $my_variable
would be initialized to 'foo'.

Of course we can hardcode version info into a source file (or even into grub.cfg itself...). Seen from code reliability and maintainability, an optimal solution would be one were third-party software (our SW updater) doesn't meddles with grub configuration files. Therefore we're looking for the above mentioned way of variable initialization.

Regards, Roger

Pflichtangaben gemäß Gesetz über elektronische Handelsregister und 
Genossenschaftsregister sowie das Unternehmensregister (EHUG):

Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; 
Gerichtsstand: Hamburg

Vorstandsmitglieder: Prof. Dr. Guido Sauter (Vertreter des Vorsitzenden), Dr. Alexander Kirstein, Joachim Prölß, Prof. Dr. Dr. Uwe Koch-Gromus

reply via email to

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