William A. Kennington III | f19a838 | 2021-02-16 14:16:47 -0800 | [diff] [blame] | 1 | SUMMARY = "Configures ncsi for a gBMC system" |
| 2 | PR = "r1" |
| 3 | LICENSE = "Apache-2.0" |
| 4 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" |
| 5 | |
| 6 | inherit systemd |
| 7 | |
| 8 | SRC_URI += "file://50-gbmc-ncsi.rules.in" |
| 9 | |
| 10 | S = "${WORKDIR}" |
| 11 | |
| 12 | RDEPENDS_${PN} += "ncsid" |
William A. Kennington III | d45e4b3 | 2021-02-16 14:27:24 -0800 | [diff] [blame^] | 13 | RDEPENDS_${PN} += "nftables-systemd" |
| 14 | RDEPENDS_${PN} += "gbmc-sslh" |
William A. Kennington III | f19a838 | 2021-02-16 14:16:47 -0800 | [diff] [blame] | 15 | |
| 16 | FILES_${PN} += "${systemd_unitdir}" |
| 17 | |
| 18 | RPROVIDES_${PN} += "ncsid-config" |
| 19 | |
| 20 | do_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 | } |