Skip to content

Commit ca167c7

Browse files
renner0eHastD
andauthored
fix: relink rpm-ostree-base-db to system rpmdb (#2499)
taken from blue-build[1], this also happens to make updates smaller by 100MB. Might fix the following issues like [2] and [3]. I could not reproduce these issues myself and just using chunkah made it possible for me to overlay firefox with rpm-ostree. [1]: blue-build/cli@b6f36bd [2]: #2209 [3]: #2492 Co-authored-by: Daniel Hast <32797673+HastD@users.noreply.github.com>
1 parent 0f9da15 commit ca167c7

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

build_files/shared/clean-stage.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@ systemctl disable flatpak-add-fedora-repos.service
1313
systemctl mask flatpak-add-fedora-repos.service
1414
rm -f /usr/lib/systemd/system/flatpak-add-fedora-repos.service
1515

16+
# Relink rpm-ostree-base-db to rpmdb to ensure it correctly reflects the system
17+
# image's rpmdb and doesn't carry over package info from the base image.
18+
# See: https://github.com/coreos/rpm-ostree/issues/4554
19+
# https://forge.fedoraproject.org/atomic/tracker/issues/82
20+
for file in rpmdb.sqlite rpmdb.sqlite-shm rpmdb.sqlite-wal; do
21+
target="/usr/share/rpm/${file}"
22+
link_path="/usr/lib/sysimage/rpm-ostree-base-db/${file}"
23+
if [[ -f "${target}" && -f "${link_path}" ]]; then
24+
# Note, this needs to be a hardlink, not a symbolic link.
25+
ln -f "${target}" "${link_path}"
26+
fi
27+
done
28+
1629
rm -rf /.gitkeep
1730

1831
find /var/* -maxdepth 0 -type d \! -name cache -exec rm -fr {} \;

0 commit comments

Comments
 (0)