Whamcloud - gitweb
LU-17774 build: pass systemdsystemunitdir to "make debs" 02/54902/3
authorJian Yu <yujian@whamcloud.com>
Fri, 26 Apr 2024 17:10:03 +0000 (10:10 -0700)
committerOleg Drokin <green@whamcloud.com>
Tue, 21 May 2024 18:43:35 +0000 (18:43 +0000)
This patch passes "--with-systemdsystemunitdir" configure
option to the configure command performed in "make debs".
It also updates debian/lustre-{client,server}-utils.install
with the detected/specified directory for systemd service files.

Test-Parameters: trivial clientdistro=ubuntu2204

Signed-off-by: Jian Yu <yujian@whamcloud.com>
Change-Id: I7c36904ea0ed0f393a76b0fb0ad444b330dfa78c
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54902
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Aurelien Degremont <adegremont@nvidia.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
autoMakefile.am
debian/rules

index 66064c3..62b6556 100644 (file)
@@ -371,6 +371,7 @@ debs: undef.h debs_common
        fi; \
        if test "x@systemdsystemunitdir@" != "x"; then \
                export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} systemd"; \
+               export SYSTEMD_OPTIONS="--with-systemdsystemunitdir=@systemdsystemunitdir@"; \
        fi; \
        if test "x@ENABLE_PINGER@" = "xyes"; then \
                export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} pinger"; \
index 4cbc3d3..366bdce 100755 (executable)
@@ -75,6 +75,10 @@ KSRC?=$(LINUX_OBJ)
 KSRC_TREE?=$(LINUX)
 EXTRA_OPTIONS?=$(IB_OPTIONS)
 
+ifneq ($(SYSTEMD_OPTIONS),)
+       EXTRA_OPTIONS += $(SYSTEMD_OPTIONS)
+endif
+
 # Packages provided for both client and server builds
 IOKIT_PKG=lustre-iokit
 TESTS_PKG=lustre-tests
@@ -164,8 +168,12 @@ configure-stamp: autogen-stamp debian/control.main debian/control.modules.in
        if echo "$${DEB_BUILD_PROFILES}" | grep -q "server"; then \
                export EXTRAFLAGS="--enable-server"; \
                if echo "$${DEB_BUILD_PROFILES}" | grep -q "systemd"; then \
-                       cp debian/lustre-server-utils.install.in \
-                               debian/lustre-server-utils.install; \
+                       systemd_dir=$$(echo $${SYSTEMD_OPTIONS} | \
+                                      sed -e "s/--with-systemdsystemunitdir=\///g" \
+                                          -e "s/\//\\\\\//g"); \
+                       sed "s/lib\/systemd\/system/$${systemd_dir}/g" \
+                               debian/lustre-server-utils.install.in \
+                               > debian/lustre-server-utils.install; \
                else \
                        sed /systemd/d debian/lustre-server-utils.install.in \
                                > debian/lustre-server-utils.install; \
@@ -173,8 +181,12 @@ configure-stamp: autogen-stamp debian/control.main debian/control.modules.in
        else \
                export EXTRAFLAGS="--disable-server"; \
                if echo "$${DEB_BUILD_PROFILES}" | grep -q "systemd"; then \
-                       cp debian/lustre-client-utils.install.in \
-                               debian/lustre-client-utils.install; \
+                       systemd_dir=$$(echo $${SYSTEMD_OPTIONS} | \
+                                      sed -e "s/--with-systemdsystemunitdir=\///g" \
+                                          -e "s/\//\\\\\//g"); \
+                       sed "s/lib\/systemd\/system/$${systemd_dir}/g" \
+                               debian/lustre-client-utils.install.in \
+                               > debian/lustre-client-utils.install; \
                else \
                        sed /systemd/d debian/lustre-client-utils.install.in \
                                > debian/lustre-client-utils.install; \