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.