Make 'grub-mkconfig' command name configurable #56
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I noticed that
grub-btrfs.service
was usinggrub2-mkconfig
which is not available on my system (Manjaro), so I've rewritten the service to allow the command name to be a configuration option. I've setgrub-mkconfig
as the default, since that's the command name that I've encountered most often in recent years, but I'm happy to change it if you would like.I found the pair of commands used in
grub-btrfs.service
quite unclear, and on the first run (or whenevergrub-btrfs.cfg
doesn't exist), both commands would be run and the configuration would be regenerated twice. To resolve this, I've combined the commands into a singleif... else...
statement.I've also updated
10-update_grub.conf
to use the configurable grub directory name and to use the improved command fromgrub-btrfs.service
.As a side note, I'm not sure how useful it is to retain
10-update_grub.conf
given that the newgrub-btrfs.*
services provide a more general solution. The former works only when the systemd services are used, while the latter works for systemd, cron, and manual snapshots.