From e9842965cc316b0ea12eb69b3b1cc68d0082c451 Mon Sep 17 00:00:00 2001 From: Fabricio Henrique Ramos <fabriciohenrique.ramos@windriver.com> Date: Fri, 8 Oct 2021 10:06:54 -0300 Subject: [PATCH] Add debian packaging directory for sysinv-agent Add debian packaging directory to build sysinv-agent for Debian os. Story: 2009101 Task: 43110 Signed-off-by: Fabricio Henrique Ramos <fabriciohenrique.ramos@windriver.com> Change-Id: I7c6d3f658683d717f68e4b16c0f21a921c6fa828 --- .../sysinv-agent/debian/deb_folder/changelog | 5 +++++ sysinv/sysinv-agent/debian/deb_folder/control | 15 +++++++++++++ .../sysinv-agent/debian/deb_folder/copyright | 22 +++++++++++++++++++ sysinv/sysinv-agent/debian/deb_folder/rules | 16 ++++++++++++++ .../debian/deb_folder/source/format | 1 + .../debian/deb_folder/sysinv-agent.dirs | 3 +++ .../debian/deb_folder/sysinv-agent.install | 3 +++ .../debian/deb_folder/sysinv-agent.postinst | 4 ++++ .../debian/deb_folder/sysinv-agent.postrm | 4 ++++ sysinv/sysinv-agent/debian/dl_hook | 10 +++++++++ sysinv/sysinv-agent/debian/meta_data.yaml | 7 ++++++ sysinv/sysinv-agent/sysinv-agent | 15 ++++++------- 12 files changed, 97 insertions(+), 8 deletions(-) create mode 100644 sysinv/sysinv-agent/debian/deb_folder/changelog create mode 100644 sysinv/sysinv-agent/debian/deb_folder/control create mode 100644 sysinv/sysinv-agent/debian/deb_folder/copyright create mode 100755 sysinv/sysinv-agent/debian/deb_folder/rules create mode 100644 sysinv/sysinv-agent/debian/deb_folder/source/format create mode 100644 sysinv/sysinv-agent/debian/deb_folder/sysinv-agent.dirs create mode 100644 sysinv/sysinv-agent/debian/deb_folder/sysinv-agent.install create mode 100644 sysinv/sysinv-agent/debian/deb_folder/sysinv-agent.postinst create mode 100644 sysinv/sysinv-agent/debian/deb_folder/sysinv-agent.postrm create mode 100755 sysinv/sysinv-agent/debian/dl_hook create mode 100644 sysinv/sysinv-agent/debian/meta_data.yaml diff --git a/sysinv/sysinv-agent/debian/deb_folder/changelog b/sysinv/sysinv-agent/debian/deb_folder/changelog new file mode 100644 index 0000000000..475a2ed467 --- /dev/null +++ b/sysinv/sysinv-agent/debian/deb_folder/changelog @@ -0,0 +1,5 @@ +sysinv-agent (1.0-1) unstable; urgency=medium + + * Initial Release. + + -- Fabricio Henrique Ramos <fabriciohenrique.ramos@windriver.com> Tue, 24 Aug 2021 11:40:50 -0300 diff --git a/sysinv/sysinv-agent/debian/deb_folder/control b/sysinv/sysinv-agent/debian/deb_folder/control new file mode 100644 index 0000000000..3cdcedadd7 --- /dev/null +++ b/sysinv/sysinv-agent/debian/deb_folder/control @@ -0,0 +1,15 @@ +Source: sysinv-agent +Section: admin +Priority: optional +Maintainer: StarlingX Developers <starlingx-discuss@lists.starlingx.io> +Build-Depends: debhelper-compat (= 13) +Standards-Version: 4.5.1 +Homepage: https://www.starlingx.io +Rules-Requires-Root: no + +Package: sysinv-agent +Architecture: any +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends} +Description: StarlingX Inventory Init Package + StarlingX package for system inventory management diff --git a/sysinv/sysinv-agent/debian/deb_folder/copyright b/sysinv/sysinv-agent/debian/deb_folder/copyright new file mode 100644 index 0000000000..3c5da915a8 --- /dev/null +++ b/sysinv/sysinv-agent/debian/deb_folder/copyright @@ -0,0 +1,22 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: sysinv-agent +Upstream-Contact: StarlingX Developers <starlingx-discuss@lists.starlingx.io> +Source: https://opendev.org/starlingx/config + +Files: * +Copyright: (c) 2013-2021 Wind River Systems, Inc. +License: Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + https://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + On Debian-based systems the full text of the Apache version 2.0 license + can be found in `/usr/share/common-licenses/Apache-2.0'. diff --git a/sysinv/sysinv-agent/debian/deb_folder/rules b/sysinv/sysinv-agent/debian/deb_folder/rules new file mode 100755 index 0000000000..c7216f7094 --- /dev/null +++ b/sysinv/sysinv-agent/debian/deb_folder/rules @@ -0,0 +1,16 @@ +#!/usr/bin/make -f +#export DH_VERBOSE=1 + +ROOT := $(CURDIR)/debian/tmp + +%: + dh $@ + +override_dh_install: + install -p -D -m 755 sysinv-agent ${ROOT}/etc/init.d/sysinv-agent + install -p -D -m 644 sysinv-agent.conf ${ROOT}/etc/pmon.d/sysinv-agent.conf + install -p -D -m 644 sysinv-agent.service ${ROOT}/lib/systemd/system/sysinv-agent.service + dh_install + +override_dh_installinit: + dh_installinit --only-scripts diff --git a/sysinv/sysinv-agent/debian/deb_folder/source/format b/sysinv/sysinv-agent/debian/deb_folder/source/format new file mode 100644 index 0000000000..163aaf8d82 --- /dev/null +++ b/sysinv/sysinv-agent/debian/deb_folder/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/sysinv/sysinv-agent/debian/deb_folder/sysinv-agent.dirs b/sysinv/sysinv-agent/debian/deb_folder/sysinv-agent.dirs new file mode 100644 index 0000000000..ef8ba5507c --- /dev/null +++ b/sysinv/sysinv-agent/debian/deb_folder/sysinv-agent.dirs @@ -0,0 +1,3 @@ +etc/init.d +etc/pmon.d +lib/systemd/system diff --git a/sysinv/sysinv-agent/debian/deb_folder/sysinv-agent.install b/sysinv/sysinv-agent/debian/deb_folder/sysinv-agent.install new file mode 100644 index 0000000000..bc74e34956 --- /dev/null +++ b/sysinv/sysinv-agent/debian/deb_folder/sysinv-agent.install @@ -0,0 +1,3 @@ +etc/init.d/sysinv-agent +etc/pmon.d/sysinv-agent.conf +lib/systemd/system/sysinv-agent.service diff --git a/sysinv/sysinv-agent/debian/deb_folder/sysinv-agent.postinst b/sysinv/sysinv-agent/debian/deb_folder/sysinv-agent.postinst new file mode 100644 index 0000000000..6060c4fb6b --- /dev/null +++ b/sysinv/sysinv-agent/debian/deb_folder/sysinv-agent.postinst @@ -0,0 +1,4 @@ +#!/bin/sh +set -e + +#DEBHELPER# diff --git a/sysinv/sysinv-agent/debian/deb_folder/sysinv-agent.postrm b/sysinv/sysinv-agent/debian/deb_folder/sysinv-agent.postrm new file mode 100644 index 0000000000..6060c4fb6b --- /dev/null +++ b/sysinv/sysinv-agent/debian/deb_folder/sysinv-agent.postrm @@ -0,0 +1,4 @@ +#!/bin/sh +set -e + +#DEBHELPER# diff --git a/sysinv/sysinv-agent/debian/dl_hook b/sysinv/sysinv-agent/debian/dl_hook new file mode 100755 index 0000000000..58f09dbbc5 --- /dev/null +++ b/sysinv/sysinv-agent/debian/dl_hook @@ -0,0 +1,10 @@ +#!/bin/bash +set -x + +PKG_BUILD_NAME=$1 +PKG_BUILD_ROOT=$(realpath `pwd`/${PKG_BUILD_NAME}) +STX_BASE=$(realpath ${MY_REPO}/stx) +SRC=$(realpath ${STX_BASE}/config/sysinv/sysinv-agent) + +mkdir ${PKG_BUILD_NAME} +cp -p ${SRC}/{LICENSE,sysinv-agent*} ${PKG_BUILD_ROOT}/ diff --git a/sysinv/sysinv-agent/debian/meta_data.yaml b/sysinv/sysinv-agent/debian/meta_data.yaml new file mode 100644 index 0000000000..85f5402d55 --- /dev/null +++ b/sysinv/sysinv-agent/debian/meta_data.yaml @@ -0,0 +1,7 @@ +--- +debver: 1.0-1 +debname: sysinv-agent +dl_hook: dl_hook +revision: + dist: $STX_DIST + PKG_GITREVCOUNT: true diff --git a/sysinv/sysinv-agent/sysinv-agent b/sysinv/sysinv-agent/sysinv-agent index c917cb0cfe..e0aa472376 100755 --- a/sysinv/sysinv-agent/sysinv-agent +++ b/sysinv/sysinv-agent/sysinv-agent @@ -10,17 +10,16 @@ # ### BEGIN INIT INFO # Provides: sysinv-agent -# Default-Start: 3 5 -# Required-Start: -# Required-Stop: -# Default-Stop: 0 1 2 6 +# Default-Start: 2 3 4 5 +# Required-Start: $local_fs +# Required-Stop: $local_fs +# Default-Stop: 0 1 6 # Short-Description: Maintenance daemon ### END INIT INFO . /etc/init.d/functions . /etc/build.info - PLATFORM_CONF="/etc/platform/platform.conf" NODETYPE="" DAEMON_NAME="sysinv-agent" @@ -52,7 +51,7 @@ RETVAL=0 PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin export PATH -function mount_and_copy_config_file() +mount_and_copy_config_file() { echo "Mount /opt/platform" logger "$0: Info: nfs-mount controller:/opt/platform/sysinv/${SW_VERSION} /mnt/sysinv" @@ -218,8 +217,8 @@ case "$1" in [ -f /var/lock/subsys/$DAEMON_NAME ] && $0 restart ;; - *) - echo "usage: $0 { start | stop | status | restart | condrestart | status }" + force-reload | *) + echo "usage: $0 { start | stop | status | restart | condrestart }" ;; esac