From 22648abc696a6c3fbbd07f28a0bf5a19e933cc41 Mon Sep 17 00:00:00 2001 From: Jackie Huang Date: Tue, 22 Jun 2021 15:40:49 +0800 Subject: [PATCH] net-snmp: remove the bbappend * remove the bbappend since net-snmp-config is removed from config-files repo: `````````````````````````````````````````````` commit 35160afbdada2efe0ff567dd94ca1419903c87ad Author: Nicolas Alvarez Date: Tue Dec 8 17:26:18 2020 -0300 Disable SNMP Host-Based from config-files repo. Due to SNMP is going to be containerized, we disable it from starlingx/config-files repo. Story: 2008132 Task: 41381 Depends-On: https://review.opendev.org/765381 Signed-off-by: Nicolas Alvarez `````````````````````````````````````````````` * remove net-snmp from the RDEPENDS in packagegroup-stx and fm-mgr since it's not required to be installed. * move the useradd/groupadd into EXTRA_USERS_PARAMS_CONFIG in poky-stx.conf. Story: 2008952 Task: 42576 Signed-off-by: Jackie Huang Change-Id: I200e1cee7a70e643e6db449667929b44b721c299 --- meta-stx-distro/conf/distro/poky-stx.conf | 4 ++ .../packagegroups/packagegroup-stx.bb | 3 -- meta-stx-flock/stx-fault/fm-mgr.bb | 2 - .../net-snmp/net-snmp_%.bbappend | 53 ------------------- 4 files changed, 4 insertions(+), 58 deletions(-) delete mode 100644 meta-stx-integ/recipes-protocols/net-snmp/net-snmp_%.bbappend diff --git a/meta-stx-distro/conf/distro/poky-stx.conf b/meta-stx-distro/conf/distro/poky-stx.conf index 11eb93b..ade6bbb 100644 --- a/meta-stx-distro/conf/distro/poky-stx.conf +++ b/meta-stx-distro/conf/distro/poky-stx.conf @@ -51,6 +51,10 @@ EXTRA_USERS_PARAMS_CONFIG = "\ usermod -a -G nfv nfv; \ useradd -p '' www; \ groupadd www; \ + \ + groupadd -r snmpd; \ + useradd -r -g snmpd -d /usr/share/snmp -s /sbin/nologin -c 'net-snmp' snmpd \ + \ usermod -a -G www www; \ usermod -a -G sys_protected sysadmin; \ usermod -a -G sys_protected sysinv; \ diff --git a/meta-stx-distro/recipes-core/packagegroups/packagegroup-stx.bb b/meta-stx-distro/recipes-core/packagegroups/packagegroup-stx.bb index 47f6bbd..ffe0608 100644 --- a/meta-stx-distro/recipes-core/packagegroups/packagegroup-stx.bb +++ b/meta-stx-distro/recipes-core/packagegroups/packagegroup-stx.bb @@ -77,9 +77,6 @@ RDEPENDS_packagegroup-stx-config-files = " \ procps \ iscsi-initiator-utils \ memcached \ - net-snmp \ - net-snmp-server-snmpd \ - net-snmp-server-snmptrapd \ libpam-runtime \ rabbitmq-server \ rsync \ diff --git a/meta-stx-flock/stx-fault/fm-mgr.bb b/meta-stx-flock/stx-fault/fm-mgr.bb index c39271f..41ee44f 100644 --- a/meta-stx-flock/stx-fault/fm-mgr.bb +++ b/meta-stx-flock/stx-fault/fm-mgr.bb @@ -35,5 +35,3 @@ inherit useradd USERADD_PACKAGES = "fm-mgr" USERADD_PARAM_fm-mgr = "-r -g fm -u 195 -d /var/lib/fm -s /sbin/nologin -c 'fm-mgr' fm" GROUPADD_PARAM_fm-mgr = "-r -g 195 fm" - -RDEPENDS_${PN}_append = " net-snmp-server-snmpd" diff --git a/meta-stx-integ/recipes-protocols/net-snmp/net-snmp_%.bbappend b/meta-stx-integ/recipes-protocols/net-snmp/net-snmp_%.bbappend deleted file mode 100644 index 6a9663e..0000000 --- a/meta-stx-integ/recipes-protocols/net-snmp/net-snmp_%.bbappend +++ /dev/null @@ -1,53 +0,0 @@ -SRCREV_FORMAT = "opendev" -SRCREV_opendev = "d778e862571957ece3c404c0c37d325769772fde" -SUBPATH0 = "net-snmp-config" -DSTSUFX0 = "stx-configfiles" - -LICENSE_append = "& Apache-2.0" -LIC_FILES_CHKSUM += "\ - file://stx-configfiles-LICENSE;beginline=1;endline=10;md5=ea07d0b28c02168e45abc208d8193e1a \ - " - -SRC_URI += " \ - git://opendev.org/starlingx/config-files.git;protocol=https;destsuffix=${DSTSUFX0};branch="r/stx.3.0";subpath=${SUBPATH0};name=opendev \ - " - -inherit useradd - -USERADD_PACKAGES = "net-snmp-server-snmpd" -USERADD_PARAM_net-snmp-server-snmpd = "-r -g snmpd -d /usr/share/snmp -s /sbin/nologin -c 'net-snmp' snmpd" -GROUPADD_PARAM_net-snmp-server-snmpd = "-r snmpd" - -SYSTEMD_AUTO_ENABLE_${PN}-server-snmpd = "disable" -SYSTEMD_AUTO_ENABLE_${PN}-server-snmptrapd = "disable" - -SYSTEMD_SERVICE_${PN}_append = "snmpd.service" -SYSTEMD_AUTO_ENABLE_${PN} = "disable" - - -do_unpack_append() { - bb.build.exec_func('do_copy_config_files', d) -} - -do_copy_config_files () { - cp -pf ${WORKDIR}/${DSTSUFX0}/centos/net-snmp-config.spec ${S}/stx-configfiles-LICENSE -} - -do_install_append () { - - install -d ${D}/${sysconfdir}/rc.d/init.d - install -d ${D}/${sysconfdir}/init.d - install -d ${D}/${sysconfdir}/systemd/system - - install -m 640 ${WORKDIR}/${DSTSUFX0}/files/stx.snmpd.conf ${D}/${sysconfdir}/snmp/snmpd.conf - install -m 755 ${WORKDIR}/${DSTSUFX0}/files/stx.snmpd ${D}/${sysconfdir}/rc.d/init.d/snmpd - install -m 755 ${WORKDIR}/${DSTSUFX0}/files/stx.snmpd ${D}/${sysconfdir}/init.d/snmpd - install -m 660 ${WORKDIR}/${DSTSUFX0}/files/stx.snmp.conf ${D}/${datadir}/snmp/snmp.conf - install -m 644 ${WORKDIR}/${DSTSUFX0}/files/snmpd.service ${D}/${sysconfdir}/systemd/system/snmpd.service - chmod 640 ${D}/${sysconfdir}/snmp/snmpd.conf - chmod 640 ${D}/${sysconfdir}/snmp/snmptrapd.conf -} - -DISTRO_FEATURES_BACKFILL_CONSIDERED_remove = "sysvinit" - -FILES_${PN}-server-snmpd_append = " ${sysconfdir}/rc.d/init.d/snmpd"