When a snapshot is created with `timeshift --create` an the commandline,
sometimes the daemon is not fast enough between the
first (/run/timeshift) inotifywait and the second (an the actual
snapshot directory) inotifywait. Even without any `sleep` between them.
So now the grub (sub)menu is always created once in its own process when the daemon sees a
timeshift startup.
Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
If root FS is on volume not supported by GRUB2 - `update-grub` silently fails because `snapshots-btrfs` GRUB hook
silently fails at `root_fs=$(${grub_probe} --target="fs" /)` due to `set -e` at the beginning of `snapshots-btrfs`.
Failure of commands in test clause in Bash does not trigger set -v error and can be handled in script to
exit gracefully - implement this.
Fixes https://github.com/Antynea/grub-btrfs/issues/222
This allows users to customize the snapshots path to work with, e.g., snapper.
If no path is configured, it will default to timeshift.
Signed-off-by: David P <megver83@parabola.nu>
* Make path of "grub-mkconfig_lib" configurable
* 41_snapshots-btrfs file:
- Remove "datarootdir" variable, is no longer used
- Replace "$datarootdir/grub/grub-mkconfig_lib" with "${GRUB_BTRFS_MKCONFIG_LIB:-/usr/share/grub/grub-mkconfig_lib}"
* Config file:
- Adds new GRUB_BTRFS_MKCONFIG_LIB variable
Might be '/usr/share/grub2/grub-mkconfig_lib' on some systems (Opensuse ...)
41_snapshots-btrfs file:
* Remove "grub_script_check" variable
Config file;
* Make name of "grub-script-check" configurable
* Might be 'grub2-script-check' on some systems (Fedora ...)
#### Script:
* Snapper:
- Now, the information is retrieved from the info.xml file.
* Timeshift:
* Now, the information is retrieved from the info.json file.
* Probe informations from device:
* Add the UUID of the root and boot subvolumes
* Show full path snapshot or only name:
* Remove, this feature never worked correctly
* Grub-menu:
* Now displays the following information in separate columns:
- Date of snapshot
- Path of snapshot
- Type/Tags of snapshot if available (snapper/timeshift)
- Description/Comments of snapshot if available (snapper/timeshift)
* Possibility to display only the desired information(s) (see config file)
* Adds a header for the column title
* GRUB_BTRFS_PREFIXENTRY is remove
* Boot partition detection:
* grub-btrfs is now able to detect if the boot folder/partition is a subvolume
* GRUB_BTRFS_OVERRIDE_BOOT_PARTITION_DETECTION should no longer be needed for this case
* Variables:
* Rename some variables
* Header:
* Update the header to reflect the changes.
#### Config:
* GRUB_BTRFS_PREFIXENTRY:
* Remove, no longer use
* GRUB_BTRFS_DISPLAY_PATH_SNAPSHOT:
* Remove, no longer use
* GRUB_BTRFS_TITLE_FORMAT:
* Shows/Hides "date" "snapshot" "type" "description" in the Grub menu, custom order available.
Default: ("date" "snapshot" "type" "description")
* GRUB_BTRFS_IGNORE_SNAPPER_TYPE:
* Rename to GRUB_BTRFS_IGNORE_SNAPSHOT_TYPE
- Supports both timeshift and snapper tags/type
* GRUB_BTRFS_IGNORE_SNAPPER_DESCRIPTION:
* Rename to GRUB_BTRFS_IGNORE_SNAPSHOT_DESCRIPTION
- Supports both snapper and timeshift description/comments
* GRUB_BTRFS_OVERRIDE_BOOT_PARTITION_DETECTION:
* grub-btrfs is now able to detect if the boot folder/partition is a subvolume.
Activating this parameter should no longer be necessary for this case.
* GRUB_BTRFS_SNAPPER_CONFIG:
* Remove, no longer use
#### Readme:
* Update "What does grub-btrfs v4.xx do" section
* Adds support for timeshift
* Update "GRUB_BTRFS_DISABLE_PROTECTION_SUBMENU":
* Remove default parameter (false), not needed
* adds automatic conversion of the value to lower case