Closed wesbarnett closed 5 years ago
cf. #22
This hook has the same behavior as what has been removed from the main script.
[Trigger]
Operation = Upgrade
Operation = Install
Operation = Remove
Type = Package
Target = linux
[Action]
Description = Symlinking old kernel modules...
When = PostTransaction
Exec = /usr/bin/bash -c "find /usr/lib/modules -xtype l -delete; ln -sv /.snapshots/$(snapper -c root list -t pre-post | awk 'END{print $1}')/snapshot/usr/lib/modules/$(uname -r) /usr/lib/modules/"
You could ad this as well.
Systemd unit "delete-old-kernel-module-link.service"
[Unit]
Description=Delete old Kernel module link(s) created by snap-pac
[Service]
ExecStart=/usr/bin/bash -c "find /usr/lib/modules -maxdepth 1 -type l -delete"
[Install]
WantedBy=default.target
This deletes the link of the old kernel during boot.
The snapper command of the pacman hook should be changed to snapper -c root list | awk 'END{print $3}'
or you should explicitly mention that the hook needs to be named zzz-XYZ.hook
to force the execution after the zy_snapper-post hook.
snapper -c root list -t pre-post
only lists the last pre-post snapshots. If you only have a pre snapshot (if the hook is executed before the post snapshot was created), it won't be displayed with this command. The pre snapshot of the last existing pre-post snapshots will be used instead.
I removed this functionality on the master branch due to all of the issues it brings. We should at least add something to show users how to add it back.