From 3cdebf7c62fcbe497a345c01f52d82bc579dee79 Mon Sep 17 00:00:00 2001 From: Chuck Short Date: Thu, 10 Mar 2022 14:28:52 +0000 Subject: [PATCH] debian: Simplify mtce-control packaging - Ensure that the service is started when the package is installed. - Ensure that the service dependencies are started when the package is installed. - Simplify debian/rules to use the Makefile in order to install the files that are needed. Test Plan PASS Build package and ISO PASS Boot and check for goenabled-control.service Story: 2009101 Task: 43023 Signed-off-by: Chuck Short Change-Id: I3863042357257ffbcfaf8084da2f44853e0b6264 --- mtce-control/debian/deb_folder/control | 3 +-- .../debian/deb_folder/mtce-control.install | 2 ++ mtce-control/debian/deb_folder/not-installed | 1 + mtce-control/debian/deb_folder/rules | 15 +++++++-------- .../deb_folder/systemd/00-mtce-control.preset | 1 + 5 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 mtce-control/debian/deb_folder/not-installed create mode 100644 mtce-control/debian/deb_folder/systemd/00-mtce-control.preset diff --git a/mtce-control/debian/deb_folder/control b/mtce-control/debian/deb_folder/control index d5a7337e..5558eb8c 100644 --- a/mtce-control/debian/deb_folder/control +++ b/mtce-control/debian/deb_folder/control @@ -2,8 +2,7 @@ Source: mtce-control Section: admin Priority: optional Maintainer: StarlingX Developers -Build-Depends: debhelper-compat (= 13), - libsystemd-dev +Build-Depends: debhelper-compat (= 13) Standards-Version: 4.5.1 Homepage: https://www.starlingx.io diff --git a/mtce-control/debian/deb_folder/mtce-control.install b/mtce-control/debian/deb_folder/mtce-control.install index 1bdf964d..b7cce677 100644 --- a/mtce-control/debian/deb_folder/mtce-control.install +++ b/mtce-control/debian/deb_folder/mtce-control.install @@ -1,3 +1,5 @@ etc/init.d/goenabledControl etc/init.d/hbsAgent etc/pmon.d/hbsAgent.conf +lib/systemd/system/hbsAgent.service +debian/systemd/00-mtce-control.preset etc/systemd/system-preset diff --git a/mtce-control/debian/deb_folder/not-installed b/mtce-control/debian/deb_folder/not-installed new file mode 100644 index 00000000..e4acae60 --- /dev/null +++ b/mtce-control/debian/deb_folder/not-installed @@ -0,0 +1 @@ +/usr/share/licenses/mtce-control-1.0/LICENSE diff --git a/mtce-control/debian/deb_folder/rules b/mtce-control/debian/deb_folder/rules index 95a8b796..f19c83d7 100644 --- a/mtce-control/debian/deb_folder/rules +++ b/mtce-control/debian/deb_folder/rules @@ -2,18 +2,17 @@ # export DH_VERBOSE = 1 export ROOT = debian/tmp -export INITDIR = $(ROOT)/etc/init.d -export PMONDIR = $(ROOT)/etc/pmon.d %: dh $@ override_dh_auto_install: - install -m 755 -d $(INITDIR) - install -m 755 -p -D scripts/goenabled $(INITDIR)/goenabledControl - install -m 755 -p -D scripts/hbsAgent $(INITDIR) - install -m 755 -d $(PMONDIR) - install -m 644 -p -D scripts/hbsAgent.conf $(PMONDIR) + $(MAKE) buildroot=$(ROOT) \ + _sysconfdir=/etc \ + _unitdir=/lib/systemd/system \ + _datarootdir=/usr/share \ + install + dh_install override_dh_installsystemd: - dh_installsystemd --name hbsAgent + dh_installsystemd -pmtce-control --name hbsAgent hbsAgent.service diff --git a/mtce-control/debian/deb_folder/systemd/00-mtce-control.preset b/mtce-control/debian/deb_folder/systemd/00-mtce-control.preset new file mode 100644 index 00000000..e4106779 --- /dev/null +++ b/mtce-control/debian/deb_folder/systemd/00-mtce-control.preset @@ -0,0 +1 @@ +enable hbsAgent.service