Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for systems with /boot outside the @-subvolume #6

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

zapp-brannigan
Copy link

Thanks for this nice tool.
If you have an encrypted system your /boot is usually not part of the root-partition.
I`ve made a small patch which resets the boot-partition alongside with the @-subvolume.
It aussumes that you use the pacman-hook suggested in https://wiki.archlinux.org/title/System_backup#Snapshots_and_/boot_partition

@bkmo
Copy link

bkmo commented May 20, 2024

I have patched this PR in my Arch PKGbuild and it seems to work fine. But not with the current pacman hook suggested in the wiki. There used to be a single hook listed, now it is for pre- and post-
This example works fine:

[Trigger]
Type = Package
Operation = Install
Operation = Upgrade
Operation = Remove
Target = systemd

[Trigger]
Type = Path
Operation = Install
Operation = Upgrade
Target = boot/vmlinuz-*
Target = usr/lib/modules/*/vmlinuz
Target = usr/lib/initcpio/*

[Action]
Description = Backing up /boot...
When = PostTransaction
Exec = /usr/bin/bash -c '/usr/bin/rsync -arq --mkpath --delete /boot/ /.bootbackup/boot'
Depends = rsync

@bkmo
Copy link

bkmo commented Jun 24, 2024

This works well, but one problem I see is that it relies on the conf. only for restoring /boot. If external_boot is true, and there is no backup in the snapshot, /boot will be removed and not replaced because of the missing backup in the snapshot. Maybe there should be a test so this does not happen? Just removing the rm -rf and replacing cp with rsync -aq --delete should do the trick and not wipe out the current /boot if there is nothing to cp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants