From 0b18ec03e7f3bf03f9d07d391b28956d6c346c9a Mon Sep 17 00:00:00 2001
From: Zbigniew Bodek <zbigniew.bodek@huawei.com>
Date: Wed, 10 Mar 2021 15:05:58 +0100
Subject: [PATCH] bluez5: Install main.conf and enable BLE on boot

Add bbappend to install main.conf file and set
AutoEnable flag to bring up BLE during boot.
Other options are commented out by default, they
may be useful for further BLE behavior tuning.

Signed-off-by: Zbigniew Bodek <zbigniew.bodek@huawei.com>
---
 .../recipes-connectivity/bluez5/bluez5_%.bbappend        | 9 +++++++++
 1 file changed, 9 insertions(+)
 create mode 100644 meta-ohos-demo/recipes-connectivity/bluez5/bluez5_%.bbappend

diff --git a/meta-ohos-demo/recipes-connectivity/bluez5/bluez5_%.bbappend b/meta-ohos-demo/recipes-connectivity/bluez5/bluez5_%.bbappend
new file mode 100644
index 00000000..ade16020
--- /dev/null
+++ b/meta-ohos-demo/recipes-connectivity/bluez5/bluez5_%.bbappend
@@ -0,0 +1,9 @@
+do_install_append() {
+	# Install main.conf file and turn on AutoEnable flag
+	# to bring up BLE controller on boot.
+	if [ -f ${S}/src/main.conf ]; then
+		install -m 0644 ${S}/src/main.conf ${D}/${sysconfdir}/bluetooth/
+		sed -i 's/#AutoEnable=false/AutoEnable=true/g' \
+			${D}/${sysconfdir}/bluetooth/main.conf
+	fi
+}
-- 
GitLab