]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Drop centos logic to rebuild database to bdb format
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 14 Apr 2023 14:21:49 +0000 (16:21 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 15 Apr 2023 17:36:33 +0000 (19:36 +0200)
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.

NEWS.md
mkosi/distributions/centos.py

diff --git a/NEWS.md b/NEWS.md
index 70ea3c283d5ff2deaf7eab2d38d54e721a70de27..ffe9a38c4a01aad1898b4834e6d03e382ff852dc 100644 (file)
--- 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
 
index 938518663eb0a0b3d7c6ac3a5c0accf0e595e32f..bce12d29f3bd2d92630c10b02312484e34085572 100644 (file)
@@ -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: