summaryrefslogtreecommitdiff
path: root/meta-google/recipes-google/ncsi
diff options
context:
space:
mode:
authorWilliam A. Kennington III <wak@google.com>2021-02-09 05:46:45 +0300
committerWilliam A. Kennington III <wak@google.com>2021-02-09 07:03:04 +0300
commit24bf30d24bb81c52b23b1eba9ac410ab7e90bcb7 (patch)
tree8647a8e8ebc6d7bd1866fa824e9b1cb084bbc83a /meta-google/recipes-google/ncsi
parentc472176ad6c41cd1579ae106d92270cb1a63d447 (diff)
downloadopenbmc-24bf30d24bb81c52b23b1eba9ac410ab7e90bcb7.tar.xz
meta-google: Add ncsid-config package
Google-Bug-Id: 179618497 Change-Id: Id0ba358215054159e1d9a2329ae2393b5b9eeabf Signed-off-by: William A. Kennington III <wak@google.com>
Diffstat (limited to 'meta-google/recipes-google/ncsi')
-rw-r--r--meta-google/recipes-google/ncsi/ncsid-config.bb39
1 files changed, 39 insertions, 0 deletions
diff --git a/meta-google/recipes-google/ncsi/ncsid-config.bb b/meta-google/recipes-google/ncsi/ncsid-config.bb
new file mode 100644
index 000000000..339ce2f34
--- /dev/null
+++ b/meta-google/recipes-google/ncsi/ncsid-config.bb
@@ -0,0 +1,39 @@
+SUMMARY = "Configures ncsid for a gBMC system"
+PR = "r1"
+LICENSE = "CLOSED"
+
+inherit systemd
+
+SRC_URI += "file://50-ncsi.rules.in"
+
+S = "${WORKDIR}"
+
+RDEPENDS_${PN} += "ncsid"
+
+FILES_${PN} += "${systemd_unitdir}"
+
+do_install_append() {
+ 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
+}