blob: ecdda2cb60b9a8257c0c87912eb2e937c6ee5ca7 [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
William A. Kennington III7f11d1f2021-02-16 14:57:41 -08008SRC_URI += " \
9 file://50-gbmc-ncsi.rules.in \
10 file://gbmc-ncsi-sslh.socket.in \
11 file://gbmc-ncsi-sslh.service \
12 "
William A. Kennington IIIf19a8382021-02-16 14:16:47 -080013
14S = "${WORKDIR}"
15
William A. Kennington III7f11d1f2021-02-16 14:57:41 -080016RDEPENDS_${PN} += " \
17 ncsid \
18 nftables-systemd \
19 sslh \
20 "
William A. Kennington IIIf19a8382021-02-16 14:16:47 -080021
22FILES_${PN} += "${systemd_unitdir}"
23
William A. Kennington III7f11d1f2021-02-16 14:57:41 -080024SYSTEMD_SERVICE_${PN} += " \
25 gbmc-ncsi-sslh.service \
26 gbmc-ncsi-sslh.socket \
27 "
28
William A. Kennington IIIf19a8382021-02-16 14:16:47 -080029do_install_append() {
30 if_name='${GBMC_NCSI_IF_NAME}'
William A. Kennington IIIf19a8382021-02-16 14:16:47 -080031 if [ -z "$if_name" ]; then
32 echo "Missing if_name" >&2
33 exit 1
34 fi
35
36 install -d -m0755 ${D}${sysconfdir}/sysctl.d
37 echo "net.ipv6.conf.$if_name.accept_dad=0" \
38 >>${D}${sysconfdir}/sysctl.d/25-gbmc-ncsi.conf
39 echo "net.ipv6.conf.$if_name.dad_transmits=0" \
40 >>${D}${sysconfdir}/sysctl.d/25-gbmc-ncsi.conf
41
42 netdir=${D}${systemd_unitdir}/network/00-bmc-$if_name.network.d
43 install -d -m0755 "$netdir"
44 echo '[Network]' >>"$netdir"/gbmc-ncsi.conf
45 echo 'DHCP=false' >>"$netdir"/gbmc-ncsi.conf
46 echo 'IPv6AcceptRA=false' >>"$netdir"/gbmc-ncsi.conf
47 echo 'LLMNR=false' >>"$netdir"/gbmc-ncsi.conf
48 echo 'MulticastDNS=false' >>"$netdir"/gbmc-ncsi.conf
49 echo 'LinkLocalAddressing=ipv6' >>"$netdir"/gbmc-ncsi.conf
50
51 nftdir=${D}${sysconfdir}/nftables
52 install -d -m0755 "$nftdir"
53 sed "s,@NCSI_IF@,$if_name," ${WORKDIR}/50-gbmc-ncsi.rules.in \
54 >"$nftdir"/50-gbmc-ncsi.rules
55
56 wantdir=${D}${systemd_system_unitdir}/multi-user.target.wants
57 install -d -m0755 "$wantdir"
58 ln -sv ../ncsid@.service "$wantdir"/ncsid@$if_name.service
William A. Kennington III7f11d1f2021-02-16 14:57:41 -080059
60 install -m 0644 ${WORKDIR}/gbmc-ncsi-sslh.service ${D}${systemd_system_unitdir}
61 sed "s,@NCSI_IF@,$if_name," ${WORKDIR}/gbmc-ncsi-sslh.socket.in \
62 >${D}${systemd_system_unitdir}/gbmc-ncsi-sslh.socket
William A. Kennington IIIf19a8382021-02-16 14:16:47 -080063}