From ecfb3df737a12d97030b82fe62fcb58152f13cd0 Mon Sep 17 00:00:00 2001
From: Stefan Schmidt <stefan.schmidt@huawei.com>
Date: Fri, 11 Jun 2021 18:14:31 +0200
Subject: [PATCH] systemd-conf: Add bbappend for WiFi hotspot network config
 file

Together with hostapd this will give us all we need to run a very basic
WiFi hotspot setup. DHCP, DNS and NAT for the clients to serve.

Signed-off-by: Stefan Schmidt <stefan.schmidt@huawei.com>
---
 .../recipes-core/systemd/files/80-wireless.network  | 13 +++++++++++++
 .../recipes-core/systemd/systemd-conf_%.bbappend    |  7 +++++++
 2 files changed, 20 insertions(+)
 create mode 100644 meta-ohos-blueprints/recipes-core/systemd/files/80-wireless.network
 create mode 100644 meta-ohos-blueprints/recipes-core/systemd/systemd-conf_%.bbappend

diff --git a/meta-ohos-blueprints/recipes-core/systemd/files/80-wireless.network b/meta-ohos-blueprints/recipes-core/systemd/files/80-wireless.network
new file mode 100644
index 00000000..15c343af
--- /dev/null
+++ b/meta-ohos-blueprints/recipes-core/systemd/files/80-wireless.network
@@ -0,0 +1,13 @@
+[Match]
+Name=wlan0
+
+[Network]
+Address=172.16.47.1/24
+DHCPServer=true
+IPMasquerade=true
+
+[DHCPServer]
+PoolOffset=100
+PoolSize=50
+EmitDNS=yes
+DNS=9.9.9.9 8.8.8.8
diff --git a/meta-ohos-blueprints/recipes-core/systemd/systemd-conf_%.bbappend b/meta-ohos-blueprints/recipes-core/systemd/systemd-conf_%.bbappend
new file mode 100644
index 00000000..9decbc87
--- /dev/null
+++ b/meta-ohos-blueprints/recipes-core/systemd/systemd-conf_%.bbappend
@@ -0,0 +1,7 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+SRC_URI_append = "file://80-wireless.network"
+
+do_install_append() {
+    install -D -m0644 ${WORKDIR}/80-wireless.network ${D}${systemd_unitdir}/network/
+}
-- 
GitLab