-
Notifications
You must be signed in to change notification settings - Fork 155
Add alongside-cleanup systemd service #1289
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
Conversation
755931d to
fef5861
Compare
fef5861 to
bac58ec
Compare
8fecfee to
3595ed1
Compare
3595ed1 to
2199529
Compare
cgwalters
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this, looking sane to me so far!
| mount -o remount,rw /sysroot | ||
| rpm -qa --root=/sysroot --dbpath=/usr/lib/sysimage/rpm | xargs rpm -e --root=/sysroot --dbpath=/usr/lib/sysimage/rpm | ||
|
|
||
| mount --bind -o rw /sysroot/var/lib/containers /var/lib/containers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I guess conceptually since podman is OS independent in theory this could be a shared fragment, but let's not overengineer now, just noting.
Makefile
Outdated
| # Install bootc-destructive-cleanup in fedora derivatives | ||
| @ID=$$(grep '^ID=' /usr/lib/os-release | cut -d'=' -f2 | tr -d '"'); \ | ||
| ID_LIKE=$$(grep '^ID_LIKE=' /usr/lib/os-release | cut -d'=' -f2 | tr -d '"'); \ | ||
| if [ "$$ID" = "fedora" ] || [ "$$ID_LIKE" = "fedora" ]; then \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ID_LIKE needs to be a substring match
$ podman run --rm quay.io/centos-bootc/centos-bootc:stream10 grep ID_LIKE /usr/lib/os-release
ID_LIKE="rhel fedora"
$
Maybe we can factor out a lib/install.sh or something?
2199529 to
738d5c6
Compare
a079b37 to
80a4660
Compare
|
Hmm, something is still leaking in the install tests. This test passed on other PRs. I'm not seeing the bug though. |
80a4660 to
3526b87
Compare
When set, the bootc-destructive-cleanup flag is added to /sysroot/etc which enables the bootc-destructive-cleanup systemd service to remove the previous installation's rpm packages and podman containers/images. The service is only installed on fedora based systems. Signed-off-by: ckyrouac <[email protected]>
Signed-off-by: ckyrouac <[email protected]>
3526b87 to
b6300d8
Compare
cgwalters
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK this version is even simpler! Nice work.
Just thinking about testing...right now we don't quite have a suite that would cover this flow, though we should. But, something for this could go in https://gitlab.com/fedora/bootc/tests/bootc-workflow-test/ probably too.
Hm, I guess really this is just about an e2e test for s-r-b really, since we added this cleanup option by default there.
| .await?; | ||
|
|
||
| if matches!(cleanup, Cleanup::TriggerOnNextBoot) { | ||
| let sysroot_dir = crate::utils::sysroot_dir(&sysroot)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine as is, really. It's just interesting to note that it's equivalent to rootfs.physical_root and I think that one's clearer. would probably make sense to try to port more things to it.
This will remove all rpms and containers/images from the previous install (found in /sysroot) on reboot after running
install to-existing-root.WIP: using this PR to test the rpm build