Wifi auto connect
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
[Match]
|
||||
Name=wlp2s0
|
||||
|
||||
[Network]
|
||||
DHCP=no
|
||||
Address=192.168.0.25/24
|
||||
Gateway=192.168.0.1
|
||||
DNS=192.168.0.1
|
||||
FallbackDNS=8.8.8.8 1.1.1.1
|
||||
|
||||
[DHCP]
|
||||
UseDNS=yes
|
||||
@@ -0,0 +1,29 @@
|
||||
SUMMARY = "WiFi Auto-Connect Configuration"
|
||||
DESCRIPTION = "systemd-networkd and wpa_supplicant configuration for automatic WiFi connection"
|
||||
LICENSE = "MIT"
|
||||
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
|
||||
|
||||
SRC_URI = "file://25-wireless.network \
|
||||
file://wpa_supplicant-wlp2s0.conf"
|
||||
|
||||
S = "${WORKDIR}"
|
||||
|
||||
do_install() {
|
||||
# Install systemd-networkd configuration
|
||||
install -d ${D}${sysconfdir}/systemd/network
|
||||
install -m 0644 ${WORKDIR}/25-wireless.network ${D}${sysconfdir}/systemd/network/
|
||||
|
||||
# Install wpa_supplicant configuration
|
||||
install -d ${D}${sysconfdir}/wpa_supplicant
|
||||
install -m 0600 ${WORKDIR}/wpa_supplicant-wlp2s0.conf ${D}${sysconfdir}/wpa_supplicant/
|
||||
|
||||
# Create systemd service symlinks for auto-start
|
||||
install -d ${D}${sysconfdir}/systemd/system/multi-user.target.wants
|
||||
ln -sf ${systemd_system_unitdir}/wpa_supplicant@.service ${D}${sysconfdir}/systemd/system/multi-user.target.wants/wpa_supplicant@wlp2s0.service
|
||||
}
|
||||
|
||||
FILES:${PN} = "${sysconfdir}/systemd/network/* \
|
||||
${sysconfdir}/wpa_supplicant/* \
|
||||
${sysconfdir}/systemd/system/multi-user.target.wants/*"
|
||||
|
||||
RDEPENDS:${PN} = "systemd wpa-supplicant"
|
||||
@@ -12,6 +12,7 @@ IMAGE_INSTALL += "\
|
||||
systemd \
|
||||
openssh \
|
||||
ssh-keys \
|
||||
wifi-config \
|
||||
${CORE_IMAGE_EXTRA_INSTALL} \
|
||||
"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user