Attached is the source for a program that's functionally equivalent to grub-set-default. I call it set-refind-default and it sets the PreviousBoot NVRAM variable to point to a given loader and volume. Here's its usage output:
Usage: /home/buus/usr/bin/set-refind-default --loader=<loader> --volume=<volume-id> [--test=<file>|--force]
Set rEFInd's NVRAM variable specifying default boot loader
or: /home/buus/usr/bin/set-refind-default --save <file>
Save rEFInd's NVRAM variable to file
Argument descriptions:
-l, --loader <loader> Specifies the filename of the boot loader.
-v, --volume <volume-id> Specifies the volume containing the boot loader
See http://www.rodsbooks.com/refind/configfile.html
Table 2 for more complete definitions.
-t, --test <file> Don't write to NVRAM, write to file.
-f, --force Set variable, even if it doesn't exist.
-s, --save <file> Save variable's value to file without changing it.
I wrote it to fill a need I saw in maintaining my own computers. See this discussion topic for details: Where does rEFInd store the default boot loader?[c76fee70]
set-refind-default depends on a relatively new library, libefivar, which is part of the efivar project found here: https://github.com/rhinstaller/efivar
The library is used by more recent versions of efibootmgr. For example, if you have installed efibootmgr on debian 8 jessie or ubuntu 14.10 utopic, you also installed libefivar. On debian flavors, you will need to install the libefivar-dev package to compile and link set-refind-default.
Since the owner of the efivar project on github is rhinstaller, AKA the "Red Hat Installer Engineering Team", I'm sure users of RedHat flavors of linux will also find the library is available to them. If not, you can download the source from github and build it.
Attached is the source for a program that's functionally equivalent to grub-set-default. I call it
set-refind-default
and it sets the PreviousBoot NVRAM variable to point to a given loader and volume. Here's its usage output:I wrote it to fill a need I saw in maintaining my own computers. See this discussion topic for details:
Where does rEFInd store the default boot loader? [c76fee70]
set-refind-default
depends on a relatively new library, libefivar, which is part of the efivar project found here:https://github.com/rhinstaller/efivar
The library is used by more recent versions of efibootmgr. For example, if you have installed efibootmgr on debian 8 jessie or ubuntu 14.10 utopic, you also installed libefivar. On debian flavors, you will need to install the libefivar-dev package to compile and link
set-refind-default
.Since the owner of the efivar project on github is rhinstaller, AKA the "Red Hat Installer Engineering Team", I'm sure users of RedHat flavors of linux will also find the library is available to them. If not, you can download the source from github and build it.
Hope others find it useful,
Helen
Related
Discussion: c76fee70
Last edit: faginbagin 2015-08-05