blob: 848ab842ebd752116a430609bb577c1a59918ecf [file] [log] [blame]
William A. Kennington IIIf19a8382021-02-16 14:16:47 -08001SUMMARY = "Configures ncsi for a gBMC system"
2PR = "r1"
3LICENSE = "Apache-2.0"
4LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
5
6inherit systemd
7
8SRC_URI += "file://50-gbmc-ncsi.rules.in"
9
10S = "${WORKDIR}"
11
12RDEPENDS_${PN} += "ncsid"
13
14FILES_${PN} += "${systemd_unitdir}"
15
16RPROVIDES_${PN} += "ncsid-config"
17
18do_install_append() {
19 if_name='${GBMC_NCSI_IF_NAME}'
20 test -z "$if_name" && if_name='${NCSID_IF_NAME}'
21 test -z "$if_name" && if_name='${GOOGLE_NCSI_IF_NAME}'
22 if [ -z "$if_name" ]; then
23 echo "Missing if_name" >&2
24 exit 1
25 fi
26
27 install -d -m0755 ${D}${sysconfdir}/sysctl.d
28 echo "net.ipv6.conf.$if_name.accept_dad=0" \
29 >>${D}${sysconfdir}/sysctl.d/25-gbmc-ncsi.conf
30 echo "net.ipv6.conf.$if_name.dad_transmits=0" \
31 >>${D}${sysconfdir}/sysctl.d/25-gbmc-ncsi.conf
32
33 netdir=${D}${systemd_unitdir}/network/00-bmc-$if_name.network.d
34 install -d -m0755 "$netdir"
35 echo '[Network]' >>"$netdir"/gbmc-ncsi.conf
36 echo 'DHCP=false' >>"$netdir"/gbmc-ncsi.conf
37 echo 'IPv6AcceptRA=false' >>"$netdir"/gbmc-ncsi.conf
38 echo 'LLMNR=false' >>"$netdir"/gbmc-ncsi.conf
39 echo 'MulticastDNS=false' >>"$netdir"/gbmc-ncsi.conf
40 echo 'LinkLocalAddressing=ipv6' >>"$netdir"/gbmc-ncsi.conf
41
42 nftdir=${D}${sysconfdir}/nftables
43 install -d -m0755 "$nftdir"
44 sed "s,@NCSI_IF@,$if_name," ${WORKDIR}/50-gbmc-ncsi.rules.in \
45 >"$nftdir"/50-gbmc-ncsi.rules
46
47 wantdir=${D}${systemd_system_unitdir}/multi-user.target.wants
48 install -d -m0755 "$wantdir"
49 ln -sv ../ncsid@.service "$wantdir"/ncsid@$if_name.service
50}