From: Daan De Meyer Date: Fri, 14 Apr 2023 14:21:49 +0000 (+0200) Subject: Drop centos logic to rebuild database to bdb format X-Git-Tag: v15~251^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4bd0f585c0f37f51bd35ee61afe4334feed2c105;p=thirdparty%2Fmkosi.git Drop centos logic to rebuild database to bdb format This image might just be a base image that's intended to be added onto with sysexts and such. If so, we need to keep the database in sqlite format so that it can still be written to by rpm on the host. So let's leave the rebuilding to be done in a postinst script by the user. --- diff --git a/NEWS.md b/NEWS.md index 70ea3c283..ffe9a38c4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -70,6 +70,9 @@ - Removed `--bootable` in favor of automatically generating a bootable image if all the necessary packages are installed. Documentation was added in docs/bootable.ld on how a bootable image can be generated on mainstream distros. +- The RPM db is no longer rebuilt in bdb format on CentOS Stream 8. To be able to install packages on a + CentOS Stream 8 image with a RPM db in sqlite format, rewrite the db in bdb format using + `rpm --rebuilddb --define _db_backend bdb`. ## v14 diff --git a/mkosi/distributions/centos.py b/mkosi/distributions/centos.py index 938518663..bce12d29f 100644 --- a/mkosi/distributions/centos.py +++ b/mkosi/distributions/centos.py @@ -104,14 +104,6 @@ class CentosInstaller(DistributionInstaller): # move it back to /var/lib/rpm on CentOS. move_rpm_db(state.root) - # Centos Stream 8 and below can't write to the sqlite db backend used by - # default in newer RPM releases so let's rebuild the DB to use the old bdb - # backend instead. Because newer RPM releases have dropped support for the - # bdb backend completely, we check if rpm is installed and use - # run_workspace_command() to rebuild the rpm db. - if release <= 8 and state.root.joinpath("usr/bin/rpm").exists(): - cmdline = ["rpm", "--rebuilddb", "--define", "_db_backend bdb"] - run_workspace_command(state, cmdline) @classmethod def install_packages(cls, state: MkosiState, packages: Sequence[str]) -> None: