Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#backup.hook
[Trigger]
Operation = Upgrade
Operation = Remove
Type = Package
Target = linux
[Action]
Depends = coreutils
Depends = bash
When = PreTransaction
Exec = /usr/bin/bash -c 'mkdir /tmp/workdir && mkdir /tmp/kernel_backup && cp -r /usr/lib/modules/$(uname -r) /tmp/kernel_backup/'
#restore.hook
[Trigger]
Operation = Upgrade
Operation = Remove
Type = Package
Target = linux
[Action]
Depends = coreutils
Depends = bash
When = PostTransaction
Exec = /usr/bin/bash -c 'mount -t overlay overlay -o upperdir=/tmp/kernel_backup,lowerdir=/usr/lib/modules,workdir=/tmp/workdir /usr/lib/modules'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.