From 5fb93357decd5ea3b770d40b1513396b543ed7bf Mon Sep 17 00:00:00 2001
From: Stefan Schmidt <stefan.schmidt@huawei.com>
Date: Fri, 4 Jun 2021 16:55:26 +0200
Subject: [PATCH] allscenarios-linux-blueprint-gateway.conf: Initial distro and
 image

Basic distribution for the Gateway Blueprint as well as a gateway  image
that pulls in all networking packages we are using for this first
iteration.

Two blueprint specific overrides are added as well. We make sure hostapd
service gets started by default for a good ootb experience. Secondly we
enable the iptables package config flag for systemd-netword to have the
basic NAT functionality enabled.

Signed-off-by: Stefan Schmidt <stefan.schmidt@huawei.com>
---
 .../allscenarios-linux-blueprint-gateway.conf | 30 +++++++++++++++++++
 .../images/blueprint-gateway-image.bb         | 16 ++++++++++
 2 files changed, 46 insertions(+)
 create mode 100644 meta-ohos-blueprints/conf/distro/allscenarios-linux-blueprint-gateway.conf
 create mode 100644 meta-ohos-blueprints/recipes-core/images/blueprint-gateway-image.bb

diff --git a/meta-ohos-blueprints/conf/distro/allscenarios-linux-blueprint-gateway.conf b/meta-ohos-blueprints/conf/distro/allscenarios-linux-blueprint-gateway.conf
new file mode 100644
index 00000000..9ac8e674
--- /dev/null
+++ b/meta-ohos-blueprints/conf/distro/allscenarios-linux-blueprint-gateway.conf
@@ -0,0 +1,30 @@
+# SPDX-FileCopyrightText: Huawei Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+# Distro configuration for the dashboard blueprint
+
+require conf/distro/allscenarios-linux.conf
+
+DISTRO = "allscenarios-linux-blueprint-gateway"
+DISTRO_NAME = "All Scenarios OS Gateway Blueprint Linux Distro"
+
+# Custom hostnames for easy DNS resolution for this blueprint.
+hostname_base-files = "blueprint-gateway"
+
+# Avoid build warning(s) for ununsed extra partitions.
+ST_VENDORFS = "0"
+ST_USERFS = "0"
+
+# With our layer setup we would add any bbappend found from our
+# layers.conf. This means blueprint-specific appends would leak
+# into the package in our main distribution. To avoid this we
+# mask out the blueprint layers in the main distro and unmask
+# them only the blueprint distributions.
+BBMASK = ""
+
+# We want hostapd service to start by default for this blueprint
+SYSTEMD_AUTO_ENABLE_pn-hostapd = "enable"
+
+# Enable iptbakes support in systemd-networkd for NAT
+PACKAGECONFIG_append_pn-systemd = " iptc"
diff --git a/meta-ohos-blueprints/recipes-core/images/blueprint-gateway-image.bb b/meta-ohos-blueprints/recipes-core/images/blueprint-gateway-image.bb
new file mode 100644
index 00000000..08ba5664
--- /dev/null
+++ b/meta-ohos-blueprints/recipes-core/images/blueprint-gateway-image.bb
@@ -0,0 +1,16 @@
+# SPDX-FileCopyrightText: Huawei Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+require recipes-core/images/allscenarios-image-base.bb
+
+SUMMARY = "Gateway blueprint image"
+DESCRIPTION = "Smart home gateway device"
+LICENSE = "Apache-2.0"
+
+IMAGE_INSTALL_append = "\
+        ot-br-posix \
+        wpantund \
+        hostapd \
+        iptables \
+	"
-- 
GitLab