From f19a8381cec954bc1e0e440e2e60c9ea3c58d324 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Tue, 16 Feb 2021 14:16:47 -0800 Subject: meta-google: gbmc-ncsi-config: Rename from ncsid-config Make it clear this is a gbmc style configuration, similar to gbmc-systemd-config or gbmc-iperf3. Change-Id: Icd9a2f45f5b399ecb3f8ab1a63d1f0344342ab3a Signed-off-by: William A. Kennington III --- .../ncsi/files/50-gbmc-ncsi.rules.in | 14 ++++++ .../recipes-google/ncsi/files/50-ncsi.rules.in | 14 ------ .../recipes-google/ncsi/gbmc-ncsi-config.bb | 50 ++++++++++++++++++++++ meta-google/recipes-google/ncsi/ncsid-config.bb | 45 ------------------- 4 files changed, 64 insertions(+), 59 deletions(-) create mode 100644 meta-google/recipes-google/ncsi/files/50-gbmc-ncsi.rules.in delete mode 100644 meta-google/recipes-google/ncsi/files/50-ncsi.rules.in create mode 100644 meta-google/recipes-google/ncsi/gbmc-ncsi-config.bb delete mode 100644 meta-google/recipes-google/ncsi/ncsid-config.bb (limited to 'meta-google') diff --git a/meta-google/recipes-google/ncsi/files/50-gbmc-ncsi.rules.in b/meta-google/recipes-google/ncsi/files/50-gbmc-ncsi.rules.in new file mode 100644 index 000000000..33031f0db --- /dev/null +++ b/meta-google/recipes-google/ncsi/files/50-gbmc-ncsi.rules.in @@ -0,0 +1,14 @@ +table inet filter { + chain ncsi_input { + type filter hook input priority 0; policy drop; + iifname != @NCSI_IF@ accept + ct state established accept + tcp dport 3959 accept + udp dport 3959 accept + tcp dport 3967 accept + udp dport 3967 accept + icmpv6 type nd-neighbor-advert accept + icmpv6 type nd-neighbor-solicit accept + icmpv6 type nd-router-advert accept + } +} diff --git a/meta-google/recipes-google/ncsi/files/50-ncsi.rules.in b/meta-google/recipes-google/ncsi/files/50-ncsi.rules.in deleted file mode 100644 index 33031f0db..000000000 --- a/meta-google/recipes-google/ncsi/files/50-ncsi.rules.in +++ /dev/null @@ -1,14 +0,0 @@ -table inet filter { - chain ncsi_input { - type filter hook input priority 0; policy drop; - iifname != @NCSI_IF@ accept - ct state established accept - tcp dport 3959 accept - udp dport 3959 accept - tcp dport 3967 accept - udp dport 3967 accept - icmpv6 type nd-neighbor-advert accept - icmpv6 type nd-neighbor-solicit accept - icmpv6 type nd-router-advert accept - } -} diff --git a/meta-google/recipes-google/ncsi/gbmc-ncsi-config.bb b/meta-google/recipes-google/ncsi/gbmc-ncsi-config.bb new file mode 100644 index 000000000..848ab842e --- /dev/null +++ b/meta-google/recipes-google/ncsi/gbmc-ncsi-config.bb @@ -0,0 +1,50 @@ +SUMMARY = "Configures ncsi for a gBMC system" +PR = "r1" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" + +inherit systemd + +SRC_URI += "file://50-gbmc-ncsi.rules.in" + +S = "${WORKDIR}" + +RDEPENDS_${PN} += "ncsid" + +FILES_${PN} += "${systemd_unitdir}" + +RPROVIDES_${PN} += "ncsid-config" + +do_install_append() { + if_name='${GBMC_NCSI_IF_NAME}' + test -z "$if_name" && if_name='${NCSID_IF_NAME}' + test -z "$if_name" && if_name='${GOOGLE_NCSI_IF_NAME}' + if [ -z "$if_name" ]; then + echo "Missing if_name" >&2 + exit 1 + fi + + install -d -m0755 ${D}${sysconfdir}/sysctl.d + echo "net.ipv6.conf.$if_name.accept_dad=0" \ + >>${D}${sysconfdir}/sysctl.d/25-gbmc-ncsi.conf + echo "net.ipv6.conf.$if_name.dad_transmits=0" \ + >>${D}${sysconfdir}/sysctl.d/25-gbmc-ncsi.conf + + netdir=${D}${systemd_unitdir}/network/00-bmc-$if_name.network.d + install -d -m0755 "$netdir" + echo '[Network]' >>"$netdir"/gbmc-ncsi.conf + echo 'DHCP=false' >>"$netdir"/gbmc-ncsi.conf + echo 'IPv6AcceptRA=false' >>"$netdir"/gbmc-ncsi.conf + echo 'LLMNR=false' >>"$netdir"/gbmc-ncsi.conf + echo 'MulticastDNS=false' >>"$netdir"/gbmc-ncsi.conf + echo 'LinkLocalAddressing=ipv6' >>"$netdir"/gbmc-ncsi.conf + + nftdir=${D}${sysconfdir}/nftables + install -d -m0755 "$nftdir" + sed "s,@NCSI_IF@,$if_name," ${WORKDIR}/50-gbmc-ncsi.rules.in \ + >"$nftdir"/50-gbmc-ncsi.rules + + wantdir=${D}${systemd_system_unitdir}/multi-user.target.wants + install -d -m0755 "$wantdir" + ln -sv ../ncsid@.service "$wantdir"/ncsid@$if_name.service +} diff --git a/meta-google/recipes-google/ncsi/ncsid-config.bb b/meta-google/recipes-google/ncsi/ncsid-config.bb deleted file mode 100644 index e5d77761a..000000000 --- a/meta-google/recipes-google/ncsi/ncsid-config.bb +++ /dev/null @@ -1,45 +0,0 @@ -SUMMARY = "Configures ncsid for a system" -PR = "r1" -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" - -inherit systemd - -SRC_URI += "file://50-ncsi.rules.in" - -S = "${WORKDIR}" - -RDEPENDS_${PN} += "ncsid" - -FILES_${PN} += "${systemd_unitdir}" - -do_install_append() { - if [ -z "${NCSID_IF_NAME}" ]; then - echo "Missing NCSID_IF_NAME" >&2 - exit 1 - fi - - install -d -m0755 ${D}${sysconfdir}/sysctl.d - echo "net.ipv6.conf.${NCSID_IF_NAME}.accept_dad=0" \ - >>${D}${sysconfdir}/sysctl.d/25-nodad.conf - echo "net.ipv6.conf.${NCSID_IF_NAME}.dad_transmits=0" \ - >>${D}${sysconfdir}/sysctl.d/25-nodad.conf - - netdir=${D}${systemd_unitdir}/network/00-bmc-${NCSID_IF_NAME}.network.d - install -d -m0755 "$netdir" - echo '[Network]' >>"$netdir"/ncsi.conf - echo 'DHCP=false' >>"$netdir"/ncsi.conf - echo 'IPv6AcceptRA=false' >>"$netdir"/ncsi.conf - echo 'LLMNR=false' >>"$netdir"/ncsi.conf - echo 'MulticastDNS=false' >>"$netdir"/ncsi.conf - echo 'LinkLocalAddressing=ipv6' >>"$netdir"/ncsi.conf - - nftdir=${D}${sysconfdir}/nftables - install -d -m0755 "$nftdir" - sed "s,@NCSI_IF@,${NCSID_IF_NAME}," ${WORKDIR}/50-ncsi.rules.in \ - >"$nftdir"/50-ncsi.rules - - wantdir=${D}${systemd_system_unitdir}/multi-user.target.wants - install -d -m0755 "$wantdir" - ln -sv ../ncsid@.service "$wantdir"/ncsid@${NCSID_IF_NAME}.service -} -- cgit v1.2.3