diff --git a/Containerfile.base b/Containerfile.base index ef4ac22..689976a 100644 --- a/Containerfile.base +++ b/Containerfile.base @@ -9,9 +9,9 @@ # container image. FROM quay.io/fedora/fedora:rawhide as repos -# BOOTSTRAPPING: This can be any image that has rpm-ostree and selinux-policy-targeted. +# BOOTSTRAPPING: This can be any image that has the following packages. FROM quay.io/fedora/fedora:rawhide as builder -RUN dnf -y install rpm-ostree selinux-policy-targeted +RUN dnf -y install rpm-ostree selinux-policy-targeted sqlite # Copy in our source code. COPY . /src WORKDIR /src diff --git a/base/finalize.d/05-rpmdb.sh b/base/finalize.d/05-rpmdb.sh new file mode 100755 index 0000000..f4eea57 --- /dev/null +++ b/base/finalize.d/05-rpmdb.sh @@ -0,0 +1,24 @@ +#!/bin/bash +set -euo pipefail +# https://github.com/coreos/rpm-ostree/pull/5244 +# +sysimage_rpmdb=usr/lib/sysimage/rpm/rpmdb.sqlite +rpmostree_rpmdb_dir=usr/share/rpm +rpmostree_rpmdb="${rpmostree_rpmdb_dir}/rpmdb.sqlite" +rpmostree_base_rpmdb_dir=usr/lib/sysimage/rpm-ostree-base-db +rpmostree_base_rpmdb="${rpmostree_base_rpmdb_dir}/rpmdb.sqlite" +pragma='PRAGMA journal_mode=delete;' + +# Forcibly delete this because ostree hardlinking the sqlite databases +# confuses rpm. This will cause rpm-ostree to enter a fallback +# mode with package layering, but that's OK. +if test -d "${rpmostree_base_rpmdb_dir}"; then + echo "Removing ${rpmostree_base_rpmdb_dir}" + rm "${rpmostree_base_rpmdb_dir}" -rf +fi +for path in ${sysimage_rpmdb} ${rpmostree_rpmdb}; do + if test -f "${path}-shm"; then + echo "Executing in ${path}: ${pragma}" + sqlite3 "${path}" "${pragma}" >/dev/null + fi +done