guowenxue
2023-12-19 608938e911a41b3712db2480c57ef45e8b135901
commit | author | age
849fbd 1 DESCRIPTION = "Copy user wpa_supplicant.conf"
G 2 LICENSE = "GPL-2.0-only"
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"
8 SYSTEMD_SERVICE:${PN} = "wpa-conf.timer"
9
10 WLAN_DEV ?= "wlan0"
11
12 SRC_URI += " file://20-wlan0.network "
13 SRC_URI += " file://wpa-conf.service "
14 SRC_URI += " file://wpa-conf.timer "
15 SRC_URI += " file://wpa_supplicant@.service "
16
17 FILES:${PN} += "${sysconfdir}/systemd/network/20-wlan0.network"
18 FILES:${PN} += "${systemd_unitdir}/system/wpa-conf.service"
19 FILES:${PN} += "${systemd_unitdir}/system/wpa-conf.timer"
20 FILES:${PN} += "${systemd_unitdir}/system/wpa_supplicant@.service"
21
22 do_install() { 
23     install -d ${D}/${systemd_unitdir}/system 
24     install -d ${D}${sysconfdir}/systemd/network
25
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
32     install -m 0644 ${WORKDIR}/wpa-conf.timer ${D}/${systemd_unitdir}/system
33     install -m 0644 ${WORKDIR}/wpa_supplicant@.service ${D}/${systemd_unitdir}/system
34 }