Whamcloud - gitweb
LU-17774 build: pass systemdsystemunitdir to "make debs"
authorJian Yu <yujian@whamcloud.com>
Fri, 26 Apr 2024 17:32:46 +0000 (10:32 -0700)
committerAndreas Dilger <adilger@whamcloud.com>
Sat, 27 Apr 2024 22:26:36 +0000 (22:26 +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.

Lustre-change: https://review.whamcloud.com/54902
Lustre-commit: TBD (from f2621099bbbc032a053800940cb62d03dfbd7120)

Test-Parameters: trivial clientdistro=ubuntu2204

Signed-off-by: Jian Yu <yujian@whamcloud.com>
Change-Id: I7c36904ea0ed0f393a76b0fb0ad444b330dfa78c
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/54921
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>
autoMakefile.am
debian/rules

index 168f503..241c6f6 100644 (file)
@@ -314,6 +314,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"; \
@@ -498,6 +499,7 @@ dkms-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; \
        echo "Enabled Build Profiles: $${DEB_BUILD_PROFILES}"; \
        tmpprofiles=`tr ' ' ',' <<< $$DEB_BUILD_PROFILES`; \
index a71cd8a..44b7aed 100755 (executable)
@@ -70,6 +70,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
@@ -159,8 +163,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; \
@@ -168,8 +176,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; \