From 5957cf072ca6b27cb78ada2454046df1e2a064b0 Mon Sep 17 00:00:00 2001 From: Ramon Gazoni Lacerda Date: Mon, 8 Nov 2021 19:28:25 -0300 Subject: [PATCH] Add debian package for tools/engtools Add debian packaging infrastructure for tools/engtools to build a debian package. Test Plan: PASS: Built package PASS: Built iso PASS: Installed controller Story: 2009101 Task: 43875 Signed-off-by: Ramon Gazoni Lacerda Change-Id: Ice77221ec26461bd3d6489a17f119a581ff92229 --- .../debian/deb_folder/changelog | 5 ++ .../debian/deb_folder/control | 19 ++++++ .../debian/deb_folder/copyright | 44 ++++++++++++++ .../debian/deb_folder/engtools.install | 4 ++ .../debian/deb_folder/rules | 59 +++++++++++++++++++ .../debian/deb_folder/source/format | 1 + .../hostdata-collectors/debian/meta_data.yaml | 7 +++ 7 files changed, 139 insertions(+) create mode 100644 tools/engtools/hostdata-collectors/debian/deb_folder/changelog create mode 100644 tools/engtools/hostdata-collectors/debian/deb_folder/control create mode 100644 tools/engtools/hostdata-collectors/debian/deb_folder/copyright create mode 100644 tools/engtools/hostdata-collectors/debian/deb_folder/engtools.install create mode 100755 tools/engtools/hostdata-collectors/debian/deb_folder/rules create mode 100644 tools/engtools/hostdata-collectors/debian/deb_folder/source/format create mode 100644 tools/engtools/hostdata-collectors/debian/meta_data.yaml diff --git a/tools/engtools/hostdata-collectors/debian/deb_folder/changelog b/tools/engtools/hostdata-collectors/debian/deb_folder/changelog new file mode 100644 index 00000000..b1dff2c9 --- /dev/null +++ b/tools/engtools/hostdata-collectors/debian/deb_folder/changelog @@ -0,0 +1,5 @@ +engtools (1.0-1) unstable; urgency=medium + + * Initial release. + + -- Ramon Gazoni Lacerda Tue, 02 Nov 2021 17:43:52 -0300 diff --git a/tools/engtools/hostdata-collectors/debian/deb_folder/control b/tools/engtools/hostdata-collectors/debian/deb_folder/control new file mode 100644 index 00000000..ce40d0a4 --- /dev/null +++ b/tools/engtools/hostdata-collectors/debian/deb_folder/control @@ -0,0 +1,19 @@ +Source: engtools +Section: admin +Priority: optional +Maintainer: StarlingX Developers +Build-Depends: debhelper-compat (= 13) +Standards-Version: 4.1.2 +Homepage: https://www.starlingx.io + +Package: engtools +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, + iperf3, + python3-six, + python3-psutil +Description: Host performance data collection tools package + This package contains data collection tools to monitor host performance. + Tools are general purpose engineering and debugging related. Includes + overall memory, cpu occupancy, per-task cpu, per-task scheduling, per-task + io. diff --git a/tools/engtools/hostdata-collectors/debian/deb_folder/copyright b/tools/engtools/hostdata-collectors/debian/deb_folder/copyright new file mode 100644 index 00000000..f35d90cc --- /dev/null +++ b/tools/engtools/hostdata-collectors/debian/deb_folder/copyright @@ -0,0 +1,44 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: engtools +Upstream-Contact: StarlingX Developers +Source: https://opendev.org/starlingx/utilities/ + +Files: * +Copyright: + (c) 2013-2021 Wind River Systems, Inc + (c) Others (See individual files for more details) +License: Apache-2 + 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'. + +# If you want to use GPL v2 or later for the /debian/* files use +# the following clauses, or change it to suit. Delete these two lines +Files: debian/* +Copyright: 2021 Wind River Systems, Inc +License: Apache-2 + 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/tools/engtools/hostdata-collectors/debian/deb_folder/engtools.install b/tools/engtools/hostdata-collectors/debian/deb_folder/engtools.install new file mode 100644 index 00000000..92321ff5 --- /dev/null +++ b/tools/engtools/hostdata-collectors/debian/deb_folder/engtools.install @@ -0,0 +1,4 @@ +usr/local/bin/* usr/local/bin +etc/engtools/* etc/engtools +etc/init.d/* etc/init.d +etc/systemd/system/* etc/systemd/system diff --git a/tools/engtools/hostdata-collectors/debian/deb_folder/rules b/tools/engtools/hostdata-collectors/debian/deb_folder/rules new file mode 100755 index 00000000..47a7fa8b --- /dev/null +++ b/tools/engtools/hostdata-collectors/debian/deb_folder/rules @@ -0,0 +1,59 @@ +#!/usr/bin/make -f +#export DH_VERBOSE = 1 + +export ROOT = debian/tmp +export BINDIR = $(ROOT)/usr/local/bin +export INITDIR = $(ROOT)/etc/init.d +export CONFDIR = $(ROOT)/etc/engtools +export SYSTEMDDIR = $(ROOT)/etc/systemd/system + +%: + dh $@ + + +override_dh_auto_build: + echo "do nothing" + +override_dh_auto_install: + + install -d 755 $(BINDIR) + # Installing additional tools, memtop, occtop and schedtop are already in the image + install -m 755 buddyinfo.py $(BINDIR) + install -m 755 chewmem $(BINDIR) + # Installing data collection scripts + install -m 755 ceph.sh $(BINDIR) + install -m 755 cleanup-engtools.sh $(BINDIR) + install -m 755 collect-engtools.sh $(BINDIR) + install -m 755 diskstats.sh $(BINDIR) + install -m 755 engtools_util.sh $(BINDIR) + install -m 755 filestats.sh $(BINDIR) + install -m 755 iostat.sh $(BINDIR) + install -m 755 linux_benchmark.sh $(BINDIR) + install -m 755 memstats.sh $(BINDIR) + install -m 755 netstats.sh $(BINDIR) + install -m 755 postgres.sh $(BINDIR) + install -m 755 rabbitmq.sh $(BINDIR) + install -m 755 remote/rbzip2-engtools.sh $(BINDIR) + install -m 755 remote/rstart-engtools.sh $(BINDIR) + install -m 755 remote/rstop-engtools.sh $(BINDIR) + install -m 755 remote/rsync-engtools-data.sh $(BINDIR) + install -m 755 slab.sh $(BINDIR) + install -m 755 ticker.sh $(BINDIR) + install -m 755 top.sh $(BINDIR) + install -m 755 vswitch.sh $(BINDIR) + install -m 755 live_stream.py $(BINDIR) + # Installing conf file + install -d 755 $(CONFDIR) + install -m 644 -p -D cfg/engtools.conf $(CONFDIR) + # Installing init script + install -d 755 $(INITDIR) + install -m 755 init.d/collect-engtools.sh $(INITDIR) + # Installing service file + install -d 755 $(SYSTEMDDIR) + install -m 644 -p -D collect-engtools.service $(SYSTEMDDIR) + +override_dh_installsystemd: + dh_installsystemd --name collect-engtools + +override_dh_usrlocal: + echo 'do nothing' diff --git a/tools/engtools/hostdata-collectors/debian/deb_folder/source/format b/tools/engtools/hostdata-collectors/debian/deb_folder/source/format new file mode 100644 index 00000000..163aaf8d --- /dev/null +++ b/tools/engtools/hostdata-collectors/debian/deb_folder/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/tools/engtools/hostdata-collectors/debian/meta_data.yaml b/tools/engtools/hostdata-collectors/debian/meta_data.yaml new file mode 100644 index 00000000..b70b31de --- /dev/null +++ b/tools/engtools/hostdata-collectors/debian/meta_data.yaml @@ -0,0 +1,7 @@ +--- +debname: engtools +debver: 1.0-1 +src_path: scripts +revision: + dist: $STX_DIST + PKG_GITREVCOUNT: true