blob: 127f880bbfcbcd16330acf77c85d72b47d10d250 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
Partially backport 0f933eb5966848d96477b5148e40ac1c3e750e22 for distro-agnostic
detection of grub-btrfs snapshot functionality.
Author: Lucio Sauer <watermanpaint@posteo.net>
--- a/timeshift-autosnap
+++ b/timeshift-autosnap
@@ -53,8 +53,12 @@ if $(get_property "deleteSnapshots" "boolean" "true") ; then
fi
fi;
-if $(get_property "updateGrub" "boolean" "true") && [ "$(pacman -Qs ^grub-btrfs$)" ]; then
- grub-mkconfig -o /boot/grub/grub.cfg
-fi;
-
+if $(get_property "updateGrub" "boolean" "true") && [ -f /etc/grub.d/41_snapshots-btrfs ]; then
+ . /etc/default/grub-btrfs/config
+ 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
exit 0
|