Initial commit
This commit is contained in:
commit
6037c3b930
12 changed files with 560 additions and 0 deletions
11
grub-btrfs-snapper.service
Normal file
11
grub-btrfs-snapper.service
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
[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/default/grub-btrfs/config
|
||||
# If we aren't booted off a snapshot, regenerate just '/boot/grub/grub-btrfs.cfg' if it exists and is not empty, else regenerate the whole grub menu
|
||||
ExecStart=bash -c 'if [[ -z $(/usr/bin/findmnt -n / | /usr/bin/grep --fixed-strings ".snapshots") ]]; then if [ -s "${GRUB_BTRFS_GRUB_DIRNAME:-/boot/grub}/grub-btrfs.cfg" ]; then /etc/grub.d/41_snapshots-btrfs; else ${GRUB_BTRFS_MKCONFIG:-grub-mkconfig} -o ${GRUB_BTRFS_GRUB_DIRNAME:-/boot/grub}/grub.cfg; fi; fi'
|
||||
Loading…
Add table
Add a link
Reference in a new issue