aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authoreoli3n2020-05-12 16:09:16 +0200
committereoli3n2020-05-12 16:09:16 +0200
commitd93da3ffee832f2e4efbc877af725ad5507d1c1f (patch)
treeb83735ae5db2a95646f269a7ff9a7b42c87c71c2
parentc4cbef66249894d6e04ea350570648a014a61929 (diff)
downloadaur-d93da3ffee832f2e4efbc877af725ad5507d1c1f.tar.gz
trigger only on kernel upgrades
-rw-r--r--.SRCINFO6
-rw-r--r--10-zectl-pre.hook5
-rw-r--r--PKGBUILD6
-rw-r--r--README.md29
4 files changed, 24 insertions, 22 deletions
diff --git a/.SRCINFO b/.SRCINFO
index c3d574aa60bb..36c9851fdb58 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = zectl-pacman-hook
- pkgdesc = Automate boot environment creation and rotation before pacman upgrade
- pkgver = 0.1.1
+ pkgdesc = Automate boot environment creation and rotation before kernel upgrade
+ pkgver = 0.1.2
pkgrel = 1
url = https://github.com/eoli3n/zectl-pacman-hook
install = INSTALL
@@ -10,7 +10,7 @@ pkgbase = zectl-pacman-hook
source = 10-zectl-pre.hook
source = zectl-prune
source = UNLICENSE
- sha256sums = de9a144e6cda1911395b6491f2e83af0089a72e9eab92199d489b29919d76c2f
+ sha256sums = 9e212d633cb87ac2789ece3c5a86db6a93f266327db8a360e882dfd9583ac0c9
sha256sums = b38b0b2fca33ce64d5c1e713feb3bd7d3a0e85fa8d5c4c5220edefc2a63440da
sha256sums = d3c4f1607c9488b22732511b83e6f6173d82499c0678c899666ca12c36517f72
diff --git a/10-zectl-pre.hook b/10-zectl-pre.hook
index 4bbacd46487f..58553f1417f0 100644
--- a/10-zectl-pre.hook
+++ b/10-zectl-pre.hook
@@ -1,7 +1,8 @@
[Trigger]
+Operation = Install
Operation = Upgrade
-Type = Package
-Target = *
+Type = File
+Target = usr/lib/modules/*/vmlinuz
[Action]
Description = Create a boot environment
diff --git a/PKGBUILD b/PKGBUILD
index 00982b85b5e2..f537bc09a242 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,8 +2,8 @@
# Info: https://github.com/johnramsden/zectl/issues/16
pkgname=zectl-pacman-hook
pkgrel=1
-pkgver=0.1.1
-pkgdesc="Automate boot environment creation and rotation before pacman upgrade"
+pkgver=0.1.2
+pkgdesc="Automate boot environment creation and rotation before kernel upgrade"
arch=('any')
url="https://github.com/eoli3n/$pkgname"
license=('UNLICENSE')
@@ -12,7 +12,7 @@ install="INSTALL"
source=("10-zectl-pre.hook"
"zectl-prune"
"UNLICENSE")
-sha256sums=("cc2d2f335bb2b636ed7b873be5f5fb8456f0cbfc877cd4b05f8b08dd7b4f9f53"
+sha256sums=("9e212d633cb87ac2789ece3c5a86db6a93f266327db8a360e882dfd9583ac0c9"
"b38b0b2fca33ce64d5c1e713feb3bd7d3a0e85fa8d5c4c5220edefc2a63440da"
"d3c4f1607c9488b22732511b83e6f6173d82499c0678c899666ca12c36517f72")
diff --git a/README.md b/README.md
index f88f58310571..5329302166d0 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
### zectl-pacman-hook
-It will create a boot environment prefixed with ``pacmanhook`` with ``zectl`` at each pacman upgrade. By default, it keeps only 1 boot environment, each pacman upgrade will overwrite previous boot environment.
+It will create a boot environment prefixed with ``pacmanhook`` with ``zectl`` before each kernel upgrade. By default, it keeps only 1 boot environment, each kernel upgrade will overwrite previous boot environment.
```bash
$ sudo pacman -Syu
@@ -8,29 +8,33 @@ $ sudo pacman -Syu
core is up to date
extra is up to date
community is up to date
- archzfs is up to date multilib is up to date
+ archzfs is up to date
+ multilib is up to date
:: Starting full system upgrade...
resolving dependencies...
looking for conflicting packages...
-Packages (1) bat-0.15.0-1
+Packages (1) linux-lts-5.4.39-1
-Total Installed Size: 4.57 MiB
-Net Upgrade Size: 0.09 MiB
-:: Proceed with installation? [Y/n]
+Total Installed Size: 73.34 MiB
+Net Upgrade Size: -0.01 MiB
+
+:: Proceed with installation? [Y/n] Y
(1/1) checking keys in keyring [------------------------] 100%
(1/1) checking package integrity [------------------------] 100%
(1/1) loading package files [------------------------] 100%
(1/1) checking for file conflicts [------------------------] 100%
(1/1) checking available disk space [------------------------] 100%
:: Running pre-transaction hooks...
-(1/1) Create a boot environment
-• Destroyed pacmanhook-20200411T121502
-• Created pacmanhook-20200511T193646
+(1/3) Create a boot environment
+• Destroyed pacmanhook-20200512T154713
+• Created pacmanhook-20200512T154826
+(2/3) Removing linux initcpios...
+(3/3) Remove DKMS modules
:: Processing package changes...
-(1/1) upgrading bat [------------------------] 100%
+(1/1) upgrading linux-lts [------------------------] 100%
:: Running post-transaction hooks...
-(1/1) Arming ConditionNeedsUpdate...
+...
```
### Installation
@@ -52,9 +56,6 @@ efi_size=$(df /efi --output=avail | sed '1d')
echo "$efi_size / $boot_size" | bc
```
-We discuss about increasing max number of boot envs here:
-https://github.com/johnramsden/zectl/issues/19
-
To disable the hook, use:
```
zectl set pacmanhook="no"