blob: 67388b24727b28f80c8f5e7b8505cd892cb741ca [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"
William A. Kennington IIId45e4b32021-02-16 14:27:24 -080013RDEPENDS_${PN} += "nftables-systemd"
14RDEPENDS_${PN} += "gbmc-sslh"
William A. Kennington IIIf19a8382021-02-16 14:16:47 -080015
16FILES_${PN} += "${systemd_unitdir}"
17
18RPROVIDES_${PN} += "ncsid-config"
19
20do_install_append() {
21 if_name='${GBMC_NCSI_IF_NAME}'
22 test -z "$if_name" && if_name='${NCSID_IF_NAME}'
23 test -z "$if_name" && if_name='${GOOGLE_NCSI_IF_NAME}'
24 if [ -z "$if_name" ]; then
25 echo "Missing if_name" >&2
26 exit 1
27 fi
28
29 install -d -m0755 ${D}${sysconfdir}/sysctl.d
30 echo "net.ipv6.conf.$if_name.accept_dad=0" \
31 >>${D}${sysconfdir}/sysctl.d/25-gbmc-ncsi.conf
32 echo "net.ipv6.conf.$if_name.dad_transmits=0" \
33 >>${D}${sysconfdir}/sysctl.d/25-gbmc-ncsi.conf
34
35 netdir=${D}${systemd_unitdir}/network/00-bmc-$if_name.network.d
36 install -d -m0755 "$netdir"
37 echo '[Network]' >>"$netdir"/gbmc-ncsi.conf
38 echo 'DHCP=false' >>"$netdir"/gbmc-ncsi.conf
39 echo 'IPv6AcceptRA=false' >>"$netdir"/gbmc-ncsi.conf
40 echo 'LLMNR=false' >>"$netdir"/gbmc-ncsi.conf
41 echo 'MulticastDNS=false' >>"$netdir"/gbmc-ncsi.conf
42 echo 'LinkLocalAddressing=ipv6' >>"$netdir"/gbmc-ncsi.conf
43
44 nftdir=${D}${sysconfdir}/nftables
45 install -d -m0755 "$nftdir"
46 sed "s,@NCSI_IF@,$if_name," ${WORKDIR}/50-gbmc-ncsi.rules.in \
47 >"$nftdir"/50-gbmc-ncsi.rules
48
49 wantdir=${D}${systemd_system_unitdir}/multi-user.target.wants
50 install -d -m0755 "$wantdir"
51 ln -sv ../ncsid@.service "$wantdir"/ncsid@$if_name.service
52}