12dcea7187f0524cf369c222628644c298c6d62d
[AGL/meta-agl-demo.git] / recipes-config / cluster-demo-network-config / cluster-demo-network-config_1.0.bb
1 SUMMARY     = "Setting files for cluster network for the AGL Demonstrator"
2 DESCRIPTION = "Setting files for cluster network for the AGL Demonstrator"
3 LICENSE     = "MIT"
4 LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
5
6 inherit systemd allarch
7
8 SRC_URI = "file://cluster-demo-network-conf@.service \
9            file://cluster-demo-network-conf.sh \
10 "
11
12 S = "${WORKDIR}/sources"
13 UNPACKDIR = "${S}"
14
15 # Network device for dedicated connection to cluster
16 AGL_CLUSTER_NET_DEVICE ?= "eth1"
17
18 do_configure[noexec] = "1"
19 do_compile[noexec] = "1"
20
21 do_install() {
22     # Install helper script
23     install -d ${D}${sbindir}
24     install -m 0755 ${UNPACKDIR}/cluster-demo-network-conf.sh ${D}${sbindir}/
25
26     # Install service unit
27     install -d ${D}${systemd_system_unitdir}
28     install -m 0644 ${UNPACKDIR}/cluster-demo-network-conf@.service ${D}${systemd_system_unitdir}/
29
30     # Add symlink to network.target.wants
31     install -d ${D}${sysconfdir}/systemd/system/network.target.wants
32     ln -s ${systemd_system_unitdir}/cluster-demo-network-conf@.service \
33         ${D}${sysconfdir}/systemd/system/network.target.wants/cluster-demo-network-conf@${AGL_CLUSTER_NET_DEVICE}.service
34 }
35
36 FILES:${PN} += "${systemd_system_unitdir}"