help-grub
[Top][All Lists]
Advanced

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

Re: Locating a configuration file (*.cfg)


From: Arbiel (gmx)
Subject: Re: Locating a configuration file (*.cfg)
Date: Fri, 6 Nov 2015 22:25:08 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0


Le 30/10/2015 16:25, Andrei Borzenkov a écrit :
> 30.10.2015 15:37, Arbiel (gmx) пишет:
>
>>>> 3) To complement this grub script, I want to write a bash script to
>>>> set
>>>> a environment variable which the grub script has to reset. grub
>>>> seems to
>>>> not support save_env to a grubenv file located on a logical volume. Is
>>>> it possible to replace the load_env and a save_env commands by
>>>> identically named functions which would use these 2 commands with
>>>> the -f
>>>> parameter (and doing so, would allow for the correct operation of
>>>> recordfail) ?
>>>>
>>> There is no support for writing on top of diskfilter devices - LVM,
>>> Linux MD etc. It may be possible to implement limited support for
>>> linear and RAID0 type of storage. Anything else is too complicated to
>>> warrant doing it. I would be happy if someone could suggest
>>> implementation that allowed environment block to be located anywhere,
>>> not only as file on a filesystem. openSUSE does something similar for
>>> btrfs as special case.
My suggestion would be : not really anywhere, but in core.img. I
understand this would increase core.img's size by one block, which could
be a major drawback for older system. So, the inclusion of the
environment block into core.img should be controlled by a
"--grubenv-incore" parameter in grub-install. And this parameter could
also be discarted if there is not enough available room.
grub's load_env and save_env commands, linux grub-install and
grub-editenv commands should be the only ones to be modified.
If this suggestion fits you, I'm sure you will find a way to assume
compatibility with the current situation.


>> My question was maybe not clear enough. I meant in "to replace
>> load_env …"
>> writing in my script sort of an alias to overwrite the commands.
>>
>
> Can you "replace write system call" to write to a file system that is
> mounted read-only?
I do not understand your question. I was refering to something similar
to the bash "builtin" builtin. Bash manual reads :

          builtin [shell-builtin [args]]

Run a shell builtin, passing it args, and return its exit status. This
is useful when defining a shell function with the same name as a shell
builtin, retaining the functionality of the builtin within the function.
The return status is non-zero if shell-builtin is not a shell builtin
command.



Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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