Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1582157 - [rfe] Ability to retarget installroot within a plugin post-resolve but before acting on transaction
Summary: [rfe] Ability to retarget installroot within a plugin post-resolve but before...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: dnf-community
TreeView+ depends on / blocked
 
Reported: 2018-05-24 12:02 UTC by Neal Gompa
Modified: 2023-08-10 12:10 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Neal Gompa 2018-05-24 12:02:16 UTC
Description of problem:
I want to make a passive plugin for DNF that auto-hooks into install/remove/upgrade/distro-sync/etc. to retarget a transaction from the running system into a writable snapshot made using Btrfs.

This technique is one of the core functions of openSUSE's transactional-update[1] tool, but it's a lot more complicated because it's orchestrating Zypper instead of hooking into it.

Ultimately, I want to write a passive plugin that kicks in after successful resolution and after the user has said yes to the transaction, but before it starts the actual transaction. In the space between user acceptance and acting on the transaction, I want to create a new writable snapshot subvolume and tell DNF to change the current proposed transaction's target from the running system to the subvolume containing the writable snapshot. This subvolume snapshot might be created by Snapper, or by hand, or with some other mechanism, but whatever the process, I'd like to only proceed after the snapshot is successfully created and the transaction has been retargeted. Then after the successful transaction, I'd create a new boot to snapshot menu entry for the old state after switching the default subvolume to boot from.

[1]: https://github.com/openSUSE/transactional-update

Version-Release number of selected component (if applicable):
2.7.5-12.fc28

Comment 1 Neal Gompa 2021-04-14 01:48:36 UTC
This actually works now in libdnf, and I've implemented the txnupd plugin as proof: https://code.opensuse.org/microos/libdnf-plugin-txnupd

I'm not sure if this is possible yet at the dnf level, though.

Comment 2 Jaroslav Mracek 2023-08-09 20:02:23 UTC
Have you tried to use action plugin in DNF5?

Comment 3 Neal Gompa 2023-08-10 12:10:23 UTC
(In reply to Jaroslav Mracek from comment #2)
> Have you tried to use action plugin in DNF5?

Not yet. It's on my todo list, though.


Note You need to log in before you can comment on or make changes to this bug.