From e35510e1cc54e83a158af9a5da3fb75ed4dd8601 Mon Sep 17 00:00:00 2001 From: Luis Eduardo Bonatti Date: Wed, 9 Aug 2023 11:31:50 -0300 Subject: [PATCH] Fix /var are not updated according to the patch changes Ostree doesn't manage the /var filesystem. Anything installed there during initial filesystem setup, becomes unpatchble. This commit changes the sm-patch.sql deploy path to a place that ostree handles, /usr/share/sm/patches in this case and symlinks it to /var/lib/sm/patches/sm-patch.sql. Test Plan: PASS: ISO install symlink created PASS: sm-patch.sql installed to /usr/share/sm/patches PASS: PATCH apply and changes applied to /var/lib/sm/ patches/sm-patch.sql on stx8 Closes-Bug: 2030890 Change-Id: I07047e5383e8ae9e57687cd1e852c2efc0eb755f Signed-off-by: Luis Eduardo Bonatti --- service-mgmt/sm-db/database/Makefile | 4 ++-- service-mgmt/sm-db/debian/deb_folder/rules | 4 ++++ service-mgmt/sm-db/debian/deb_folder/sm-db.install | 3 ++- service-mgmt/sm-db/debian/deb_folder/tmpfiles.conf | 1 + 4 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 service-mgmt/sm-db/debian/deb_folder/tmpfiles.conf diff --git a/service-mgmt/sm-db/database/Makefile b/service-mgmt/sm-db/database/Makefile index 037eb80c..fb90edd1 100644 --- a/service-mgmt/sm-db/database/Makefile +++ b/service-mgmt/sm-db/database/Makefile @@ -5,7 +5,7 @@ install: install -d ${DEST_DIR}/var/lib/sm install -d ${DEST_DIR}/var/lib/sm/patches + install -d ${DEST_DIR}/usr/share/sm/patches install sm.hb.db ${DEST_DIR}/var/lib/sm install sm.db ${DEST_DIR}/var/lib/sm - install -m 644 sm-patch.sql ${DEST_DIR}/var/lib/sm/patches - + install -m 644 sm-patch.sql ${DEST_DIR}/usr/share/sm/patches diff --git a/service-mgmt/sm-db/debian/deb_folder/rules b/service-mgmt/sm-db/debian/deb_folder/rules index d7c612e1..a044d874 100755 --- a/service-mgmt/sm-db/debian/deb_folder/rules +++ b/service-mgmt/sm-db/debian/deb_folder/rules @@ -12,6 +12,10 @@ override_dh_auto_build: sqlite3 database/sm.hb.db < database/create_sm_hb_db.sql dh_auto_build +override_dh_install: + install -p -D -m 644 debian/tmpfiles.conf $(ROOT)/usr/lib/tmpfiles.d/sm-db.conf + dh_install + override_dh_auto_install: $(MAKE) DEST_DIR=${ROOT} \ VER=$(VER) \ diff --git a/service-mgmt/sm-db/debian/deb_folder/sm-db.install b/service-mgmt/sm-db/debian/deb_folder/sm-db.install index 5d8bffeb..574aee13 100644 --- a/service-mgmt/sm-db/debian/deb_folder/sm-db.install +++ b/service-mgmt/sm-db/debian/deb_folder/sm-db.install @@ -1,5 +1,6 @@ usr/lib/libsm_db.so.* -var/lib/sm/patches/sm-patch.sql +usr/share/sm/patches/sm-patch.sql +usr/lib/tmpfiles.d/sm-db.conf # Marked on centos .spec file as "%config(noreplace)" var/lib/sm/sm.hb.db diff --git a/service-mgmt/sm-db/debian/deb_folder/tmpfiles.conf b/service-mgmt/sm-db/debian/deb_folder/tmpfiles.conf new file mode 100644 index 00000000..606e02e1 --- /dev/null +++ b/service-mgmt/sm-db/debian/deb_folder/tmpfiles.conf @@ -0,0 +1 @@ +L+ /var/lib/sm/patches/sm-patch.sql - - - - /usr/share/sm/patches/sm-patch.sql