From d1b334a731bc535d52c3c7a7948907cb96e0fd64 Mon Sep 17 00:00:00 2001 From: Leonardo Fagundes Luz Serrano Date: Wed, 15 Jan 2025 20:52:48 -0300 Subject: [PATCH] Adjusting paths due to apt-ostree restrictions Currently, apt-ostree doesn't implement changes made to /opt/* files. While an adjustment to apt-ostree is in progress, packages affected by this must install their content in other directories. Since LAT is redirecting content install to /opt in this repo to /usr/rootdirs/opt, the paths here have been adjusted to use the final destination directly. Importantly, note that no behavior changes come from this. In addition, since LAT creates the symlinks from /opt to /usr/rootdirs/opt via tmpfiles here [1] and apt-ostree doesn't, we need to add these tmpfiles as well. Ref: [1] https://github.com/Wind-River/meta-lat/blob/20230307/recipes-support/genimage/files/genimage/scripts/run.do_image_ostree#L94-L103 Test Plan: pass: build pkgs pass: Install ISO and verify contents are accessible from original location in /opt pass: Create patch with the new debs and install it. Verify that the system files received the changes. Story: 2010867 Task: 51559 Change-Id: I6caa6670b6c669927245c4fb9bd525597d897cfd Signed-off-by: Leonardo Fagundes Luz Serrano --- .../debian/deb_folder/collectd-extensions-tmpfiles.conf | 1 + .../debian/deb_folder/collectd-extensions.install | 5 +++-- collectd-extensions/debian/deb_folder/rules | 8 ++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 collectd-extensions/debian/deb_folder/collectd-extensions-tmpfiles.conf diff --git a/collectd-extensions/debian/deb_folder/collectd-extensions-tmpfiles.conf b/collectd-extensions/debian/deb_folder/collectd-extensions-tmpfiles.conf new file mode 100644 index 0000000..b3faf70 --- /dev/null +++ b/collectd-extensions/debian/deb_folder/collectd-extensions-tmpfiles.conf @@ -0,0 +1 @@ +L /opt/collectd - - - - /usr/rootdirs/opt/collectd diff --git a/collectd-extensions/debian/deb_folder/collectd-extensions.install b/collectd-extensions/debian/deb_folder/collectd-extensions.install index 2b6628a..b2bf38a 100644 --- a/collectd-extensions/debian/deb_folder/collectd-extensions.install +++ b/collectd-extensions/debian/deb_folder/collectd-extensions.install @@ -1,6 +1,7 @@ etc/collectd.d/* -opt/collectd/extensions/config/* -opt/collectd/extensions/python/* +etc/tmpfiles.d/collectd-extensions-tmpfiles.conf +usr/rootdirs/opt/collectd/extensions/config/* +usr/rootdirs/opt/collectd/extensions/python/* # %config(noreplace) etc/systemd/system/collectd.service diff --git a/collectd-extensions/debian/deb_folder/rules b/collectd-extensions/debian/deb_folder/rules index 67ea7d9..801a69d 100755 --- a/collectd-extensions/debian/deb_folder/rules +++ b/collectd-extensions/debian/deb_folder/rules @@ -4,13 +4,17 @@ export ROOT = $(CURDIR)/debian/tmp export LOCAL_UNIT_DIR = $(ROOT)/etc/systemd/system export LOCAL_DEFAULT_PLUGIN_DIR = $(ROOT)/etc/collectd.d export LOCAL_STARLINGX_PLUGIN_DIR = $(ROOT)/etc/collectd.d/starlingx -export LOCAL_PYTHON_EXTENSIONS_DIR = $(ROOT)/opt/collectd/extensions/python -export LOCAL_CONFIG_EXTENSIONS_DIR = $(ROOT)/opt/collectd/extensions/config +export LOCAL_PYTHON_EXTENSIONS_DIR = $(ROOT)/usr/rootdirs/opt/collectd/extensions/python +export LOCAL_CONFIG_EXTENSIONS_DIR = $(ROOT)/usr/rootdirs/opt/collectd/extensions/config +export TMPFILES_DIR = $(ROOT)/etc/tmpfiles.d/ %: dh $@ override_dh_install: + # Set up symlink /opt/collectd->/usr/rootdirs/opt/collectd + install -d $(TMPFILES_DIR) + install -m 644 debian/collectd-extensions-tmpfiles.conf $(TMPFILES_DIR) # Adjustments in the configuration files for debian sed -i '/Encoding "utf-8"/D' python_plugins.conf