guowenxue
2024-01-20 21b5a7e28820ae6c3599f8adff0c3cf7c227a278
commit | author | age
281a7f 1 DESCRIPTION = "Default eth0 and wlan0 network service"
849fbd 2 LICENSE = "GPL-2.0-only"
G 3 LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6"
4
5 inherit systemd
6
7 SYSTEMD_AUTO_ENABLE = "enable"
281a7f 8 SYSTEMD_SERVICE:${PN} = "wpa-conf.service"
849fbd 9
G 10 WLAN_DEV ?= "wlan0"
11
281a7f 12 SRC_URI += " file://10-eth0.network "
849fbd 13 SRC_URI += " file://20-wlan0.network "
G 14 SRC_URI += " file://wpa-conf.service "
15
281a7f 16 FILES:${PN} += "${sysconfdir}/systemd/network/10-eth0.network"
849fbd 17 FILES:${PN} += "${sysconfdir}/systemd/network/20-wlan0.network"
G 18 FILES:${PN} += "${systemd_unitdir}/system/wpa-conf.service"
19
20 do_install() { 
21     install -d ${D}/${systemd_unitdir}/system 
22     install -d ${D}${sysconfdir}/systemd/network
281a7f 23
G 24     install -m 0644 ${WORKDIR}/10-eth0.network ${D}${sysconfdir}/systemd/network
849fbd 25
G 26     install -m 0644 ${WORKDIR}/20-wlan0.network ${D}${sysconfdir}/systemd/network
27     sed -i "s|wlan0|${WLAN_DEV}|g" ${D}${sysconfdir}/systemd/network/20-wlan0.network
28
29     install -m 0644 ${WORKDIR}/wpa-conf.service ${D}/${systemd_unitdir}/system
30     sed -i "s|wlan0|${WLAN_DEV}|g" ${D}/${systemd_unitdir}/system/wpa-conf.service
31 }