From a997786271c2bdde097dc7841ad26c5123911463 Mon Sep 17 00:00:00 2001 From: Thales Elero Cervi Date: Fri, 3 Feb 2023 11:34:50 -0300 Subject: [PATCH] Debian: Add build structure for openvswitch-config This change adds the necessary files for the opensvswitch-config package to be built for Debian. Test Plan: PASS: Build the openvswitch-config.deb package PASS: Ensure the delivered files paths are correct PASS: Build Debian ISO with openvswitch-config package Story: 2010317 Task: 47276 Signed-off-by: Thales Elero Cervi Change-Id: I4f74192ee284ce351a253a4394f2f21545128612 --- debian_iso_image.inc | 3 ++ debian_pkg_dirs | 1 + .../debian/deb_folder/changelog | 5 +++ openvswitch-config/debian/deb_folder/control | 14 +++++++ .../debian/deb_folder/copyright | 42 +++++++++++++++++++ .../deb_folder/openvswitch-config.install | 2 + .../deb_folder/openvswitch-config.postinst | 41 ++++++++++++++++++ openvswitch-config/debian/deb_folder/rules | 28 +++++++++++++ .../debian/deb_folder/source/format | 1 + openvswitch-config/debian/meta_data.yaml | 9 ++++ 10 files changed, 146 insertions(+) create mode 100644 openvswitch-config/debian/deb_folder/changelog create mode 100644 openvswitch-config/debian/deb_folder/control create mode 100644 openvswitch-config/debian/deb_folder/copyright create mode 100644 openvswitch-config/debian/deb_folder/openvswitch-config.install create mode 100644 openvswitch-config/debian/deb_folder/openvswitch-config.postinst create mode 100644 openvswitch-config/debian/deb_folder/rules create mode 100644 openvswitch-config/debian/deb_folder/source/format create mode 100644 openvswitch-config/debian/meta_data.yaml diff --git a/debian_iso_image.inc b/debian_iso_image.inc index 34fc49a..4858580 100644 --- a/debian_iso_image.inc +++ b/debian_iso_image.inc @@ -63,6 +63,9 @@ openldap-config #openssh-config openssh-config +#openvswitch-config +openvswitch-config + #pam-config pam-config diff --git a/debian_pkg_dirs b/debian_pkg_dirs index 6f34c31..c87fd9b 100644 --- a/debian_pkg_dirs +++ b/debian_pkg_dirs @@ -20,6 +20,7 @@ nfs-utils-config ntp-config openldap-config openssh-config +openvswitch-config pam-config python-siteconfig rabbitmq-server-config diff --git a/openvswitch-config/debian/deb_folder/changelog b/openvswitch-config/debian/deb_folder/changelog new file mode 100644 index 0000000..4fb92b7 --- /dev/null +++ b/openvswitch-config/debian/deb_folder/changelog @@ -0,0 +1,5 @@ +openvswitch-config (1.0.0-1) unstable; urgency=medium + + * Initial release. + + -- Thales Elero Cervi Fri, 03 Feb 2023 10:00:00 -0400 diff --git a/openvswitch-config/debian/deb_folder/control b/openvswitch-config/debian/deb_folder/control new file mode 100644 index 0000000..d7f6db0 --- /dev/null +++ b/openvswitch-config/debian/deb_folder/control @@ -0,0 +1,14 @@ +Source: openvswitch-config +Section: admin +Priority: optional +Maintainer: Wind River +Build-Depends: debhelper-compat (= 13) +Standards-Version: 4.5.1 + +Package: openvswitch-config +Section: admin +Depends: + openvswitch-switch | openvswitch-switch-dpdk + ${misc:Depends} +Architecture: any +Description: StarlingX openvswitch configuration file diff --git a/openvswitch-config/debian/deb_folder/copyright b/openvswitch-config/debian/deb_folder/copyright new file mode 100644 index 0000000..19b1d45 --- /dev/null +++ b/openvswitch-config/debian/deb_folder/copyright @@ -0,0 +1,42 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: openvswitch-config +Source: https://opendev.org/starlingx/config-files + +Files: * +Copyright: (c) 2019 Intel Corporation + (c) 2023 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'. + +# 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: 2023 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'. \ No newline at end of file diff --git a/openvswitch-config/debian/deb_folder/openvswitch-config.install b/openvswitch-config/debian/deb_folder/openvswitch-config.install new file mode 100644 index 0000000..9c0c788 --- /dev/null +++ b/openvswitch-config/debian/deb_folder/openvswitch-config.install @@ -0,0 +1,2 @@ +etc/openvswitch/*.pmon.conf +usr/share/starlingx/etc_logrotate.d_openvswitch \ No newline at end of file diff --git a/openvswitch-config/debian/deb_folder/openvswitch-config.postinst b/openvswitch-config/debian/deb_folder/openvswitch-config.postinst new file mode 100644 index 0000000..1493f7c --- /dev/null +++ b/openvswitch-config/debian/deb_folder/openvswitch-config.postinst @@ -0,0 +1,41 @@ +#!/bin/sh +# postinst script for openvswitch-config +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +case "$1" in + configure) + cp -f /usr/share/starlingx/etc_logrotate.d_openvswitch /etc/logrotate.d/openvswitch-switch + chmod 0644 /etc/logrotate.d/openvswitch-switch + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/openvswitch-config/debian/deb_folder/rules b/openvswitch-config/debian/deb_folder/rules new file mode 100644 index 0000000..cf6c361 --- /dev/null +++ b/openvswitch-config/debian/deb_folder/rules @@ -0,0 +1,28 @@ +#!/usr/bin/make -f +# +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright (C) 2023 Wind River Systems, Inc +# + +# export DH_VERBOSE = 1 + +export APP_NAME=openvswitch-config +export PBR_VERSION=1.0.0-1 +export ROOT=debian/tmp +export SRC_DIR=files +export SYSCONF_DIR=$(ROOT)/etc +export SYSCONF_OVS=$(SYSCONF_DIR)/openvswitch +export DATA_DIR=$(ROOT)/usr/share +export DATA_STX=$(DATA_DIR)/starlingx + + +%: + dh $@ + +override_dh_auto_install: + install -d -m 0755 $(SYSCONF_OVS) + install -m 0644 $(SRC_DIR)/ovsdb-server.pmon.conf $(SYSCONF_OVS) + install -m 0644 $(SRC_DIR)/ovs-vswitchd.pmon.conf $(SYSCONF_OVS) + install -d $(DATA_STX) + install -m 0640 $(SRC_DIR)/etc_logrotate.d_openvswitch $(DATA_STX) diff --git a/openvswitch-config/debian/deb_folder/source/format b/openvswitch-config/debian/deb_folder/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/openvswitch-config/debian/deb_folder/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/openvswitch-config/debian/meta_data.yaml b/openvswitch-config/debian/meta_data.yaml new file mode 100644 index 0000000..1c5aeeb --- /dev/null +++ b/openvswitch-config/debian/meta_data.yaml @@ -0,0 +1,9 @@ +--- +debname: openvswitch-config +debver: 1.0.0 +src_path: ${MY_REPO}/stx/config-files/openvswitch-config +revision: + dist: $STX_DIST + PKG_GITREVCOUNT: true + SRC_GITREVCOUNT: + SRC_BASE_SRCREV: 400d88272da416b49fe555e319e076804234dd5d