Created
January 17, 2019 18:26
-
-
Save Mrigank11/c8791189e7e4692345d198f9dfb84906 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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