[Add meta-cmf-filogic sdk cmf for rdkb development]
[Description]
Add meta-cmf-filogic sdk cmf for rdkb development
1. rdkb base on dunfell rdkb-next (> 2022q1)
2. cmf is mostly from meta-turris implementation
3. some 64bit support are port from rp4-64 cmf
4. arm64/arm 32bit bsp both can run on rdkb
[Release-log]
N/A
diff --git a/recipes-ccsp/ccsp/ccsp-common-library/0001-DBusLoop-SSL_state-TLS_ST_OK.patch b/recipes-ccsp/ccsp/ccsp-common-library/0001-DBusLoop-SSL_state-TLS_ST_OK.patch
new file mode 100644
index 0000000..770abff
--- /dev/null
+++ b/recipes-ccsp/ccsp/ccsp-common-library/0001-DBusLoop-SSL_state-TLS_ST_OK.patch
@@ -0,0 +1,52 @@
+From d69f7dc3304bb5dd8803cef63a1a96e7c102e153 Mon Sep 17 00:00:00 2001
+From: Jaga <jagadheesan_duraisamy@comcast.com>
+Date: Mon, 6 Apr 2020 17:29:42 +0000
+Subject: [PATCH] DBusLoop-SSL_state-TLS_ST_OK
+
+Reason for change: typedef DBusLoop struct, changed ssl->state
+to SSL_state(ssl) for openssl > 1.1 and SSL_get_state(ssl) for openssl >
+1.1.1
+
+Source: COMCAST
+License: Apache-2.0
+Upstream-Status: Pending
+Signed-off-by: Jaga <jagadheesan_duraisamy@comcast.com>
+---
+ source/ccsp/include/ccsp_message_bus.h | 2 ++
+ source/util_api/ansc/AnscPlatform/user_openssl.c | 10 +++++++++-
+ 2 files changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/source/ccsp/include/ccsp_message_bus.h b/source/ccsp/include/ccsp_message_bus.h
+index 9fb9aae9..7c315be0 100644
+--- a/source/ccsp/include/ccsp_message_bus.h
++++ b/source/ccsp/include/ccsp_message_bus.h
+@@ -153,6 +153,8 @@ typedef struct _CCSP_MESSAGE_FILTER
+
+ } CCSP_MESSAGE_FILTER;
+
++typedef struct DBusLoop DBusLoop;
++
+ typedef struct _CCSP_MESSAGE_BUS_CONNECTION
+ {
+ DBusConnection *conn;
+diff --git a/source/util_api/ansc/AnscPlatform/user_openssl.c b/source/util_api/ansc/AnscPlatform/user_openssl.c
+index 7e5c2c7d..6d1f4f51 100644
+--- a/source/util_api/ansc/AnscPlatform/user_openssl.c
++++ b/source/util_api/ansc/AnscPlatform/user_openssl.c
+@@ -392,7 +392,15 @@ SSL * openssl_connect (int fd)
+
+ SSL_set_connect_state (ssl);
+
+- if (SSL_connect (ssl) <= 0 || ssl->state != SSL_ST_OK)
++ if (SSL_connect (ssl) <= 0 ||
++#if (OPENSSL_VERSION_NUMBER >= 0x10101000L)
++ SSL_get_state(ssl) != TLS_ST_OK)
++#elif (OPENSSL_VERSION_NUMBER >= 0x10100000L)
++ SSL_state(ssl) != TLS_ST_OK)
++#else
++ ssl->state != SSL_ST_OK)
++#endif
++
+ {
+ AnscTraceWarning(("openssl_connect - failed in SSL_set_connect_state \n"));
+ goto error;
diff --git a/recipes-ccsp/ccsp/ccsp-common-library/0001-SSLeay_add_all_algorithms-remove-in-openssl-1.1.patch b/recipes-ccsp/ccsp/ccsp-common-library/0001-SSLeay_add_all_algorithms-remove-in-openssl-1.1.patch
new file mode 100644
index 0000000..2cca4be
--- /dev/null
+++ b/recipes-ccsp/ccsp/ccsp-common-library/0001-SSLeay_add_all_algorithms-remove-in-openssl-1.1.patch
@@ -0,0 +1,30 @@
+From d1b13416095d4fe513ee739de179913222539993 Mon Sep 17 00:00:00 2001
+From: Jaga <jagadheesan_duraisamy@comcast.com>
+Date: Mon, 6 Apr 2020 18:35:17 +0000
+Subject: [PATCH] SSLeay_add_all_algorithms remove in openssl 1.1
+
+Reason for change: Remove deprecated API SSLeay_add_all_algorithms for
+openssl 1.1 and above
+
+Source: COMCAST
+License: Apache-2.0
+Upstream-Status: Pending
+Signed-off-by: Jaga <jagadheesan_duraisamy@comcast.com>
+---
+ source/util_api/ansc/AnscPlatform/user_openssl.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/source/util_api/ansc/AnscPlatform/user_openssl.c b/source/util_api/ansc/AnscPlatform/user_openssl.c
+index 0d74871f..4cac8483 100644
+--- a/source/util_api/ansc/AnscPlatform/user_openssl.c
++++ b/source/util_api/ansc/AnscPlatform/user_openssl.c
+@@ -68,7 +68,9 @@ void initialize_openssl_lib()
+
+ SSL_library_init ();
+ SSL_load_error_strings ();
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ SSLeay_add_all_algorithms ();
++#endif
+ SSLeay_add_ssl_algorithms ();
+ }
+
diff --git a/recipes-ccsp/ccsp/ccsp-common-library/0001-breakpad-wrapper.patch b/recipes-ccsp/ccsp/ccsp-common-library/0001-breakpad-wrapper.patch
new file mode 100644
index 0000000..8e3dcd7
--- /dev/null
+++ b/recipes-ccsp/ccsp/ccsp-common-library/0001-breakpad-wrapper.patch
@@ -0,0 +1,81 @@
+--- a/source/breakpad_wrapper/breakpad_wrapper.cpp
++++ b/source/breakpad_wrapper/breakpad_wrapper.cpp
+@@ -0,0 +1,20 @@
++#include <client/linux/handler/exception_handler.h>
++// called by 'google_breakpad::ExceptionHandler' on every crash
++namespace
++{
++bool breakpadCallback(const google_breakpad::MinidumpDescriptor& descriptor, void* context, bool succeeded)
++{
++ (void) descriptor;
++ (void) context;
++ return succeeded;
++}
++// Instantiate only one 'google_breakpad::ExceptionHandler'
++// - "/opt/minidumps" is canonical path that should be in sync with uploadDumps.sh script
++extern "C" void breakpad_ExceptionHandler()
++{
++ static google_breakpad::ExceptionHandler* excHandler = NULL;
++ delete excHandler;
++ excHandler = new google_breakpad::ExceptionHandler(google_breakpad::MinidumpDescriptor("/opt/minidumps"), NULL, breakpadCallback, NULL, true, -1);
++}
++}
++
+--- a/source/breakpad_wrapper/include/breakpad_wrapper.h
++++ b/source/breakpad_wrapper/include/breakpad_wrapper.h
+@@ -0,0 +1,8 @@
++#ifdef __cplusplus
++extern "C"
++{
++#endif
++void breakpad_ExceptionHandler();
++#ifdef __cplusplus
++}
++#endif
+--- a/source/Makefile.am
++++ b/source/Makefile.am
+@@ -16,4 +16,4 @@
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+ ##########################################################################
+-SUBDIRS = cosa debug_api ccsp util_api
++SUBDIRS = cosa debug_api ccsp util_api breakpad_wrapper
+--- a/source/breakpad_wrapper/Makefile.am
++++ b/source/breakpad_wrapper/Makefile.am
+@@ -0,0 +1,8 @@
++AM_CPPFLAGS = -Wall -Werror
++ACLOCAL_AMFLAGS = -I m4
++hardware_platform = i686-linux-gnu
++
++noinst_LTLIBRARIES = libCcspCommonLibrary_breakpad_wrapper.la
++libCcspCommonLibrary_breakpad_wrapper_la_CPPFLAGS = $(CPPFLAGS)
++libCcspCommonLibrary_breakpad_wrapper_la_SOURCES = breakpad_wrapper.cpp
++libCcspCommonLibrary_breakpad_wrapper_la_LDFLAGS = -lbreakpad_client
+--- a/configure.ac
++++ b/configure.ac
+@@ -34,6 +34,7 @@
+
+ # Checks for programs.
+ AC_PROG_CC
++AC_PROG_CXX
+ AC_PROG_INSTALL
+ AM_PROG_CC_C_O
+ AM_PROG_LIBTOOL(libtool)
+@@ -112,6 +113,7 @@
+ source/cosa/package/Makefile
+ source/cosa/Makefile
+ source/debug_api/Makefile
++ source/breakpad_wrapper/Makefile
+ source/ccsp/components/common/PoamIrepFolder/Makefile
+ source/ccsp/components/common/DataModel/dml/components/DslhVarEntity/Makefile
+ source/ccsp/components/common/DataModel/dml/components/DslhObjController/Makefile
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -65,6 +65,7 @@
+ source/cosa/package/bmc2/components/Bmc2ComTerminal/libCcspCommonLibrary_Bmc2ComTerminal.la \
+ source/cosa/package/bmc2/components/Bmc2ComDomain/libCcspCommonLibrary_Bmc2ComDomain.la \
+ source/debug_api/libCcspCommonLibrary_debug_api.la \
++ source/breakpad_wrapper/libCcspCommonLibrary_breakpad_wrapper.la \
+ source/ccsp/components/common/PoamIrepFolder/libCcspCommonLibrary_PoamIrepFolder.la \
+ source/ccsp/components/common/DataModel/dml/components/DslhVarEntity/libCcspCommonLibrary_DslhVarEntity.la \
+ source/ccsp/components/common/DataModel/dml/components/DslhObjController/libCcspCommonLibrary_DslhObjController.la \
diff --git a/recipes-ccsp/ccsp/ccsp-common-library/0003-add-dependency-to-pandm.patch b/recipes-ccsp/ccsp/ccsp-common-library/0003-add-dependency-to-pandm.patch
new file mode 100644
index 0000000..3ff558b
--- /dev/null
+++ b/recipes-ccsp/ccsp/ccsp-common-library/0003-add-dependency-to-pandm.patch
@@ -0,0 +1,13 @@
+diff --git a/systemd_units/CcspPandMSsp.service b/systemd_units/CcspPandMSsp.service
+index 192724d5..fe49033f 100644
+--- a/systemd_units/CcspPandMSsp.service
++++ b/systemd_units/CcspPandMSsp.service
+@@ -19,7 +19,7 @@
+ [Unit]
+ Description=CcspPandMSsp service
+
+-After=PsmSsp.service
++After=gwprovethwan.service PsmSsp.service
+
+ [Service]
+ Type=forking
diff --git a/recipes-ccsp/ccsp/ccsp-common-library/0004-remove-psm-db-reference.patch b/recipes-ccsp/ccsp/ccsp-common-library/0004-remove-psm-db-reference.patch
new file mode 100644
index 0000000..dd98f1c
--- /dev/null
+++ b/recipes-ccsp/ccsp/ccsp-common-library/0004-remove-psm-db-reference.patch
@@ -0,0 +1,12 @@
+diff --git a/systemd_units/PsmSsp.service b/systemd_units/PsmSsp.service
+index cb4d530d..648a55f9 100644
+--- a/systemd_units/PsmSsp.service
++++ b/systemd_units/PsmSsp.service
+@@ -29,7 +29,6 @@ Environment="Subsys=eRT."
+ Environment="LOG4C_RCPATH=/etc"
+ EnvironmentFile=/etc/device.properties
+ ExecStartPre=/bin/sh -c '(/usr/ccsp/utopiaInitCheck.sh)'
+-ExecStartPre=/bin/sh -c '(/usr/ccsp/log_psm.db.sh)'
+ ExecStart=/usr/bin/PsmSsp -subsys $Subsys
+ ExecStop=/bin/sh -c 'echo "`date`: Stopping/Restarting PsmSsp" >> ${PROCESS_RESTART_LOG}'
+ Restart=always
diff --git a/recipes-ccsp/ccsp/ccsp-common-library/ccsp_vendor.h b/recipes-ccsp/ccsp/ccsp-common-library/ccsp_vendor.h
new file mode 100644
index 0000000..d942c1f
--- /dev/null
+++ b/recipes-ccsp/ccsp/ccsp-common-library/ccsp_vendor.h
@@ -0,0 +1,22 @@
+/*
+If not stated otherwise in this file or this component's LICENSE
+file the following copyright and licenses apply:
+
+Copyright [2019] [RDK Management]
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+#define CONFIG_VENDOR_NAME "Turris CZ"
+#define CONFIG_VENDOR_ID "0xFFFFFFFE"
+#define CONFIG_TI_GW_DESCRIPTION "Turris Omnia Gateway device"
diff --git a/recipes-ccsp/ccsp/ccsp-common-library/checkturriswifisupport.path b/recipes-ccsp/ccsp/ccsp-common-library/checkturriswifisupport.path
new file mode 100644
index 0000000..4f9c8d8
--- /dev/null
+++ b/recipes-ccsp/ccsp/ccsp-common-library/checkturriswifisupport.path
@@ -0,0 +1,9 @@
+[Unit]
+Description=Check Turris Wifi Support Initialized Path
+
+[Path]
+PathExists=/tmp/pam_initialized
+Unit=checkturriswifisupport.service
+
+[Install]
+WantedBy=multi-user.target
diff --git a/recipes-ccsp/ccsp/ccsp-common-library/checkturriswifisupport.service b/recipes-ccsp/ccsp/ccsp-common-library/checkturriswifisupport.service
new file mode 100644
index 0000000..e92810f
--- /dev/null
+++ b/recipes-ccsp/ccsp/ccsp-common-library/checkturriswifisupport.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Check WIFI support on Turris Omnia device
+After=hostapd.service
+
+[Service]
+Type=forking
+ExecStart=/bin/sh -c '/usr/ccsp/wifi/checkwifi.sh'
diff --git a/recipes-ccsp/ccsp/ccsp-common-library/gwprovapp.conf b/recipes-ccsp/ccsp/ccsp-common-library/gwprovapp.conf
new file mode 100644
index 0000000..dde640b
--- /dev/null
+++ b/recipes-ccsp/ccsp/ccsp-common-library/gwprovapp.conf
@@ -0,0 +1,6 @@
+[Unit]
+After=network.target
+Wants=network.target
+
+[Service]
+ExecStart=/usr/bin/gw_prov_utopia
diff --git a/recipes-ccsp/ccsp/ccsp-common-library/turriswifiinitialized.path b/recipes-ccsp/ccsp/ccsp-common-library/turriswifiinitialized.path
new file mode 100644
index 0000000..5b4da66
--- /dev/null
+++ b/recipes-ccsp/ccsp/ccsp-common-library/turriswifiinitialized.path
@@ -0,0 +1,9 @@
+[Unit]
+Description=TurrisOmnia WIFI Initialized Path
+
+[Path]
+PathExists=/tmp/wifi_driver_initialized
+Unit=ccspwifiagent.service
+
+[Install]
+WantedBy=multi-user.target
diff --git a/recipes-ccsp/ccsp/ccsp-common-library/utopia.service b/recipes-ccsp/ccsp/ccsp-common-library/utopia.service
new file mode 100644
index 0000000..7df68b3
--- /dev/null
+++ b/recipes-ccsp/ccsp/ccsp-common-library/utopia.service
@@ -0,0 +1,34 @@
+##########################################################################
+# If not stated otherwise in this file or this component's Licenses.txt
+# file the following copyright and licenses apply:
+#
+# Copyright 2021 RDK Management
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##########################################################################
+[Unit]
+Description=Utopia service
+
+After=mount-nonvol.service
+
+[Service]
+Type=forking
+WorkingDirectory=/etc/utopia
+EnvironmentFile=/etc/device.properties
+ExecStart=/bin/sh /etc/utopia/utopia_init.sh
+ExecStop=/bin/sh -c 'echo "Stopping/Restarting utopia_init.sh" >> ${PROCESS_RESTART_LOG}'
+
+StandardOutput=syslog+console
+
+[Install]
+WantedBy=multi-user.target
diff --git a/recipes-ccsp/ccsp/ccsp-common-library/wifi-initialized.target b/recipes-ccsp/ccsp/ccsp-common-library/wifi-initialized.target
new file mode 100644
index 0000000..c6c1057
--- /dev/null
+++ b/recipes-ccsp/ccsp/ccsp-common-library/wifi-initialized.target
@@ -0,0 +1,3 @@
+[Unit]
+Description=WiFi Initialization Complete
+Documentation=man:systemd.special(7)
diff --git a/recipes-ccsp/ccsp/ccsp-common-library/wifiinitialized.path b/recipes-ccsp/ccsp/ccsp-common-library/wifiinitialized.path
new file mode 100644
index 0000000..4cb7b45
--- /dev/null
+++ b/recipes-ccsp/ccsp/ccsp-common-library/wifiinitialized.path
@@ -0,0 +1,9 @@
+[Unit]
+Description= WiFi Initialized Path
+
+[Path]
+PathExists=/tmp/wifi_initialized
+Unit=wifi-initialized.target
+
+[Install]
+WantedBy=multi-user.target
diff --git a/recipes-ccsp/ccsp/ccsp-common-library/wifiinitialized.service b/recipes-ccsp/ccsp/ccsp-common-library/wifiinitialized.service
new file mode 100644
index 0000000..1fd98d6
--- /dev/null
+++ b/recipes-ccsp/ccsp/ccsp-common-library/wifiinitialized.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=WiFi Initialized service
+
+[Service]
+Type=simple
+ExecStart=/bin/echo "Wifi is initialized"
+RemainAfterExit=yes
+
+StandardOutput=syslog