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 | |
William A. Kennington III | 7f11d1f | 2021-02-16 14:57:41 -0800 | [diff] [blame] | 8 | SRC_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 III | f19a838 | 2021-02-16 14:16:47 -0800 | [diff] [blame] | 13 | |
| 14 | S = "${WORKDIR}" |
| 15 | |
William A. Kennington III | 7f11d1f | 2021-02-16 14:57:41 -0800 | [diff] [blame] | 16 | RDEPENDS_${PN} += " \ |
| 17 | ncsid \ |
| 18 | nftables-systemd \ |
| 19 | sslh \ |
| 20 | " |
William A. Kennington III | f19a838 | 2021-02-16 14:16:47 -0800 | [diff] [blame] | 21 | |
| 22 | FILES_${PN} += "${systemd_unitdir}" |
| 23 | |
William A. Kennington III | 7f11d1f | 2021-02-16 14:57:41 -0800 | [diff] [blame] | 24 | SYSTEMD_SERVICE_${PN} += " \ |
| 25 | gbmc-ncsi-sslh.service \ |
| 26 | gbmc-ncsi-sslh.socket \ |
| 27 | " |
| 28 | |
William A. Kennington III | f19a838 | 2021-02-16 14:16:47 -0800 | [diff] [blame] | 29 | do_install_append() { |
| 30 | if_name='${GBMC_NCSI_IF_NAME}' |
William A. Kennington III | f19a838 | 2021-02-16 14:16:47 -0800 | [diff] [blame] | 31 | 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 III | 7f11d1f | 2021-02-16 14:57:41 -0800 | [diff] [blame] | 59 | |
| 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 III | f19a838 | 2021-02-16 14:16:47 -0800 | [diff] [blame] | 63 | } |