From 23ddb063cb48b937cc68fbaf0c85990443f6b934 Mon Sep 17 00:00:00 2001 From: Nathan Parsons Date: Sat, 3 Feb 2018 20:50:40 +0000 Subject: [PATCH] Add systemd service configuration for grub updating (#38) * Add systemd service configuration for grub updating This configuration file causes `update-grub` to be run after Snapper's cleanup and timeline services are run by systemd * Make invoked command more universal * Note the need to run systemctl daemon-reload --- 10-update_grub.conf | 2 ++ README.md | 9 +++++++++ 2 files changed, 11 insertions(+) create mode 100644 10-update_grub.conf diff --git a/10-update_grub.conf b/10-update_grub.conf new file mode 100644 index 0000000..84a506c --- /dev/null +++ b/10-update_grub.conf @@ -0,0 +1,2 @@ +[Service] +ExecStartPost=/usr/sbin/grub-mkconfig -o /boot/grub/grub.cfg diff --git a/README.md b/README.md index 4c452cd..9f952e7 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,15 @@ Generate grub.cfg (on Arch linux use grub-mkconfig -o /boot/grub/grub.cfg ) grub-btrfs automatically generates snapshots entries. You will see it appear differents entries (e.g : Snapshot: 2018-01-03 15:08:41 @test1 ) +## +### Automatically update grub + +If you would like grub to automatically update when Snapper timeline snapshots and cleanups occur, simply install `10-update_grub.conf` in the following locations: + +- `/etc/systemd/system/snapper-timeline.service.d/` +- `/etc/systemd/system/snapper-cleanup.service.d/` + +Once the configuration files are in place, `systemctl daemon-reload` should be run to reload the units and make the changes active. ## ### Discussion