blob: 6480be1da80c9053fc3eea5b45b7db5a213a9f01 [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 \
William A. Kennington III1ef795b2021-03-10 18:59:12 -080012 file://gbmc-ncsi-nft.sh.in \
William A. Kennington IIIe99168a2021-03-10 23:40:47 -080013 file://gbmc-ncsi-br-pub-addr.sh.in \
Vivekanand Veeracholane3f33702021-06-16 15:29:15 -070014 file://gbmc-ncsi-set-nicenabled.service.in \
William A. Kennington III7f11d1f2021-02-16 14:57:41 -080015 "
William A. Kennington IIIf19a8382021-02-16 14:16:47 -080016
17S = "${WORKDIR}"
18
Willy Tu4dd03ca2021-08-06 09:37:35 -070019RDEPENDS:${PN} += " \
William A. Kennington III1ef795b2021-03-10 18:59:12 -080020 gbmc-ip-monitor \
William A. Kennington III7f11d1f2021-02-16 14:57:41 -080021 ncsid \
22 nftables-systemd \
23 sslh \
24 "
William A. Kennington IIIf19a8382021-02-16 14:16:47 -080025
Willy Tu4dd03ca2021-08-06 09:37:35 -070026FILES:${PN} += " \
William A. Kennington III1ef795b2021-03-10 18:59:12 -080027 ${datadir}/gbmc-ip-monitor \
28 ${systemd_unitdir} \
29 "
William A. Kennington IIIf19a8382021-02-16 14:16:47 -080030
Willy Tu4dd03ca2021-08-06 09:37:35 -070031SYSTEMD_SERVICE:${PN} += " \
William A. Kennington III7f11d1f2021-02-16 14:57:41 -080032 gbmc-ncsi-sslh.service \
33 gbmc-ncsi-sslh.socket \
Vivekanand Veeracholane3f33702021-06-16 15:29:15 -070034 gbmc-ncsi-set-nicenabled.service \
William A. Kennington III7f11d1f2021-02-16 14:57:41 -080035 "
36
Willy Tu4dd03ca2021-08-06 09:37:35 -070037do_install:append() {
William A. Kennington IIIf19a8382021-02-16 14:16:47 -080038 if_name='${GBMC_NCSI_IF_NAME}'
William A. Kennington IIIf19a8382021-02-16 14:16:47 -080039 if [ -z "$if_name" ]; then
40 echo "Missing if_name" >&2
41 exit 1
42 fi
43
44 install -d -m0755 ${D}${sysconfdir}/sysctl.d
45 echo "net.ipv6.conf.$if_name.accept_dad=0" \
46 >>${D}${sysconfdir}/sysctl.d/25-gbmc-ncsi.conf
47 echo "net.ipv6.conf.$if_name.dad_transmits=0" \
48 >>${D}${sysconfdir}/sysctl.d/25-gbmc-ncsi.conf
49
50 netdir=${D}${systemd_unitdir}/network/00-bmc-$if_name.network.d
51 install -d -m0755 "$netdir"
52 echo '[Network]' >>"$netdir"/gbmc-ncsi.conf
53 echo 'DHCP=false' >>"$netdir"/gbmc-ncsi.conf
54 echo 'IPv6AcceptRA=false' >>"$netdir"/gbmc-ncsi.conf
55 echo 'LLMNR=false' >>"$netdir"/gbmc-ncsi.conf
56 echo 'MulticastDNS=false' >>"$netdir"/gbmc-ncsi.conf
57 echo 'LinkLocalAddressing=ipv6' >>"$netdir"/gbmc-ncsi.conf
58
59 nftdir=${D}${sysconfdir}/nftables
60 install -d -m0755 "$nftdir"
William A. Kennington III1ef795b2021-03-10 18:59:12 -080061 sed "s,@NCSI_IF@,$if_name,g" ${WORKDIR}/50-gbmc-ncsi.rules.in \
William A. Kennington IIIf19a8382021-02-16 14:16:47 -080062 >"$nftdir"/50-gbmc-ncsi.rules
63
64 wantdir=${D}${systemd_system_unitdir}/multi-user.target.wants
65 install -d -m0755 "$wantdir"
66 ln -sv ../ncsid@.service "$wantdir"/ncsid@$if_name.service
William A. Kennington III7f11d1f2021-02-16 14:57:41 -080067
68 install -m 0644 ${WORKDIR}/gbmc-ncsi-sslh.service ${D}${systemd_system_unitdir}
William A. Kennington III1ef795b2021-03-10 18:59:12 -080069 sed "s,@NCSI_IF@,$if_name,g" ${WORKDIR}/gbmc-ncsi-sslh.socket.in \
William A. Kennington III7f11d1f2021-02-16 14:57:41 -080070 >${D}${systemd_system_unitdir}/gbmc-ncsi-sslh.socket
William A. Kennington III1ef795b2021-03-10 18:59:12 -080071
72 mondir=${D}${datadir}/gbmc-ip-monitor/
73 install -d -m0755 $mondir
74 sed "s,@NCSI_IF@,$if_name,g" ${WORKDIR}/gbmc-ncsi-nft.sh.in \
75 >${WORKDIR}/gbmc-ncsi-nft.sh
76 install -m644 ${WORKDIR}/gbmc-ncsi-nft.sh $mondir
William A. Kennington IIIe99168a2021-03-10 23:40:47 -080077 sed "s,@NCSI_IF@,$if_name,g" ${WORKDIR}/gbmc-ncsi-br-pub-addr.sh.in \
78 >${WORKDIR}/gbmc-ncsi-br-pub-addr.sh
79 install -m644 ${WORKDIR}/gbmc-ncsi-br-pub-addr.sh $mondir
Vivekanand Veeracholane3f33702021-06-16 15:29:15 -070080
81 sed "s,@NCSI_IF@,$if_name,g" ${WORKDIR}/gbmc-ncsi-set-nicenabled.service.in \
82 >${D}${systemd_system_unitdir}/gbmc-ncsi-set-nicenabled.service
William A. Kennington IIIf19a8382021-02-16 14:16:47 -080083}