Created
May 23, 2018 01:08
-
-
Save brettp/c41758c9617c1f113cff92462b0f3c08 to your computer and use it in GitHub Desktop.
Grub config to allow load overrides from /grub_extra.cfg if present
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Searches all drives for a file named grub_extra.cfg in the root dir | |
# and includes it after all other config files. | |
# Can be used to force override any variables | |
# Example /grub_extra.cfg: | |
# set default=1 | |
cat <<EOF | |
search --file --set extra_cfg_dev /grub_extra.cfg | |
if [ "\${extra_cfg_dev}" ]; then | |
set extra_cfg_file="(\${extra_cfg_dev})/grub_extra.cfg" | |
echo "Including \${extra_cfg_file}" | |
source "\${extra_cfg_file}" | |
echo "Default is now \${default}" | |
fi | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment