From 74d56ecdf3d87c9baa1b8b9d67cd11617d5bea9c Mon Sep 17 00:00:00 2001
From: James Simmons <uja.ornl@yahoo.com>
Date: Fri, 6 Apr 2018 12:06:35 -0400
Subject: [PATCH] LU-10869 build: package configuration files for Ubuntu /
 Debian

For a long time Lustre never added /etc configuration files to its
debian packages. It could get away with but now you can see it
fail conf-sanity test 76a. This test the lctl set_param -P which
uses udev events to set the tunables for lustre. In order for it
to work a default udev rule has to be added to 99-lustre.rules.
Beside the missing 99-lustre.rules and in all the other files used
for configuration. Lastly create conffile which is the way Debian
handles potential stomping of configuration files. When installing
with apt-get install it will ask the person installing if they
want to over ride specific files.

Test-Parameters: clientdistro=ubuntu1604 trivial testlist=conf-sanity
Test-Parameters: envdefinitions=ONLY=76a testlist=conf-sanity

Lustre-change: https://review.whamcloud.com/31850
Lustre-commit: 8f221cf65b644d798493da489674abd2e2b7f23f

Change-Id: Ic0aaf2bba531ce23a3e23ef070a1501032ad1c9f
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Thomas Stibor <t.stibor@gsi.de>
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Reviewed-on: https://review.whamcloud.com/32471
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
---
 debian/lustre-utils.conffiles | 4 ++++
 debian/lustre-utils.install   | 2 ++
 debian/rules                  | 2 +-
 3 files changed, 7 insertions(+), 1 deletion(-)
 create mode 100644 debian/lustre-utils.conffiles

diff --git a/debian/lustre-utils.conffiles b/debian/lustre-utils.conffiles
new file mode 100644
index 0000000000..164a7d940e
--- /dev/null
+++ b/debian/lustre-utils.conffiles
@@ -0,0 +1,4 @@
+/etc/lnet.conf
+/etc/lnet_routes.conf
+/etc/modprobe.d/ko2iblnd.conf
+/etc/udev/rules.d/99-lustre.rules
diff --git a/debian/lustre-utils.install b/debian/lustre-utils.install
index 3dcd0ca5a7..b232596416 100644
--- a/debian/lustre-utils.install
+++ b/debian/lustre-utils.install
@@ -1,3 +1,5 @@
 debian/tmp/sbin/*			sbin
 debian/tmp/usr/sbin/*			usr/sbin
 debian/tmp/usr/bin/*			usr/bin
+debian/tmp/lib/systemd/system/*		lib/systemd/system
+debian/tmp/etc/*			etc
diff --git a/debian/rules b/debian/rules
index d9f6577eea..dd2acb268c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -349,7 +349,7 @@ binary-modules: prep-deb-files
 	$(MAKE) $(PMAKEARGS)
 	$(MAKE) install DESTDIR=$(CURDIR)/debian/$(PKGNAME)
 	# Remove stuff that doesn't belong (no module-only target)
-	cd $(CURDIR)/debian/$(PKGNAME) && rm -rf usr/bin usr/sbin usr/lib usr/share usr/include/lustre sbin etc
+	cd $(CURDIR)/debian/$(PKGNAME) && rm -rf usr/bin usr/sbin usr/lib usr/share usr/include/lustre lib/systemd sbin etc
 	dh_installdocs -p$(PKGNAME)
 	dh_installchangelogs -p$(PKGNAME)
 	dh_installmodules -p $(PKGNAME)
-- 
GitLab