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

transaction: Add HIF_TRANSACTION_FLAG_OSTREE_MODE #39

Conversation

cgwalters
Copy link
Collaborator

The goal of this patch is to help support rpm-ostree package layering.
The way this works is that we unpack layered packages on top of a new
hardlinked tree. However, if any packages had scriptlets that
mutate a file in place (as opposed to make-new-then-rename), that
would corrupt the object store and potentially break rollback.

It turns out that most scripts in Fedora are safe, but ultimately
the way I think this should work is that only scripts in e.g.
/usr/share/rpm/scriptlets
which are known verified safe can be run.

Anyways, if set, HIF_TRANSACTION_FLAG_OSTREE_MODE does basically two things:

  • Verifies before installing a package (while we have it open for GPG checks)
    that a package has no scripts
  • Disables all scripts in the RPM transaction

We can't just do the latter as that would allow installing packages
that didn't work (e.g. shared libraries without running ldconfig).

The goal of this patch is to help support rpm-ostree package layering.
The way this works is that we unpack layered packages on top of a new
*hardlinked* tree.  However, if any packages had scriptlets that
mutate a file in place (as opposed to make-new-then-rename), that
would corrupt the object store and potentially break rollback.

It turns out that *most* scripts in Fedora are safe, but ultimately
the way I think this should work is that only scripts in e.g.
/usr/share/rpm/scriptlets
which are known verified safe can be run.

Anyways, if set, HIF_TRANSACTION_FLAG_OSTREE_MODE does basically two things:
 - Verifies before installing a package (while we have it open for GPG checks)
   that a package has no scripts
 - Disables all scripts in the RPM transaction

We can't just do the latter as that would allow installing packages
that didn't work (e.g. shared libraries without running ldconfig).
@cgwalters
Copy link
Collaborator Author

(Updated to fix regression with GPG checking)

@cgwalters
Copy link
Collaborator Author

The intertia around the whole ecosystem is so powerful here that I've put this approach on hold, and am now planning to do coreos/rpm-ostree#107 (comment)

So let's close this for now without merging, if we decide to do it later, the code will still be here.

@cgwalters cgwalters closed this Apr 7, 2015
cgwalters added a commit to cgwalters/rpm-ostree that referenced this pull request Jun 9, 2016
This is bringing forward an old PR for libhif:
rpm-software-management/libdnf#39

Right now, we aren't running `%post` or any of the other variants.  A
lot of packages will work if we just ignore `%post`, others won't.
Let's be conservative until we start running them, and don't imply we
support things we don't yet.
cgwalters added a commit to cgwalters/rpm-ostree that referenced this pull request Jun 13, 2016
This is bringing forward an old PR for libhif:
rpm-software-management/libdnf#39

Right now, we aren't running `%post` or any of the other variants.  A
lot of packages will work if we just ignore `%post`, others won't.
Let's be conservative until we start running them, and don't imply we
support things we don't yet.
rh-atomic-bot pushed a commit to coreos/rpm-ostree that referenced this pull request Jun 14, 2016
This is bringing forward an old PR for libhif:
rpm-software-management/libdnf#39

Right now, we aren't running `%post` or any of the other variants.  A
lot of packages will work if we just ignore `%post`, others won't.
Let's be conservative until we start running them, and don't imply we
support things we don't yet.

Closes: #311
Approved by: jlebon
rh-atomic-bot pushed a commit to coreos/rpm-ostree that referenced this pull request Jun 14, 2016
This is bringing forward an old PR for libhif:
rpm-software-management/libdnf#39

Right now, we aren't running `%post` or any of the other variants.  A
lot of packages will work if we just ignore `%post`, others won't.
Let's be conservative until we start running them, and don't imply we
support things we don't yet.

Closes: #311
Approved by: jlebon
rh-atomic-bot pushed a commit to coreos/rpm-ostree that referenced this pull request Jun 14, 2016
This is bringing forward an old PR for libhif:
rpm-software-management/libdnf#39

Right now, we aren't running `%post` or any of the other variants.  A
lot of packages will work if we just ignore `%post`, others won't.
Let's be conservative until we start running them, and don't imply we
support things we don't yet.

Closes: #311
Approved by: jlebon
rh-atomic-bot pushed a commit to coreos/rpm-ostree that referenced this pull request Jun 15, 2016
This is bringing forward an old PR for libhif:
rpm-software-management/libdnf#39

Right now, we aren't running `%post` or any of the other variants.  A
lot of packages will work if we just ignore `%post`, others won't.
Let's be conservative until we start running them, and don't imply we
support things we don't yet.

Closes: #311
Approved by: jlebon
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