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

Move rpmdb path from /usr/share/rpm to /usr/lib/sysimage/rpm #639

Open
Conan-Kudo opened this issue Sep 30, 2020 · 14 comments
Open

Move rpmdb path from /usr/share/rpm to /usr/lib/sysimage/rpm #639

Conan-Kudo opened this issue Sep 30, 2020 · 14 comments

Comments

@Conan-Kudo
Copy link

It's been almost three years since the initial agreement to have a consistent alternative rpmdb path in /usr/lib/sysimage/rpm.

Can we finally move Fedora CoreOS to this path?

(Cloned from coreos/rpm-ostree#1987 at request of @dustymabe)

@Conan-Kudo Conan-Kudo changed the title Moving the rpmdb to /usr/lib/sysimage/rpm Move rpmdb path from /usr/share/rpm to /usr/lib/sysimage/rpm Sep 30, 2020
@dustymabe dustymabe added the meeting topics for meetings label Sep 30, 2020
@cgwalters
Copy link
Member

A good bit of the question here hinges on whether we can do this sanely without patching rpm and libsolv. See e.g. openSUSE/libsolv#386
But I think we should be able to explicitly tell libsolv and librpm the path - there's a probable libdnf bug in here last I looked in that it didn't make this configurable.

I think we could lead with FCOS here but it's not an entirely trivial thing to just carry on our own. I'd also e.g. like to switch the container image at least to do this too.

@cgwalters
Copy link
Member

If we need to do this by having rpm-ostree explicitly set the path in a bunch of places, it becomes dramatically more fragile.
If instead rpm/libsolv know to try /usr/lib/sysimage/rpm if it exists, things are much more likely to "just work".

Need to consider cases like rebases, as well as the "offline inspection" case. See https://bugzilla.redhat.com/show_bug.cgi?id=1102241 for the latter - which is another one that the sqlite switch will impact too.

@Conan-Kudo
Copy link
Author

Conan-Kudo commented Sep 30, 2020

Don't you already do this to force /usr/share/rpm anyway? That said, I'm open to the idea of a global System-Wide Change in Fedora to that path if you want to go down that road.

@cgwalters
Copy link
Member

Let's flip this around: Last time this came up we landed coreos/rpm-ostree#2154 - is there an urgent need to have CoreOS make that symlink canonical today versus just landing the system-wide change and making it not a symlink?

@jlebon
Copy link
Member

jlebon commented Sep 30, 2020

We discussed this in the meeting today. Our (or at least my) understanding was indeed that this would be a system-wide change and not scoped to just FCOS. I don't have the cycles or knowledge to drive this across all Fedora editions, but if we do go down that path, we can definitely take care of the rpm-ostree-based editions. @Conan-Kudo would you like to drive that change forward?

@Conan-Kudo
Copy link
Author

Conan-Kudo commented Sep 30, 2020

I can help for traditional Fedora variants, if needed. Though I think making the change won't be terribly difficult, evidenced by how @sysrich did this for openSUSE.

@dustymabe
Copy link
Member

We discussed this in last week's meeting.

* ACTION: jlebon to reach out to the rpm maintainers to see if the
    relocation of the rpmdb path is something their willing to own for
    F34  (dustymabe, 16:47:11)

@dustymabe dustymabe removed the meeting topics for meetings label Oct 7, 2020
@jlebon
Copy link
Member

jlebon commented Oct 14, 2020

@pmatilai, WDYT about the above? Would you be interested in owning the move to the new rpmdb path with support from the CoreOS team and @Conan-Kudo? Do you have some sense of how difficult/risky this would be?

@pmatilai
Copy link

I have no plans or interest to drive such a change, as I have said before.

@pmatilai
Copy link

@ffesti, interested?

@dustymabe
Copy link
Member

We discussed this at the community meeting this week.

  * ACTION: jlebon to talk with King_InuYasha to see if they can be
    co-captains for the proposed change to move the rpmdb path (#639)
    (dustymabe, 16:41:53)

@dustymabe
Copy link
Member

relevant information:

Change Checkpoint: Proposal submission deadline (System Wide Changes) | Tue 2020-12-29
Change Checkpoint: Proposal submission deadline (Self Contained Changes) | Tue 2021-01-19

jlebon added a commit to jlebon/rpm-ostree that referenced this issue Feb 8, 2021
We trigger a librpm macro file load in many of our paths. Since the
default value shipped by rpm's macro file sets `_dbpath` to
`/var/lib/rpm`, we have to explicitly set that back to `/usr/share/rpm`
in those paths.

This became more problematic recently with libsolv v0.7.17 which fully
keys off of `_dbpath` to find the rpmdb path to load:

openSUSE/libsolv@04d4d03

And it's not technically wrong; we really should make that macro not
lie. This is what this patch does by injecting an RPM macro file in our
composes which sets it to our path. (So then e.g. the `rpm` CLI doesn't
actually need the `/var/lib/rpm` backcompat link anymore, though there's
no harm in leaving it.)

In the future, we should be able to drop this once we move all of Fedora
to `/usr/lib/sysimage/rpm` (see
coreos/fedora-coreos-tracker#639).

Closes: coreos#2548
jlebon added a commit to jlebon/rpm-ostree that referenced this issue Feb 8, 2021
We trigger a librpm macro file load in many of our paths. Since the
default value shipped by rpm's macro file sets `_dbpath` to
`/var/lib/rpm`, we have to explicitly set that back to `/usr/share/rpm`
in those paths.

This became more problematic recently with libsolv v0.7.17 which fully
keys off of `_dbpath` to find the rpmdb path to load:

openSUSE/libsolv@04d4d03

And it's not technically wrong; we really should make that macro not
lie. This is what this patch does by injecting an RPM macro file in our
composes which sets it to our path. (So then e.g. the `rpm` CLI doesn't
actually need the `/var/lib/rpm` backcompat link anymore, though there's
no harm in leaving it.)

In the future, we should be able to drop this once we move all of Fedora
to `/usr/lib/sysimage/rpm` (see
coreos/fedora-coreos-tracker#639).

Closes: coreos#2548
jlebon added a commit to jlebon/rpm-ostree that referenced this issue Feb 8, 2021
We trigger a librpm macro file load in many of our paths. Since the
default value shipped by rpm's macro file sets `_dbpath` to
`/var/lib/rpm`, we have to explicitly set that back to `/usr/share/rpm`
in those paths.

This became more problematic recently with libsolv v0.7.17 which fully
keys off of `_dbpath` to find the rpmdb path to load:

openSUSE/libsolv@04d4d03

And it's not technically wrong; we really should make that macro not
lie. This is what this patch does by injecting an RPM macro file in our
composes which sets it to our path. (So then e.g. the `rpm` CLI doesn't
actually need the `/var/lib/rpm` backcompat link anymore, though there's
no harm in leaving it.)

In the future, we should be able to drop this once we move all of Fedora
to `/usr/lib/sysimage/rpm` (see
coreos/fedora-coreos-tracker#639).

Closes: coreos#2548
jlebon added a commit to jlebon/rpm-ostree that referenced this issue Feb 8, 2021
We trigger a librpm macro file load in many of our paths. Since the
default value shipped by rpm's macro file sets `_dbpath` to
`/var/lib/rpm`, we have to explicitly set that back to `/usr/share/rpm`
in those paths.

This became more problematic recently with libsolv v0.7.17 which fully
keys off of `_dbpath` to find the rpmdb path to load:

openSUSE/libsolv@04d4d03

And it's not technically wrong; we really should make that macro not
lie. This is what this patch does by injecting an RPM macro file in our
composes which sets it to /usr/lib/sysimage/rpm (which currently is a
symlink to /usr/share/rpm, but eventually will become the canonical
location). So then e.g. the `rpm` CLI doesn't actually need the
`/var/lib/rpm` backcompat link anymore, though there's no harm in
leaving it.

In the future, we should be able to drop this once we move all of Fedora
to `/usr/lib/sysimage/rpm` (see
coreos/fedora-coreos-tracker#639).

Closes: coreos#2548
jlebon added a commit to jlebon/rpm-ostree that referenced this issue Feb 8, 2021
…ib/sysimage/rpm

We trigger a librpm macro file load in many of our paths. Since the
default value shipped by rpm's macro file sets `_dbpath` to
`/var/lib/rpm`, we have to explicitly set that back to `/usr/share/rpm`
in those paths.

This became more problematic recently with libsolv v0.7.17 which fully
keys off of `_dbpath` to find the rpmdb path to load:

openSUSE/libsolv@04d4d03

And it's not technically wrong; we really should make that macro not
lie. This is what this patch does by injecting an RPM macro file in our
composes which sets it to /usr/lib/sysimage/rpm (which currently is a
symlink to /usr/share/rpm, but eventually will become the canonical
location). So then e.g. the `rpm` CLI doesn't actually need the
`/var/lib/rpm` backcompat link anymore, though there's no harm in
leaving it.

In the future, we should be able to drop this once we move all of Fedora
to `/usr/lib/sysimage/rpm` (see
coreos/fedora-coreos-tracker#639).

Closes: coreos#2548
@cgwalters
Copy link
Member

xref coreos/rpm-ostree#2553 where a recent libsolv change to honor %_dbpath (in openSUSE/libsolv@04d4d03 ) broke rpm-ostree (if it'd worked that way from the start we probably could have designed around it at least).

jlebon added a commit to jlebon/rpm-ostree that referenced this issue Feb 9, 2021
…hare/rpm

We trigger a librpm macro file load in many of our paths. Since the
default value shipped by rpm's macro file sets `_dbpath` to
`/var/lib/rpm`, we have to explicitly set that back to `/usr/share/rpm`
in those paths.

This became more problematic recently with libsolv v0.7.17 which fully
keys off of `_dbpath` to find the rpmdb path to load:

openSUSE/libsolv@04d4d03

And it's not technically wrong; we really should make that macro not
lie. This is what this patch does by injecting an RPM macro file in our
composes which sets it to /usr/share/rpm. So then e.g. the `rpm` CLI
doesn't actually need the `/var/lib/rpm` backcompat link anymore, though
there's no harm in leaving it.

In the future, we should be able to drop this once we move all of Fedora
to `/usr/lib/sysimage/rpm` (see
coreos/fedora-coreos-tracker#639).

Closes: coreos#2548
cgwalters pushed a commit to jlebon/rpm-ostree that referenced this issue Feb 9, 2021
…hare/rpm

We trigger a librpm macro file load in many of our paths. Since the
default value shipped by rpm's macro file sets `_dbpath` to
`/var/lib/rpm`, we have to explicitly set that back to `/usr/share/rpm`
in those paths.

This became more problematic recently with libsolv v0.7.17 which fully
keys off of `_dbpath` to find the rpmdb path to load:

openSUSE/libsolv@04d4d03

And it's not technically wrong; we really should make that macro not
lie. This is what this patch does by injecting an RPM macro file in our
composes which sets it to /usr/share/rpm. So then e.g. the `rpm` CLI
doesn't actually need the `/var/lib/rpm` backcompat link anymore, though
there's no harm in leaving it.

In the future, we should be able to drop this once we move all of Fedora
to `/usr/lib/sysimage/rpm` (see
coreos/fedora-coreos-tracker#639).

Closes: coreos#2548
openshift-merge-robot pushed a commit to coreos/rpm-ostree that referenced this issue Feb 9, 2021
…hare/rpm

We trigger a librpm macro file load in many of our paths. Since the
default value shipped by rpm's macro file sets `_dbpath` to
`/var/lib/rpm`, we have to explicitly set that back to `/usr/share/rpm`
in those paths.

This became more problematic recently with libsolv v0.7.17 which fully
keys off of `_dbpath` to find the rpmdb path to load:

openSUSE/libsolv@04d4d03

And it's not technically wrong; we really should make that macro not
lie. This is what this patch does by injecting an RPM macro file in our
composes which sets it to /usr/share/rpm. So then e.g. the `rpm` CLI
doesn't actually need the `/var/lib/rpm` backcompat link anymore, though
there's no harm in leaving it.

In the future, we should be able to drop this once we move all of Fedora
to `/usr/lib/sysimage/rpm` (see
coreos/fedora-coreos-tracker#639).

Closes: #2548
@jlebon
Copy link
Member

jlebon commented Apr 29, 2022

The Fedora-wide change was done in f36: https://fedoraproject.org/wiki/Changes/RelocateRPMToUsr, but there is still work pending on the rpm-ostree side to fully adapt to it.

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

No branches or pull requests

5 participants