aboutsummarylogtreecommitdiffstats
path: root/10-linux-modules-pre.hook
blob: 04410a35a0d2ce2257aa09bee7526f5e6769d1ec (plain)
1
2
3
4
5
6
7
8
9
10
[Trigger]
Operation = Install
Operation = Upgrade
Type = Path
Target = usr/lib/modules/*/vmlinuz

[Action]
Description = Saving Linux kernel modules...
When = PreTransaction
Exec = /bin/sh -xc 'KVER="${KVER:-$(uname -r)}"; if test -d "/usr/lib/modules/${KVER}"; then mkdir -p /usr/lib/modules/backup ; cp -an --reflink=auto "/usr/lib/modules/${KVER}" /usr/lib/modules/backup/; fi'