Updated readme to take openRC daemon into consideration

This commit is contained in:
Pascal Jäger
2021-10-24 15:47:45 +02:00
committed by Antynea
parent 75e6408510
commit 7dc240faa7

View File

@@ -107,14 +107,20 @@ use `systemctl list-units -t mount`.
* You can view your change to `systemctl cat grub-btrfs.path`.
* To revert change use `systemctl revert grub-btrfs.path`.
2. If you would like grub-btrfs menu to automatically update on system restart/shutdown:
2. If you would like grub-btrfs menu to automatically update on system restart/ shutdown:
[Look at this comment](https://github.com/Antynea/grub-btrfs/issues/138#issuecomment-766918328)
Currently not implemented
##
#### OpenRC
* There is sadly no similar solution to the systemd service yet.
As a workaround it is possible to add a script to `/etc/local.d` to execute the snapshot menu update every time you shut down your system.
To do so just add the following script as `/etc/local.d/grub-btrfs-update.stop`
1. If you would like grub-btrfs menu to automatically update when a snapshot is created or deleted:
* Use `rc-config add grub-btrfsd default`, to start the grub-btrfsd daemon the next time the system boots.
* To start `grub-btrfsd` right now, run `rc-service grub-btrfsd start`
* `grub-btrfsd` automatically watches the snapshot directory of timeshift (/run/timeshift/backup/timeshift-btrfs/snapshots)
and updates the grub-menu when a change occurs.
* Currently untested for snapper
2. If you would like grub-btrfs menu to automatically update on system restart/ shutdown:
Just add the following script as `/etc/local.d/grub-btrfs-update.stop`
```
#!/bin/bash
@@ -129,7 +135,9 @@ To do so just add the following script as `/etc/local.d/grub-btrfs-update.stop`
bash -c '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'
```
If you want to run the menu update on startup instead, rename the file to `grub-btrfs-update.start`
* The extension ".stop" at the end of the filename indicates to locald that this script should be run at shutdown.
If you want to run the menu update on startup instead, rename the file to `grub-btrfs-update.start`
* Works for snapper and timeshift
##### Warning :
by default, `grub-mkconfig` command is used.