mirror of
https://github.com/Antynea/grub-btrfs.git
synced 2026-03-04 13:05:00 +08:00
* Make 'grub-mkconfig' command name configurable - Use 'grub-mkconfig' as the default - Note that some systems use 'grub2-mkconfig' - Update 10-update_grub.conf to use the configurable grub directory name - Refactor the systemd commands for clarity and to avoid duplicate regeneration on first run * Update check_uuid_required() to work for partial regeneration of the GRUB menu
12 lines
608 B
Desktop File
Executable File
12 lines
608 B
Desktop File
Executable File
[Unit]
|
|
Description=Regenerate grub-btrfs.cfg
|
|
|
|
[Service]
|
|
Type=oneshot
|
|
# Set the possible paths for `grub-mkconfig`
|
|
Environment="PATH=/sbin:/bin:/usr/sbin:/usr/bin"
|
|
# Load environment variables from the configuration
|
|
EnvironmentFile=/etc/grub.d/41_snapshots-btrfs_config
|
|
# Regenerate just '/boot/grub/grub-btrfs.cfg' if it exists and is not empty, else regenerate the whole grub menu
|
|
ExecStart=/bin/bash -c 'if [ -s "/boot/${GRUB_BTRFS_DIRNAME:-grub}/grub-btrfs.cfg" ]; then /etc/grub.d/41_snapshots-btrfs; else ${GRUB_BTRFS_MKCONFIG:-/usr/bin/grub-mkconfig} -o /boot/${GRUB_BTRFS_DIRNAME:-grub}/grub.cfg; fi'
|