From c49b867ff8a95573389d5cd09761409571056f2f Mon Sep 17 00:00:00 2001 From: Robert Baldyga Date: Tue, 26 May 2026 15:36:26 +0200 Subject: [PATCH 1/2] Change install patch from /lib to /usr/lib Most modern distros already switched to usrmerge. It's safer and follows the current best practices to use /usr/lib. Signed-off-by: Robert Baldyga --- tools/pckgen.d/deb/debian/CAS_NAME.install | 10 +++++----- tools/pckgen.d/rpm/CAS_NAME.spec | 21 +++++++++++---------- utils/Makefile | 5 +++-- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/tools/pckgen.d/deb/debian/CAS_NAME.install b/tools/pckgen.d/deb/debian/CAS_NAME.install index 9ff592877..78e22bad2 100644 --- a/tools/pckgen.d/deb/debian/CAS_NAME.install +++ b/tools/pckgen.d/deb/debian/CAS_NAME.install @@ -1,8 +1,8 @@ etc/ -lib/opencas/ -lib/udev/ +usr/lib/opencas/ +usr/lib/udev/ sbin/ var/ -utils/open-cas.shutdown lib/systemd/system-shutdown/ -utils/open-cas.service lib/systemd/system/ -utils/open-cas-shutdown.service lib/systemd/system/ +utils/open-cas.shutdown usr/lib/systemd/system-shutdown/ +utils/open-cas.service usr/lib/systemd/system/ +utils/open-cas-shutdown.service usr/lib/systemd/system/ diff --git a/tools/pckgen.d/rpm/CAS_NAME.spec b/tools/pckgen.d/rpm/CAS_NAME.spec index 5e51959cd..c33511a17 100644 --- a/tools/pckgen.d/rpm/CAS_NAME.spec +++ b/tools/pckgen.d/rpm/CAS_NAME.spec @@ -2,6 +2,7 @@ # Copyright(c) 2020-2022 Intel Corporation # Copyright(c) 2025 Huawei Technologies # Copyright(c) 2025 Brian J. Murrell +# Copyright(c) 2026 Unvertical # SPDX-License-Identifier: BSD-3-Clause # @@ -94,7 +95,7 @@ if [ $1 -eq 0 ]; then systemctl -q disable open-cas-shutdown systemctl -q disable open-cas - rm -rf /lib/opencas/{__pycache__,*.py[co]} &>/dev/null + rm -rf /usr/lib/opencas/{__pycache__,*.py[co]} &>/dev/null fi %postun @@ -150,17 +151,17 @@ fi %license LICENSE %doc README.md %dir /etc/opencas/ -%dir /lib/opencas/ +%dir /usr/lib/opencas/ %dir /var/lib/opencas %config /etc/opencas/opencas.conf /etc/opencas/ioclass-config.csv /etc/dracut.conf.d/opencas.conf /var/lib/opencas/cas_version -/lib/opencas/casctl -/lib/opencas/open-cas-loader.py -/lib/opencas/opencas.py -/lib/udev/rules.d/60-persistent-storage-cas-load.rules -/lib/udev/rules.d/60-persistent-storage-cas.rules +/usr/lib/opencas/casctl +/usr/lib/opencas/open-cas-loader.py +/usr/lib/opencas/opencas.py +/usr/lib/udev/rules.d/60-persistent-storage-cas-load.rules +/usr/lib/udev/rules.d/60-persistent-storage-cas.rules /sbin/casadm /sbin/casctl /usr/bin/opencas_exporter @@ -172,9 +173,9 @@ fi /usr/share/man/man8/casadm.8.gz /usr/share/man/man8/casctl.8.gz %ghost /var/log/opencas.log -%ghost /lib/opencas/opencas.pyc -%ghost /lib/opencas/opencas.pyo -%ghost /lib/opencas/__pycache__ +%ghost /usr/lib/opencas/opencas.pyc +%ghost /usr/lib/opencas/opencas.pyo +%ghost /usr/lib/opencas/__pycache__ %files modules_%{kver_filename} %defattr(644, root, root, 755) diff --git a/utils/Makefile b/utils/Makefile index cf9929646..4bf5d73d7 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -1,13 +1,14 @@ # # Copyright(c) 2012-2022 Intel Corporation # Copyright(c) 2025 Huawei Technologies +# Copyright(c) 2026 Unvertical # SPDX-License-Identifier: BSD-3-Clause # include ../tools/helpers.mk -CASCTL_DIR = /lib/opencas -UDEVRULES_DIR = /lib/udev/rules.d +CASCTL_DIR = /usr/lib/opencas +UDEVRULES_DIR = /usr/lib/udev/rules.d METADATA_DIR:=$(PWD)/../.metadata UTILS_DIR:=$(PWD)/../utils UDEV:=$(shell which udevadm) From a439e7e806ff31df8f0be0d5514932fed6217bc1 Mon Sep 17 00:00:00 2001 From: Robert Baldyga Date: Tue, 26 May 2026 15:38:40 +0200 Subject: [PATCH 2/2] Add missing Makefile distclean targets Signed-off-by: Robert Baldyga --- extra/Makefile | 4 ++-- extra/prometheus/Makefile | 4 +++- libopencas/Makefile | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/extra/Makefile b/extra/Makefile index 675049311..11f957baa 100644 --- a/extra/Makefile +++ b/extra/Makefile @@ -5,9 +5,9 @@ DIRS := prometheus -all clean install install_files uninstall: +all clean distclean install install_files uninstall: @for dir in $(DIRS); do \ $(MAKE) -C $$dir $@; \ done -.PHONY: all clean install uninstall +.PHONY: all clean distclean install uninstall diff --git a/extra/prometheus/Makefile b/extra/prometheus/Makefile index 7cffe61a4..b390fc41f 100644 --- a/extra/prometheus/Makefile +++ b/extra/prometheus/Makefile @@ -38,4 +38,6 @@ clean: rm -f opencas_exporter $(MAKE) -C $(LIBOPENCAS_DIR) clean -.PHONY: all install uninstall clean +distclean: clean + +.PHONY: all install uninstall clean distclean diff --git a/libopencas/Makefile b/libopencas/Makefile index 7a0d92865..4592f0cb6 100644 --- a/libopencas/Makefile +++ b/libopencas/Makefile @@ -18,4 +18,6 @@ libopencas.o: libopencas.c libopencas.h clean: rm -f *.o *.a -.PHONY: all clean +distclean: clean + +.PHONY: all clean distclean