summaryrefslogtreecommitdiffstats
path: root/systemservice/config
diff options
context:
space:
mode:
Diffstat (limited to 'systemservice/config')
-rw-r--r--systemservice/config/LICENSE177
-rw-r--r--systemservice/config/Makefile.client19
-rw-r--r--systemservice/config/library/Makefile19
-rw-r--r--systemservice/config/library/system_manager_config/Makefile21
-rw-r--r--systemservice/config/library/system_manager_config/include/system_service/ss_access_if_private.h80
-rw-r--r--systemservice/config/library/system_manager_config/include/system_service/ss_package.h65
-rw-r--r--systemservice/config/library/system_manager_config/include/system_service/ss_system_manager_conf.h145
-rw-r--r--systemservice/config/library/system_manager_config/include/system_service/system_manager_config.h26
-rw-r--r--systemservice/config/library/system_manager_config/last2order/Makefile71
-rw-r--r--systemservice/config/library/system_manager_config/last2order/sm_last2order.cfobin0 -> 8 bytes
-rwxr-xr-xsystemservice/config/library/system_manager_config/last2order/tool/mklast2ordertbl.pl107
-rw-r--r--systemservice/config/library/system_manager_config/order/Makefile64
-rw-r--r--systemservice/config/library/system_manager_config/order/launch_order_body.xml0
-rw-r--r--systemservice/config/library/system_manager_config/order/launch_order_main.xml23
-rwxr-xr-xsystemservice/config/library/system_manager_config/order/launch_order_xml2cfg.pl171
-rw-r--r--systemservice/config/library/system_manager_config/order/system_launcher_main.order.cfg3
-rw-r--r--systemservice/config/library/system_manager_config/order/system_launcher_main.xml36
-rw-r--r--systemservice/config/library/system_manager_config/src/Makefile45
-rw-r--r--systemservice/config/library/system_manager_config/src/libsssmcfg.ver30
-rw-r--r--systemservice/config/library/system_manager_config/src/ss_system_manager_conf.cpp489
-rw-r--r--systemservice/config/library/system_manager_config/xml/Makefile53
-rw-r--r--systemservice/config/library/system_manager_config/xml/launch_cfg2xml.sh69
-rw-r--r--systemservice/config/library/system_manager_config/xml/launch_xml2cfg.sh116
-rw-r--r--systemservice/config/library/system_manager_config/xml/sm_launch_agl.cfg7
-rw-r--r--systemservice/config/library/system_manager_config/xml/sm_launch_agl.xml35
25 files changed, 1871 insertions, 0 deletions
diff --git a/systemservice/config/LICENSE b/systemservice/config/LICENSE
new file mode 100644
index 00000000..f433b1a5
--- /dev/null
+++ b/systemservice/config/LICENSE
@@ -0,0 +1,177 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
diff --git a/systemservice/config/Makefile.client b/systemservice/config/Makefile.client
new file mode 100644
index 00000000..0a186c5b
--- /dev/null
+++ b/systemservice/config/Makefile.client
@@ -0,0 +1,19 @@
+#
+# @copyright Copyright (c) 2017-2020 TOYOTA MOTOR CORPORATION.
+#
+# 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.
+#
+
+SUBDIRS := library
+
+include ../system_service.mk
diff --git a/systemservice/config/library/Makefile b/systemservice/config/library/Makefile
new file mode 100644
index 00000000..f326127d
--- /dev/null
+++ b/systemservice/config/library/Makefile
@@ -0,0 +1,19 @@
+#
+# @copyright Copyright (c) 2017-2020 TOYOTA MOTOR CORPORATION.
+#
+# 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.
+#
+
+SUBDIRS := system_manager_config
+
+include ../../system_service.mk
diff --git a/systemservice/config/library/system_manager_config/Makefile b/systemservice/config/library/system_manager_config/Makefile
new file mode 100644
index 00000000..fbb09d7c
--- /dev/null
+++ b/systemservice/config/library/system_manager_config/Makefile
@@ -0,0 +1,21 @@
+#
+# @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
+#
+# 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.
+#
+
+
+SUBDIRS := src
+
+include ../../../system_service.mk
+
diff --git a/systemservice/config/library/system_manager_config/include/system_service/ss_access_if_private.h b/systemservice/config/library/system_manager_config/include/system_service/ss_access_if_private.h
new file mode 100644
index 00000000..1753bf03
--- /dev/null
+++ b/systemservice/config/library/system_manager_config/include/system_service/ss_access_if_private.h
@@ -0,0 +1,80 @@
+/*
+ * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
+ *
+ * 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.
+ */
+/**
+ * @file ss_access_if_private.h
+ * @brief \~english This file contains declaration of structures RAM_AccessPrivate and ROM_AccessPrivate
+ */
+/** @addtogroup BaseSystem
+ * @{
+ */
+/** @addtogroup system_service
+ * @ingroup BaseSystem
+ * @{
+ */
+/** @addtogroup config
+ * @ingroup system_service
+ * @{
+ */
+#ifndef CONFIG_LIBRARY_SYSTEM_MANAGER_CONFIG_INCLUDE_SYSTEM_SERVICE_SS_ACCESS_IF_PRIVATE_H_
+#define CONFIG_LIBRARY_SYSTEM_MANAGER_CONFIG_INCLUDE_SYSTEM_SERVICE_SS_ACCESS_IF_PRIVATE_H_
+
+#include <system_service/ss_sm_rom_access.h>
+#include <system_service/ss_sm_ram_access.h>
+
+// Should be design the data so that the default value is 0.
+
+// Product private area for DRAM BACKUP
+
+/**
+ * @struct RAM_AccessPrivate
+ * @brief \~english RAM Access Private data define
+ */
+typedef struct {
+ union {
+ //! \~english _CWORD80_ error define
+ struct {
+ /*
+ * Note.
+ * This feature needs to be defined depending on the product specification by the vendor.
+ */
+ };
+ //! \~english RAM product private max
+ uint8_t max[RAM_PRODUCT_PRIVATE_MAX];
+ };
+} RAM_AccessPrivate;
+
+/**
+ * @struct ROM_AccessPrivate
+ * @brief \~english ROM Access Private data define
+ */
+typedef struct {
+ union {
+ // Since data is accessed with 32 bit width at the low level, data must be allocated using 32 bits algin
+ struct {
+ /*
+ * Note.
+ * This feature needs to be defined depending on the product specification by the vendor.
+ */
+ };
+ //! \~english ROM product private max
+ uint8_t max[ROM_PRODUCT_PRIVATE_MAX];
+ };
+} ROM_AccessPrivate;
+
+#endif // CONFIG_LIBRARY_SYSTEM_MANAGER_CONFIG_INCLUDE_SYSTEM_SERVICE_SS_ACCESS_IF_PRIVATE_H_
+/** @}*/
+/** @}*/
+/** @}*/
diff --git a/systemservice/config/library/system_manager_config/include/system_service/ss_package.h b/systemservice/config/library/system_manager_config/include/system_service/ss_package.h
new file mode 100644
index 00000000..788fd2cc
--- /dev/null
+++ b/systemservice/config/library/system_manager_config/include/system_service/ss_package.h
@@ -0,0 +1,65 @@
+/*
+ * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
+ *
+ * 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.
+ */
+/**
+ * @file ss_package.h
+ * @brief \~english This file contains declaration of common package values
+ */
+/** @addtogroup BaseSystem
+ * @{
+ */
+/** @addtogroup system_service
+ * @ingroup BaseSystem
+ * @{
+ */
+/** @addtogroup system_manager
+ * @ingroup system_service
+ * @{
+ */
+#ifndef CONFIG_LIBRARY_SYSTEM_MANAGER_CONFIG_INCLUDE_SYSTEM_SERVICE_SS_PACKAGE_H_
+#define CONFIG_LIBRARY_SYSTEM_MANAGER_CONFIG_INCLUDE_SYSTEM_SERVICE_SS_PACKAGE_H_
+
+// _CWORD71_ package name list
+#define SS_PKG_MAIN_EMMC "MAIN_EMMC" // define MAIN_EMMC for main_emmc
+#define SS_PKG_MAIN_PRODUCT_SI "MAIN_PRODUCT_SI" // define MAIN_PRODUCT_SI for main_product_si
+#define SS_PKG_TARGETBOARD "TARGETBOARD" // define TARGETBOARD for target boar
+#define SS_PKG_MAIN_LPF_SI "MAIN_LPF_SI" // define MAIN_LPF_SI for main_lpf_si
+
+#define SS_PKG_NAVI_GPS _Pragma ("GCC warning \"'SS_NAVI_GPS' macro is deprecated\"") "NAVI_GPS"
+#define SS_PKG_SERIES_INFO _Pragma ("GCC warning \"'SS_PKG_SERIES_INFO' macro is deprecated\"") "SERIES_INFO"
+
+#define MSG_PSM_REBOOT_NOTIFY 0x11 // define ps_psmshadow reboot notice id
+
+// AGL reserved version list.
+#define SS_PKG_DIAG_CPU_INFO_001 "DIAG_CPU_INFO_001"
+#define SS_PKG_DIAG_CPU_INFO_002 "DIAG_CPU_INFO_002"
+#define SS_PKG_DIAG_CPU_INFO_003 "DIAG_CPU_INFO_003"
+#define SS_PKG_DIAG_CPU_INFO_004 "DIAG_CPU_INFO_004"
+#define SS_PKG_DIAG_CPU_INFO_005 "DIAG_CPU_INFO_005"
+#define SS_PKG_DIAG_CPU_INFO_006 "DIAG_CPU_INFO_006"
+#define SS_PKG_DIAG_CPU_INFO_007 "DIAG_CPU_INFO_007"
+#define SS_PKG_DIAG_CPU_INFO_008 "DIAG_CPU_INFO_008"
+#define SS_PKG_DIAG_CPU_INFO_009 "DIAG_CPU_INFO_009"
+#define SS_PKG_DIAG_CPU_INFO_010 "DIAG_CPU_INFO_010"
+#define SS_PKG_DIAG_CPU_INFO_011 "DIAG_CPU_INFO_011"
+#define SS_PKG_DIAG_CPU_INFO_012 "DIAG_CPU_INFO_012"
+#define SS_PKG_DIAG_CPU_INFO_013 "DIAG_CPU_INFO_013"
+#define SS_PKG_DIAG_CPU_INFO_014 "DIAG_CPU_INFO_014"
+#define SS_PKG_DIAG_CPU_INFO_015 "DIAG_CPU_INFO_015"
+
+#endif // CONFIG_LIBRARY_SYSTEM_MANAGER_CONFIG_INCLUDE_SYSTEM_SERVICE_SS_PACKAGE_H_
+/** @}*/
+/** @}*/
+/** @}*/
diff --git a/systemservice/config/library/system_manager_config/include/system_service/ss_system_manager_conf.h b/systemservice/config/library/system_manager_config/include/system_service/ss_system_manager_conf.h
new file mode 100644
index 00000000..5354da85
--- /dev/null
+++ b/systemservice/config/library/system_manager_config/include/system_service/ss_system_manager_conf.h
@@ -0,0 +1,145 @@
+/*
+ * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
+ *
+ * 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.
+ */
+/**
+ * @file ss_system_manager_conf.h
+ * @brief \~english This file contains declaration of structures T_SS_SM_INIT_HOOK_IN_PARAM, T_SS_SM_INIT_HOOK_OUT_PARAM and api initial Hook
+ */
+/** @addtogroup BaseSystem
+ * @{
+ */
+/** @addtogroup system_service
+ * @ingroup BaseSystem
+ * @{
+ */
+/** @addtogroup config
+ * @ingroup system_service
+ * @{
+ */
+#ifndef CONFIG_LIBRARY_SYSTEM_MANAGER_CONFIG_INCLUDE_SYSTEM_SERVICE_SS_SYSTEM_MANAGER_CONF_H_
+#define CONFIG_LIBRARY_SYSTEM_MANAGER_CONFIG_INCLUDE_SYSTEM_SERVICE_SS_SYSTEM_MANAGER_CONF_H_
+
+#include <native_service/frameworkunified_types.h>
+#include <vector>
+#include <string>
+
+/**
+ * @struct T_SS_SM_INIT_HOOK
+ * @brief \~english Version up mode, Callback function
+ */
+typedef struct T_SS_SM_INIT_HOOK {
+ //! \~english Version up mode
+ BOOL bIsVupMode;
+ //! \~english Call back function
+ EFrameworkunifiedStatus (*cbRebootNoticeFunc)(HANDLE hApp);
+
+ T_SS_SM_INIT_HOOK()
+ : bIsVupMode(FALSE),
+ cbRebootNoticeFunc(NULL) {
+ }
+} T_SS_SM_INIT_HOOK_IN_PARAM;
+
+
+/**
+ * @struct T_SS_SM_INIT_HOOK_OUT_PARAM
+ * @brief \~english Not in OOM Killer's service object, Group Relaunch service.
+ */
+typedef struct {
+ std::vector<std::string> protectedSvcs;
+ //! \~english Not in OOM Killer's service object.
+ std::vector<std::string> groupRelaunchSvcs;
+ //! \~english Group Relaunch service.
+} T_SS_SM_INIT_HOOK_OUT_PARAM;
+
+/////////////////////////////////////////////////////////////////////////////////////
+/// \ingroup ss_sm_initHook
+/// \~english @par Summary
+///
+/// \~english @param [in] hApp
+/// HANDLE - HANDLE Application
+/// \~english @param [in] inPrm
+/// T_SS_SM_INIT_HOOK_IN_PARAM -
+/// \~english @param [in] outPrm
+/// T_SS_SM_INIT_HOOK_OUT_PARAM -
+/// \~english @par
+/// T_SS_SM_INIT_HOOK_IN_PARAM struct
+/// \~english @code
+/// typedef struct T_SS_SM_INIT_HOOK {
+/// BOOL bIsVupMode; /* version up model */
+/// EFrameworkunifiedStatus (*cbRebootNoticeFunc)(HANDLE hApp); /* call back function */
+/// T_SS_SM_INIT_HOOK()
+/// : bIsVupMode(FALSE),
+/// cbRebootNoticeFunc(NULL) {
+/// } /* constructor */
+/// } T_SS_SM_INIT_HOOK_IN_PARAM;
+/// @endcode
+/// \~english @par
+/// T_SS_SM_INIT_HOOK_IN_PARAM struct
+/// \~english @code
+/// typedef struct {
+/// std::vector<std::string> protectedSvcs; /* OOM Killer's protected service */
+/// std::vector<std::string> groupRelaunchSvcs; /* group relunch service */
+/// } T_SS_SM_INIT_HOOK_OUT_PARAM;
+/// @endcode
+/// \~english @retval eFrameworkunifiedStatusOK Success
+/// \~english @retval eFrameworkunifiedStatusInvldParam Invalid parameter
+/// \~english @retval eFrameworkunifiedStatusNullPointer Invalid pointer
+/// \~english @retval eFrameworkunifiedStatusInvldHandle Invalid handle
+/// \~english @retval eFrameworkunifiedStatusInvldHndlType Invalid type of handle
+/// \~english @retval eFrameworkunifiedStatusMsgQFull Message queue is full
+/// \~english @retval eFrameworkunifiedStatusErrNoEBADF Invalid File-Descriptor
+/// \~english @retval eFrameworkunifiedStatusErrNoEINTR An interrupt is generated by the system call (signal)
+/// \~english @retval eFrameworkunifiedStatusInvldBufSize Invalid buffer-size
+/// \~english @retval eFrameworkunifiedStatusFail Some sort of error occurred
+/// \~english @retval eFrameworkunifiedStatusErrOther Other error(It failed to open/allocation of shared memory)
+/// \~english @par Preconditions
+/// - None
+/// \~english @par Change of the internal state
+/// - save inPrm->cbRebootNoticeFunc to s_confCtx.cbRebootNoticeFunc.
+/// \~english @par Causes of failures
+/// -
+/// - System Manager of the session does not exist. [eFrameworkunifiedStatusNullPointer]
+/// - System Manager handle for the session is NULL. [eFrameworkunifiedStatusInvldHandle]
+/// - System Manager handle type for the session is not a transmission type. [eFrameworkunifiedStatusInvldHndlType]
+/// - System Manager message queue for the session is full. [eFrameworkunifiedStatusMsgQFull]
+/// - Transmission for the file descriptor of System Manager message for the session is invalid. \n
+/// [eFrameworkunifiedStatusErrNoEBADF]
+/// - Place to interrupt by the system call (signal) has occurred during the transmission of \n
+/// the System Manager message for the session. [eFrameworkunifiedStatusErrNoEINTR]
+/// - Size of the transmission buffer of the System Manager message for the session is invalid. \n
+/// [eFrameworkunifiedStatusInvldBufSize]
+/// - Any error has occurred at the time of transmission of the System Manager message for the session. \n
+/// [eFrameworkunifiedStatusFail]
+/// - Transmission of System Manager message for the session fails to shared memory access. \n
+/// [eFrameworkunifiedStatusErrOther]
+/// \~english @par Classification
+/// Public
+/// \~english @par Type
+/// Sync
+/// \~english @par Detail
+/// get env val from application,and write these to Launch Config file.
+/// \~english @par
+/// eFrameworkunifiedStatus:Result
+/// - eFrameworkunifiedStatusOK:Success
+/// - Except eFrameworkunifiedStatusOK:Fail
+/// \~english @see None
+////////////////////////////////////////////////////////////////////////////////////
+EFrameworkunifiedStatus ss_sm_initHook(HANDLE hApp, const T_SS_SM_INIT_HOOK_IN_PARAM *inPrm,
+ T_SS_SM_INIT_HOOK_OUT_PARAM *outPrm);
+
+#endif // CONFIG_LIBRARY_SYSTEM_MANAGER_CONFIG_INCLUDE_SYSTEM_SERVICE_SS_SYSTEM_MANAGER_CONF_H_
+/** @}*/
+/** @}*/
+/** @}*/
diff --git a/systemservice/config/library/system_manager_config/include/system_service/system_manager_config.h b/systemservice/config/library/system_manager_config/include/system_service/system_manager_config.h
new file mode 100644
index 00000000..2f44f987
--- /dev/null
+++ b/systemservice/config/library/system_manager_config/include/system_service/system_manager_config.h
@@ -0,0 +1,26 @@
+/*
+ * @copyright Copyright (c) 2017-2020 TOYOTA MOTOR CORPORATION.
+ *
+ * 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.
+ */
+/**
+ * @file
+ */
+#ifndef SYSTEMSERVICE_SYSTEMMANAGERCONFIG_H_ // NOLINT(build/header_guard)
+#define SYSTEMSERVICE_SYSTEMMANAGERCONFIG_H_ // NOLINT(build/header_guard)
+
+#include <system_service/ss_access_if_private.h>
+#include <system_service/ss_package.h>
+#include <system_service/ss_system_manager_conf.h>
+
+#endif // SYSTEMSERVICE_SYSTEMMANAGERCONFIG_H_
diff --git a/systemservice/config/library/system_manager_config/last2order/Makefile b/systemservice/config/library/system_manager_config/last2order/Makefile
new file mode 100644
index 00000000..f38ee770
--- /dev/null
+++ b/systemservice/config/library/system_manager_config/last2order/Makefile
@@ -0,0 +1,71 @@
+#
+# @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
+#
+# 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.
+#
+
+# ==== Customization ================
+#Directory path located XMLs for conversion
+CONFXML_DIR_PATH ?= $(SDKTARGETSYSROOT)/usr/agl/conf/sm_last2order
+
+#path to order file
+ORDER_DEF_PATH ?= $(SDKTARGETSYSROOT)/usr/agl/include/agl_wakeup_order.h
+
+#path to be installed CFO file
+CONF_INSTALL_DIR ?= $(SDKTARGETSYSROOT)/usr/agl/conf/systemmanager
+
+# ==================================
+
+HOST_CPP = cpp
+MKL_LAST2ORDER = mklast2ordertbl.pl
+
+#path located last2order tools
+TOOLPATH = ./tool
+
+VPATH = $(CONFXML_DIR_PATH) $(TOOLPATH)
+
+XMLFILES = $(shell cd $(CONFXML_DIR_PATH); ls *.xml)
+XMLTMPFILES = $(XMLFILES:%.xml=%.xml.pped)
+CFOFILES = $(XMLFILES:%.xml=%.cfo)
+
+_all:$(CFOFILES)
+
+install:install-pre install-cfo
+
+install-pre:
+ install -d -m 775 $(DESTDIR)/usr/agl/conf/sm_last2order;\
+ install -m 644 -t $(DESTDIR)/usr/agl/conf/systemmanager sm_last2order.cfo
+
+install-cfo:_all
+ set -e ;\
+ install -d -m 775 $(CONF_INSTALL_DIR) ;\
+ for cfofile in $(CFOFILES); do \
+ install -m 644 -t $(CONF_INSTALL_DIR) $$cfofile; \
+ done
+
+%.cfo:%.xml.pped $(MKL_LAST2ORDER)
+ ln -fs $(TOOLPATH)/$(MKL_LAST2ORDER)
+ ./$(MKL_LAST2ORDER) $< $@
+
+%.xml.pped:%.xml
+ $(HOST_CPP) -P -include $(ORDER_DEF_PATH) $< > $@
+
+clean:clean_local
+clean-sub:clean_local
+
+clean_local:
+ rm -f *.cfo *.pped *.pl
+
+.PHONY:install-cfo _all
+
+include ../../../../system_service.mk
diff --git a/systemservice/config/library/system_manager_config/last2order/sm_last2order.cfo b/systemservice/config/library/system_manager_config/last2order/sm_last2order.cfo
new file mode 100644
index 00000000..2463eecc
--- /dev/null
+++ b/systemservice/config/library/system_manager_config/last2order/sm_last2order.cfo
Binary files differ
diff --git a/systemservice/config/library/system_manager_config/last2order/tool/mklast2ordertbl.pl b/systemservice/config/library/system_manager_config/last2order/tool/mklast2ordertbl.pl
new file mode 100755
index 00000000..9b7dcaba
--- /dev/null
+++ b/systemservice/config/library/system_manager_config/last2order/tool/mklast2ordertbl.pl
@@ -0,0 +1,107 @@
+#!/usr/bin/perl
+use strict;
+
+use XML::XPath;
+
+my $LOCAL_XML = "./last2order.xml.tmp";
+my $LOCAL_DTD = "./last2order.dtd";
+
+my $DTD = <<'EODTD';
+<!ELEMENT last2order_tbl (last2order*) >
+
+<!ELEMENT last2order EMPTY>
+<!ATTLIST last2order
+ front_video CDATA "EMPTY"
+ front_sub_video CDATA "EMPTY"
+ front_audio CDATA "EMPTY"
+ rear_video CDATA "EMPTY"
+ rear_audio CDATA "EMPTY"
+ ordername CDATA #REQUIRED
+>
+EODTD
+
+sub usage(){
+ print STDERR "USAGE:$0 *.xml *.cfo\n";
+}
+
+#==== MAIN ====
+my $ret=system("which xmllint > /dev/null");
+if($ret != 0){
+ die("xmllint is not installed \n");
+}
+
+if(2 != @ARGV){
+ usage();
+ exit 1;
+}
+
+my $inXmlFile= $ARGV[0];
+my $outCfgXmlFile= $ARGV[1];
+
+
+#ARG CHECK
+if(! -e $inXmlFile){
+ die("$inXmlFile not found");
+}
+
+
+system("cp $inXmlFile $LOCAL_XML");
+
+open FOUT,'>',$LOCAL_DTD or die("can't open $LOCAL_DTD");
+print FOUT $DTD;
+close FOUT;
+
+$ret=system("xmllint --noout --valid $LOCAL_XML ");
+if($ret != 0){
+ die("$inXmlFile is NOT VAILD");
+}
+
+my $xml = XML::XPath->new(filename=>$LOCAL_XML);
+
+my $last2order_tbl = $xml->find('/last2order_tbl/last2order');
+
+my @nodelist = $last2order_tbl->get_nodelist;
+my $numOfElement = @nodelist;
+
+printf("num of element :$numOfElement\n");
+
+my $writeValue;
+open FOUT,'+>',$outCfgXmlFile or die("can't open $outCfgXmlFile");
+binmode(FOUT);
+
+$writeValue = pack("A4","CTOO"); print FOUT $writeValue;
+$writeValue = pack("L",$numOfElement); print FOUT $writeValue;
+
+foreach my $last2order( @nodelist ) {
+ $writeValue = $last2order->findvalue('@front_video');
+ printf("FV:$writeValue ");
+ $writeValue = pack("a128",$writeValue); print FOUT $writeValue;
+
+ $writeValue = $last2order->findvalue('@front_sub_video');
+ printf("FSV:$writeValue ");
+ $writeValue = pack("a128",$writeValue); print FOUT $writeValue;
+
+ $writeValue = $last2order->findvalue('@front_audio');
+ printf("FA:$writeValue ");
+ $writeValue = pack("a128",$writeValue); print FOUT $writeValue;
+
+ $writeValue = $last2order->findvalue('@rear_video');
+ printf("RV:$writeValue ");
+ $writeValue = pack("a128",$writeValue); print FOUT $writeValue;
+
+ $writeValue = $last2order->findvalue('@rear_audio');
+ printf("RA:$writeValue ");
+ $writeValue = pack("a128",$writeValue); print FOUT $writeValue;
+
+ $writeValue = $last2order->findvalue('@ordername');
+ printf("ON:$writeValue ");
+ $writeValue = pack("a64",$writeValue); print FOUT $writeValue;
+
+ printf("\n");
+}
+
+close(FOUT);
+
+system("rm $LOCAL_XML $LOCAL_DTD");
+
+
diff --git a/systemservice/config/library/system_manager_config/order/Makefile b/systemservice/config/library/system_manager_config/order/Makefile
new file mode 100644
index 00000000..38af0ee2
--- /dev/null
+++ b/systemservice/config/library/system_manager_config/order/Makefile
@@ -0,0 +1,64 @@
+#
+# @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
+#
+# 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.
+#
+
+#HOST TOOLS
+HOST_CPP = cpp
+HOST_ORDER_XML2CFG = ./launch_order_xml2cfg.pl
+
+CONF_DIR = $(SDKTARGETSYSROOT)/usr/agl/conf
+CONF_WON_H = $(SDKTARGETSYSROOT)/usr/agl/include/agl_wakeup_order.h
+
+LAUNCH_XMLFILES = $(shell cd $(CONF_DIR)/sm_launch; ls *.xml)
+ORDER_XMLFILES = $(LAUNCH_XMLFILES:%.xml=%.order)
+ORDER_CFGFILES = $(ORDER_XMLFILES:%.order=%.order.cfg)
+
+INST_CONFDIR = $(SDKTARGETSYSROOT)/usr/agl/conf/systemmanager
+
+CLEAN_FILES = launch_order_body.xml $(ORDER_CFGFILES)
+
+VPATH = $(CONF_DIR)/sm_launch
+VPATH += ../xml
+
+install:install-pre install-cfg
+
+install-pre:
+ install -m 644 -t $(DESTDIR)/usr/agl/conf/sm_launch system_launcher_main.xml
+
+install-cfg:$(ORDER_CFGFILES)
+ set -e ;\
+ install -d -m 775 $(INST_CONFDIR) ;\
+ for cfgfile in $(ORDER_CFGFILES);do \
+ install -m 644 -t $(INST_CONFDIR) $$cfgfile;\
+ done ;\
+
+#Create CFG file
+%.order.cfg:%.order %.cfg
+ echo $@
+ set -e; \
+ $(HOST_CPP) $(CPPFLAGS) -P -include $(CONF_WON_H) $< > launch_in.order; \
+ $(HOST_ORDER_XML2CFG) launch_in.order $(filter %.cfg,$+) > $@ ; \
+ rm -fr launch_in.order;
+
+%.order:
+ echo $@
+ set -e; \
+ if [ ! -e $@ ] ; then \
+ touch $@ ; \
+ fi
+
+PHONY:install-cfg
+
+include ../../../../system_service.mk
diff --git a/systemservice/config/library/system_manager_config/order/launch_order_body.xml b/systemservice/config/library/system_manager_config/order/launch_order_body.xml
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/systemservice/config/library/system_manager_config/order/launch_order_body.xml
diff --git a/systemservice/config/library/system_manager_config/order/launch_order_main.xml b/systemservice/config/library/system_manager_config/order/launch_order_main.xml
new file mode 100644
index 00000000..ee226464
--- /dev/null
+++ b/systemservice/config/library/system_manager_config/order/launch_order_main.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" ?>
+
+<!DOCTYPE launch_order [
+ <!ELEMENT launch_order (order*) >
+
+ <!ELEMENT order (group+) >
+ <!ATTLIST order
+ oname ID #REQUIRED
+ fixed_group CDATA "NULL"
+ >
+
+ <!ELEMENT group EMPTY >
+ <!ATTLIST group
+ gname CDATA #REQUIRED
+ waittime CDATA "0"
+ >
+
+ <!ENTITY launch_order_body SYSTEM "launch_order_body.xml">
+]>
+
+<launch_order>
+ &launch_order_body;
+</launch_order>
diff --git a/systemservice/config/library/system_manager_config/order/launch_order_xml2cfg.pl b/systemservice/config/library/system_manager_config/order/launch_order_xml2cfg.pl
new file mode 100755
index 00000000..10601074
--- /dev/null
+++ b/systemservice/config/library/system_manager_config/order/launch_order_xml2cfg.pl
@@ -0,0 +1,171 @@
+#!/usr/bin/perl -w
+use strict;
+
+use XML::XPath;
+use File::Copy;
+
+my $main_file="launch_order_main.xml";
+my $body_file="launch_order_body.xml";
+
+
+sub usage(){
+ print STDERR "USAGE:$0 *.order *.cfg\n"
+}
+
+
+
+
+#=== MAIN ===
+my $ret=system("which xmllint > /dev/null");
+if($ret != 0){
+ print STDERR "It need xmllint. Please install it.\n";
+ exit 1;
+}
+
+if(2 != @ARGV){
+ usage();
+ exit 1;
+}
+
+my $infile=$ARGV[0];
+my $launchfile=$ARGV[1];
+
+
+#ARG CHECK
+if($infile !~ /.+\.order$/){
+ print STDERR "$infile is not *.order\n";
+ exit 1;
+}elsif(! -e $infile){
+ print "$infile not found\n";
+ usage();
+ exit 1;
+}
+
+if($launchfile !~ /.+\.cfg$/){
+ print STDERR "$launchfile is not *.cfg\n";
+ exit 1;
+}elsif(! -e $launchfile){
+ print "$launchfile not found\n";
+ usage();
+ exit 1;
+}
+
+
+system("cp -f $infile $body_file");
+
+#check xml vaild
+$ret=system("xmllint --noout --valid $main_file");
+if($ret != 0){
+ print STDERR "XML is Invalid. \n";
+ exit 1;
+}
+
+my $date=`LANG=en date`;
+print "# This file is created from $infile and $launchfile\n";
+print "# created date : $date\n";
+
+my %gnamemap;
+my %gidmap;
+
+open(FIN,"<$launchfile") or die("error :$!");
+while (my $line = <FIN>){
+ if($line =~ /^Launch/){
+ $line =~ s/^[^|]+=//g;
+ my @args = split(/\|/,$line);
+ $gnamemap{$args[0]}=$args[1];
+ $gidmap{$args[1]}=$args[0];
+ }
+}
+close(FIN);
+
+foreach my $key (sort{$a <=> $b} keys(%gidmap)){
+ print "#$key:$gidmap{$key}\n";
+}
+
+
+my $xml = XML::XPath->new(filename=>$main_file);
+
+my $orders = $xml->find('/launch_order/order');
+foreach my $order ($orders->get_nodelist) {
+ my $groups = $order->find('./group');
+
+ my $oname=$order->findvalue('@oname');
+ my $fixed_group=$order->findvalue('@fixed_group');
+
+ print "[$oname]\n";
+ print "order=";
+
+ my %l_gidmap = %gidmap;
+ my $sep="";
+ #fix groups
+ if($fixed_group ne "NULL"){
+ if(! exists $gnamemap{$fixed_group}){
+ die("$fixed_group not found");
+ }
+ foreach my $gid (sort{$a <=> $b} keys(%l_gidmap)){
+ print "$sep$gid";
+ $sep="|";
+ my $str=$l_gidmap{$gid};
+ delete $l_gidmap{$gid};
+ if($str eq $fixed_group){
+ last;
+ }
+ }
+ }
+
+ # re-order group via *.order
+ my %waitow;
+ foreach my $group ($groups->get_nodelist) {
+ my $gname=$group->findvalue('@gname');
+ my $waittime=XML::XPath::Number::value($group->findvalue('@waittime'));
+
+ my $gid=$gnamemap{$gname};
+
+ if(! exists $gnamemap{$gname}){
+ die("$oname:$gname is not defined");
+ }
+
+ if(! exists $l_gidmap{$gid}){
+ die("$oname:$gname is multiple defined");
+ }
+
+ print "$sep$gid";
+ $sep="|";
+ delete $l_gidmap{$gid};
+
+ if($waittime > 0){
+ $waitow{$gname} = $waittime;
+ }
+ }
+
+# Output waittime configuration
+
+ #out rest groups
+ foreach my $gid (sort{$a <=> $b} keys(%l_gidmap)){
+ print "$sep$gid";
+ $sep="|";
+ }
+
+ print "\n";
+ if(keys(%waitow) > 0 ){
+ print "owlist=";
+ $sep="";
+ foreach my $owgroup ( keys(%waitow)) {
+ print "${sep}oww_${owgroup}";
+ $sep="|";
+ }
+ print "\n";
+
+ foreach my $owgroup ( keys(%waitow)) {
+ print "oww_${owgroup}=$waitow{$owgroup}\n";
+ }
+
+
+ }
+ print "\n";
+}
+
+
+
+
+
diff --git a/systemservice/config/library/system_manager_config/order/system_launcher_main.order.cfg b/systemservice/config/library/system_manager_config/order/system_launcher_main.order.cfg
new file mode 100644
index 00000000..dc49cd70
--- /dev/null
+++ b/systemservice/config/library/system_manager_config/order/system_launcher_main.order.cfg
@@ -0,0 +1,3 @@
+# This file is created from launch_in.order and system_launcher_main.cfg
+# created date : Tue Aug 29 13:45:54 JST 2017
+
diff --git a/systemservice/config/library/system_manager_config/order/system_launcher_main.xml b/systemservice/config/library/system_manager_config/order/system_launcher_main.xml
new file mode 100644
index 00000000..2dd97d97
--- /dev/null
+++ b/systemservice/config/library/system_manager_config/order/system_launcher_main.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" ?>
+
+<!DOCTYPE system_launcher [
+ <!ELEMENT system_launcher (group+) >
+
+ <!ELEMENT group (launch+) >
+ <!ATTLIST group
+ name CDATA #REQUIRED
+ wait_time CDATA #REQUIRED
+ trigger (True|False) #REQUIRED
+ >
+
+ <!ELEMENT launch EMPTY >
+ <!ATTLIST launch
+ name CDATA #REQUIRED
+ path CDATA #REQUIRED
+ priority CDATA #REQUIRED
+ critical CDATA #REQUIRED
+ retry_cnt CDATA #REQUIRED
+ arguments CDATA #REQUIRED
+ logging_mask CDATA "NULL"
+ restart (me|NULL) #REQUIRED
+ is_start_required (True|False) #REQUIRED
+ shutdown_critical CDATA #REQUIRED
+ shutdown_wait_time CDATA #REQUIRED
+ fast_shutdown_wait_time CDATA #REQUIRED
+ user_name CDATA #REQUIRED
+ env_cond CDATA #IMPLIED
+ >
+
+ <!ENTITY system_launcher_body SYSTEM "system_launcher_body.xml">
+]>
+
+<system_launcher>
+ &system_launcher_body;
+</system_launcher>
diff --git a/systemservice/config/library/system_manager_config/src/Makefile b/systemservice/config/library/system_manager_config/src/Makefile
new file mode 100644
index 00000000..9fbc9ccd
--- /dev/null
+++ b/systemservice/config/library/system_manager_config/src/Makefile
@@ -0,0 +1,45 @@
+#
+# @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
+#
+# 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.
+#
+
+#HOST TOOLS
+INST_SHLIBS = libsssmcfg
+
+VPATH = ./ ../include/$(COMPONENT_NAME)
+
+INST_HEADERS = ss_system_manager_conf.h
+INST_HEADERS += ss_package.h
+INST_HEADERS += ss_access_if_private.h
+INST_HEADERS += system_manager_config.h
+
+libsssmcfg_SRCS = ss_system_manager_conf.cpp
+
+
+
+CPPFLAGS += -I../include
+
+LDFLAGS += -Wl,--no-as-needed
+
+LDLIBS += -Wl,-Bdynamic -lSS_SystemIfUnified
+LDLIBS += -Wl,-Bdynamic -lSS_RomAccessIf
+LDLIBS += -Wl,-Bdynamic -lssver
+
+LDLIBS += -Wl,-Bdynamic -lNS_FrameworkUnified
+LDLIBS += -Wl,-Bdynamic -lvp
+
+DUMMY_SHLIB += libSS_RomAccessIf.so
+DUMMY_SHLIB += libSS_SystemIfUnified.so
+
+include ../../../../system_service.mk
diff --git a/systemservice/config/library/system_manager_config/src/libsssmcfg.ver b/systemservice/config/library/system_manager_config/src/libsssmcfg.ver
new file mode 100644
index 00000000..4d61996c
--- /dev/null
+++ b/systemservice/config/library/system_manager_config/src/libsssmcfg.ver
@@ -0,0 +1,30 @@
+/*
+ * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
+ *
+ * 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.
+ */
+
+#
+# libsssmcfg version script
+#
+{
+ global:
+ ### .text section ###
+ extern "C++" {
+ ss_sm_initHook*;
+ ss_sm_avilavbilityHook*;
+ };
+ local:
+ *;
+};
+
diff --git a/systemservice/config/library/system_manager_config/src/ss_system_manager_conf.cpp b/systemservice/config/library/system_manager_config/src/ss_system_manager_conf.cpp
new file mode 100644
index 00000000..16ec02a4
--- /dev/null
+++ b/systemservice/config/library/system_manager_config/src/ss_system_manager_conf.cpp
@@ -0,0 +1,489 @@
+/*
+ * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
+ *
+ * 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.
+ */
+
+#include <fstream>
+#include <string.h>
+#include <agl_thread.h>
+#include <other_service/VP_GetEnv.h>
+
+#include <system_service/ss_templates.h>
+#include <system_service/ss_sm_ram_access.h>
+#include <system_service/ss_ver.h>
+
+#include "system_service/ss_package.h"
+#include "system_service/ss_access_if_private.h"
+#include "system_service/ss_system_manager_conf.h"
+
+#ifndef ZONE_WARN
+#define ZONE_WARN ZONEMASK(30)
+#endif
+#ifndef ZONE_INFO
+#define ZONE_INFO ZONEMASK(29)
+#endif
+
+/* Environment variable name */
+const CHAR LaunchConfigFileNameEnvVariable[] = "APPS_CONFIG_FILENAME";
+const CHAR AreaTypeEnvVariable[] = "VEHICLEPARAMETERLIBRARY_AREA";
+const CHAR BrandTypeEnvVariable[] = "VEHICLEPARAMETERLIBRARY_BRAND";
+const CHAR GradeEnvVariable[] = "VP_VEHICLEPARAMETERLIBRARY_grade";
+
+/* Environment variable value */
+const CHAR EnvValueYes[] = "y";
+const CHAR EnvValueNo[] = "n";
+
+const CHAR EnvValueAvailable[] = "available";
+const CHAR EnvValueUnavailable[] = "unavailable";
+
+/*
+ * Note.
+ * Define areas, brands, and grades by the vendor.
+ * For example, an area is a destination of a product.
+ * Examples of areas : JP(Japan), EU, etc.
+ */
+const CHAR EnvValueArea1[] = "Area1";
+const CHAR EnvValueArea2[] = "Area2";
+const CHAR EnvValueArea3[] = "Area3";
+const CHAR EnvValueArea4[] = "Area4";
+const CHAR EnvValueBrand1[] = "Brand1";
+const CHAR EnvValueBrand2[] = "Brand2";
+const CHAR EnvValueGrade1[] = "Grade1";
+const CHAR EnvValueGrade2[] = "Grade2";
+const CHAR EnvValueGrade3[] = "Grade3";
+
+/* Package information */
+const CHAR PkgInfoGen2[] = "Gen2";
+
+
+typedef struct T_SS_SM_CONF_CTX {
+ EFrameworkunifiedStatus (*cbRebootNoticeFunc)(HANDLE hApp);
+ T_SS_SM_CONF_CTX()
+ : cbRebootNoticeFunc(NULL) {
+ }
+} T_SS_SM_CONF_CTX_INFO;
+
+static T_SS_SM_CONF_CTX_INFO s_confCtx;
+
+/***********************************************************************
+ * registProtectSvcs
+ ***********************************************************************/
+static void registProtectSvcs(std::vector<std::string> & protectedSvcs) {
+ protectedSvcs.push_back(MN_NS_SHAREDMEM);
+ protectedSvcs.push_back(MN_NS_NPPSERVICE);
+ protectedSvcs.push_back(MN_NS_BACKUPMGR);
+ protectedSvcs.push_back(MN_SS_LOGGERSRV);
+ protectedSvcs.push_back(MN_COMMUNICATION);
+ protectedSvcs.push_back(MN_PS_PSMSHADOW);
+ protectedSvcs.push_back(MN_SS_POWERSERVICE);
+}
+
+/***********************************************************************
+ * registGroupRelaunchSvcs
+ ***********************************************************************/
+static void registGroupRelaunchSvcs(
+ std::vector<std::string> & groupRelaunchSvcs) {
+ groupRelaunchSvcs.push_back(MN_ENFORMSERVICE);
+ groupRelaunchSvcs.push_back(MN_NAVIPROXY);
+ groupRelaunchSvcs.push_back(MN_AWBPROXY);
+ groupRelaunchSvcs.push_back(MN_TFFPROXY);
+ groupRelaunchSvcs.push_back(MN_AWNPRIMARY);
+ groupRelaunchSvcs.push_back(MN_AWMPRIMARY);
+ groupRelaunchSvcs.push_back(MN_AWBPRIMARY);
+ groupRelaunchSvcs.push_back(MN_AWTPRIMARY);
+}
+
+/***********************************************************************
+ * setEvnVariableForLaunchConfigFile
+ ***********************************************************************/
+static EFrameworkunifiedStatus setEvnVariableForLaunchConfigFile(std::string f_sEnvFile,
+ std::string f_sEnvBrand,
+ std::string f_sEnvGrade,
+ BOOL f_bIsVup) {
+ EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
+ const CHAR VupLaunchConfigFileName[] = "sm_launch_vup.cfg";
+ const CHAR LaunchConfigFileName1[] = "sm_launch.cfg";
+ const CHAR LaunchConfigFileName2[] = "sm_launch.cfg";
+
+ // If an environment variable is set, that value is used, so set only when it is not set
+ if (f_sEnvFile.empty()) {
+ const CHAR *l_pLaunchConfigFile = NULL;
+
+ if (f_bIsVup) {
+ l_pLaunchConfigFile = VupLaunchConfigFileName;
+ } else {
+ // Change the file read by Brand and Grade
+ if ((f_sEnvBrand == EnvValueBrand2) && (f_sEnvGrade != EnvValueGrade1)) {
+ l_pLaunchConfigFile = LaunchConfigFileName1;
+ } else {
+ l_pLaunchConfigFile = LaunchConfigFileName2;
+ }
+
+ std::string cnfPath = "/usr/agl/conf/BS/ss/system_manager/rwdata/";
+ cnfPath += l_pLaunchConfigFile;
+ if (access(cnfPath.c_str(), F_OK) != 0) {
+ l_pLaunchConfigFile = LaunchConfigFileName1;
+ }
+ }
+
+ if (0 != setenv(LaunchConfigFileNameEnvVariable, l_pLaunchConfigFile, 1)) {
+ SS_ASERT_ERRNO(0);
+ l_eStatus = eFrameworkunifiedStatusFail;
+ }
+ }
+
+ return l_eStatus;
+}
+
+/***********************************************************************
+ * setEvnVariableForLaunchCus
+ ***********************************************************************/
+static EFrameworkunifiedStatus setEvnVariableForLaunchCus(std::string f_sEnvArea) {
+ EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
+ const CHAR LaunchCusEnvVariable[] = "SM_CONF_LAUNCH_CUS";
+
+ const CHAR *l_pSetValue =
+ (EnvValueArea1 == f_sEnvArea || EnvValueArea2 == f_sEnvArea) ?
+ EnvValueYes : EnvValueNo;
+
+ if (0 != setenv(LaunchCusEnvVariable, l_pSetValue, 1)) {
+ SS_ASERT_ERRNO(0);
+ l_eStatus = eFrameworkunifiedStatusFail;
+ }
+
+ return l_eStatus;
+}
+
+/***********************************************************************
+ * setEvnVariableForLaunchTFF
+ ***********************************************************************/
+static EFrameworkunifiedStatus setEvnVariableForLaunchTFF(std::string f_sEnvArea) {
+ EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
+ const CHAR LaunchTFFEnvVariable[] = "SM_CONF_LAUNCH_TFF";
+
+ const CHAR *l_pSetValue = EnvValueNo;
+
+ BOOL l_bArea1 = (f_sEnvArea == EnvValueArea1) ? TRUE : FALSE;
+ BOOL l_bArea2 = (f_sEnvArea == EnvValueArea2) ? TRUE : FALSE;
+
+ if (l_bArea1 || l_bArea2) {
+ l_pSetValue = EnvValueYes;
+ } else {
+ l_pSetValue = EnvValueNo;
+ }
+
+ if (0 != setenv(LaunchTFFEnvVariable, l_pSetValue, 1)) {
+ SS_ASERT_ERRNO(0);
+ l_eStatus = eFrameworkunifiedStatusFail;
+ }
+
+ return l_eStatus;
+}
+
+/***********************************************************************
+ * getEnvValiavleWithDefault
+ ***********************************************************************/
+static std::string getEnvValiavleWithDefault(const CHAR *f_pEnvName,
+ const CHAR *f_pDefault) {
+ std::string l_sReturnValue;
+ char buf[VP_MAX_LENGTH];
+
+ VP_GetEnv(f_pEnvName, buf);
+ if (buf[0] == '\0') {
+ l_sReturnValue = (NULL != f_pDefault) ? f_pDefault : "";
+ } else {
+ l_sReturnValue = buf;
+ }
+ return l_sReturnValue;
+}
+
+
+/***********************************************************************
+ * getPkgInfoWithDefault
+ ***********************************************************************/
+static std::string
+getPkgInfoWithDefault(const CHAR *f_pPkgName, const CHAR *f_pDefault){
+ std::string l_sReturnValue = (NULL != f_pDefault) ? f_pDefault : "";
+
+ try {
+ SSVER_PkgInfo pkgInfo = {0};
+ CSSVer cVersion;
+
+ if(!cVersion.empty()){
+ EFrameworkunifiedStatus ret = cVersion.getPkgInfo(f_pPkgName, &pkgInfo);
+ if((ret == eFrameworkunifiedStatusOK) && ('\0' != pkgInfo.version[0])){
+ l_sReturnValue = pkgInfo.version;
+ }
+ }
+ } catch(EFrameworkunifiedStatus ee){
+ SS_ASERT(0);
+ }
+
+ return l_sReturnValue;
+}
+
+/***********************************************************************
+ * setEvnVariableForPkgSeriesInfo
+ ***********************************************************************/
+static EFrameworkunifiedStatus
+setEvnVariableForPkgSeriesInfo(std::string f_sPkgSeriesInfo){
+ EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
+ const CHAR PkgSeriesEnvVariable[] = "SM_CONF_PKG_SERIES";
+
+ if (f_sPkgSeriesInfo.empty()) {
+ SS_ASERT(0);
+ }
+
+ if (0 != setenv(PkgSeriesEnvVariable, f_sPkgSeriesInfo.c_str(), 1)) {
+ SS_ASERT_ERRNO(0);
+ l_eStatus = eFrameworkunifiedStatusFail;
+ }
+
+ return l_eStatus;
+}
+
+/***********************************************************************
+ * setVersionInfo subfunction(version,date settings)
+ ***********************************************************************/
+static EFrameworkunifiedStatus setVerInfo_version_date(const char* VerPath) {
+ EFrameworkunifiedStatus configRet = eFrameworkunifiedStatusOK;
+ CSSVer ver;
+ SSVER_PkgInfo pkgInfo;
+
+ bzero(&pkgInfo, sizeof(pkgInfo));
+ std::string line;
+ std::ifstream verFin(VerPath);
+ if (verFin) {
+ if (std::getline(verFin, line)) {
+ snprintf(pkgInfo.version, sizeof(pkgInfo.version), "%s",
+ line.c_str());
+ }
+
+ if (std::getline(verFin, line)) {
+ snprintf(pkgInfo.date, sizeof(pkgInfo.date), "%s", line.c_str());
+ }
+
+ configRet = ver.setPkgInfo(SS_PKG_MAIN_LPF_SI, pkgInfo);
+ SS_ASERT(configRet == eFrameworkunifiedStatusOK);
+ } else {
+ SS_ASERT_ERRNO(0);
+ }
+ return configRet;
+}
+
+/***********************************************************************
+ * Set version information
+ ***********************************************************************/
+static EFrameworkunifiedStatus setVersionInfo(void) {
+ EFrameworkunifiedStatus configRet = eFrameworkunifiedStatusOK;
+
+ try {
+ CSSVer ver;
+ SSVER_PkgInfo pkgInfo;
+ const char targetEnv[] = "TARGET_BOARD";
+
+ // HARDWARE
+ snprintf(pkgInfo.version, sizeof(pkgInfo.version), "%s",
+ getEnvValiavleWithDefault(targetEnv, NULL).c_str());
+ pkgInfo.date[0] = '\0';
+ configRet = ver.setPkgInfo(SS_PKG_TARGETBOARD, pkgInfo);
+ SS_ASERT(configRet == eFrameworkunifiedStatusOK);
+
+ // Set PRODUCT version information
+ const char prdVersion[] = "/usr/agl/share/BS/ss/system_manager/rodata/version.txt";
+ {
+ std::string line;
+ std::ifstream prdFin(prdVersion);
+ if (prdFin) {
+ bzero(&pkgInfo, sizeof(pkgInfo));
+ if (std::getline(prdFin, line)) {
+ snprintf(pkgInfo.version, sizeof(pkgInfo.version), "%s",
+ line.c_str());
+ }
+ configRet = ver.setPkgInfo(SS_PKG_MAIN_EMMC, pkgInfo);
+ SS_ASERT(configRet == eFrameworkunifiedStatusOK);
+
+ bzero(&pkgInfo, sizeof(pkgInfo));
+ if (std::getline(prdFin, line)) {
+ snprintf(pkgInfo.version, sizeof(pkgInfo.version), "%s",
+ line.c_str());
+ }
+ configRet = ver.setPkgInfo(SS_PKG_MAIN_PRODUCT_SI, pkgInfo);
+ SS_ASERT(configRet == eFrameworkunifiedStatusOK);
+ } else {
+ SS_ASERT_ERRNO(0);
+ }
+ }
+
+ // PHASE_INFO
+ const char phaseVersion[] = "/usr/agl/share/BS/ss/system_manager/rodata/PhaseInfo.txt";
+ {
+ configRet = setVerInfo_version_date(phaseVersion);
+ }
+
+ } catch (EFrameworkunifiedStatus ee) {
+ SS_ASERT(0);
+ configRet = ee;
+ }
+ return configRet;
+}
+
+// If _CWORD83_ common header is added, replace with century definition
+#define NTFY_PSMShadowService_Availability MN_PS_PSMSHADOW"/Availability"
+
+EFrameworkunifiedStatus cbPsmNotificationFunc(HANDLE hApp) {
+ EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
+
+ if (MSG_PSM_REBOOT_NOTIFY != FrameworkunifiedGetMsgProtocol(hApp)) {
+ SS_ASERT(0);
+ goto ERROR;
+ }
+
+ if (NULL != s_confCtx.cbRebootNoticeFunc) {
+ l_eStatus = s_confCtx.cbRebootNoticeFunc(hApp);
+ if (l_eStatus != eFrameworkunifiedStatusOK) {
+ SS_ASERT(0);
+ goto ERROR;
+ }
+ } else {
+ SS_ASERT(0);
+ goto ERROR;
+ }
+
+ERROR:
+ return l_eStatus;
+}
+
+EFrameworkunifiedStatus cbServiceNotificationFunc(HANDLE hApp) {
+ EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
+ PCSTR l_availabilityName;
+ BOOL l_serviceAvailability;
+
+ l_availabilityName = FrameworkunifiedGetLastNotification(hApp);
+ if (l_availabilityName == NULL) {
+ SS_ASERT(0);
+ goto ERROR;
+ }
+ l_serviceAvailability = FrameworkunifiedIsServiceAvailable(hApp);
+
+ FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "%s : %s", l_availabilityName,
+ l_serviceAvailability ? "TRUE" : "FALSE");
+
+ // Since it is necessary to guarantee SYNC of RAMD at _CWORD71_
+ // within 200msec after receiving reboot notice from SYS mcu,
+ // do UMOUNT RAMD immediately after receiving reboot notice by SystemManager.
+ if ((strcmp(NTFY_PSMShadowService_Availability, l_availabilityName) == 0)
+ && (l_serviceAvailability)) {
+ l_eStatus = FrameworkunifiedAttachCallbackToDispatcher(hApp, FRAMEWORKUNIFIED_ANY_SOURCE,
+ MSG_PSM_REBOOT_NOTIFY,
+ cbPsmNotificationFunc);
+ if (eFrameworkunifiedStatusOK != l_eStatus) {
+ SS_ASERT(0);
+ goto ERROR;
+ }
+ }
+
+ERROR:
+ return l_eStatus;
+}
+
+/***********************************************************************
+ * ss_sm_initHook
+ ***********************************************************************/
+EFrameworkunifiedStatus ss_sm_initHook(HANDLE hApp, const T_SS_SM_INIT_HOOK_IN_PARAM *inPrm,
+ T_SS_SM_INIT_HOOK_OUT_PARAM *outPrm) {
+ EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
+ std::string l_sEnvFile;
+ std::string l_sEnvArea;
+ std::string l_sEnvBrand;
+ std::string l_sEnvGrade;
+
+ std::string l_sPkgSeriesInfo;
+
+ // Register non-recoverable services for OOM Killer
+ registProtectSvcs(outPrm->protectedSvcs);
+
+ // Register services for Group Relaunch
+ registGroupRelaunchSvcs(outPrm->groupRelaunchSvcs);
+
+ if (NULL == inPrm->cbRebootNoticeFunc) {
+ SS_ASERT(0);
+ } else {
+ s_confCtx.cbRebootNoticeFunc = inPrm->cbRebootNoticeFunc;
+ }
+
+ /** Set Version information **/
+ if (eFrameworkunifiedStatusOK != setVersionInfo()) {
+ SS_ASERT(0);
+ }
+
+ /** Get environment variable **/
+
+ // APPS_CONFIG_FILENAME (not set by default)
+ l_sEnvFile = getEnvValiavleWithDefault(LaunchConfigFileNameEnvVariable, NULL);
+
+ // VEHICLEPARAMETERLIBRARY_AREA
+ l_sEnvArea = getEnvValiavleWithDefault(AreaTypeEnvVariable, EnvValueArea1);
+
+ // VEHICLEPARAMETERLIBRARY_BRAND
+ l_sEnvBrand = getEnvValiavleWithDefault(BrandTypeEnvVariable, NULL);
+
+ // VEHICLEPARAMETERLIBRARY_grade
+ l_sEnvGrade = getEnvValiavleWithDefault(GradeEnvVariable, NULL);
+
+
+ /** Get Package information **/
+
+ // SERIES_INFO
+ l_sPkgSeriesInfo = getPkgInfoWithDefault(SS_PKG_SERIES_INFO, NULL);
+
+
+ /** Set environment variable **/
+ // APPS_CONFIG_FILENAME
+ if (eFrameworkunifiedStatusOK
+ != setEvnVariableForLaunchConfigFile(l_sEnvFile, l_sEnvBrand,
+ l_sEnvGrade, inPrm->bIsVupMode)) {
+ SS_ASERT(0);
+ }
+
+ // SM_CONF_PKG_SERIES
+ if (eFrameworkunifiedStatusOK != setEvnVariableForPkgSeriesInfo(l_sPkgSeriesInfo)) {
+ SS_ASERT(0);
+ }
+
+
+ // SM_CONF_LAUNCH_CUS
+ if (eFrameworkunifiedStatusOK != setEvnVariableForLaunchCus(l_sEnvArea)) {
+ SS_ASERT(0);
+ }
+
+ // SM_CONF_LAUNCH_TFF
+ if (eFrameworkunifiedStatusOK
+ != setEvnVariableForLaunchTFF(l_sEnvArea)) {
+ SS_ASERT(0);
+ }
+
+ if (eFrameworkunifiedStatusOK
+ != (l_eStatus = FrameworkunifiedSubscribeNotificationWithCallback(
+ hApp, NTFY_PSMShadowService_Availability, cbServiceNotificationFunc))) {
+ FRAMEWORKUNIFIEDLOG(
+ ZONE_ERR,
+ __FUNCTION__,
+ " Error: FrameworkunifiedSubscribeNotificationWithCallback(" "hApp, %s) errored: %d/'%s'",
+ NTFY_PSMShadowService_Availability, l_eStatus, GetStr(l_eStatus).c_str());
+ }
+
+ return l_eStatus;
+}
+
diff --git a/systemservice/config/library/system_manager_config/xml/Makefile b/systemservice/config/library/system_manager_config/xml/Makefile
new file mode 100644
index 00000000..e11288c4
--- /dev/null
+++ b/systemservice/config/library/system_manager_config/xml/Makefile
@@ -0,0 +1,53 @@
+#
+# @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
+#
+# 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.
+#
+
+#HOST TOOLS
+HOST_CPP = cpp
+HOST_LAUNCH_XML2CFG = ./launch_xml2cfg.sh
+
+CONF_DIR = $(SDKTARGETSYSROOT)/usr/agl/conf
+CONF_THREAD_H = $(SDKTARGETSYSROOT)/usr/agl/include/agl_thread.h
+
+LAUNCH_XMLFILES = $(shell cd $(CONF_DIR)/sm_launch; ls *.xml)
+LAUNCH_CFGFILES = $(LAUNCH_XMLFILES:%.xml=%.cfg)
+
+INST_CONFDIR = $(SDKTARGETSYSROOT)/usr/agl/conf/systemmanager
+
+CLEAN_FILES = system_launcher_body.xml $(LAUNCH_CFGFILES)
+
+VPATH = $(CONF_DIR)/sm_launch
+
+install:install-pre install-cfg
+
+install-pre:
+ install -d -m 775 $(DESTDIR)/usr/agl/conf;\
+ install -d -m 775 $(DESTDIR)/usr/agl/conf/sm_launch;\
+ install -d -m 775 $(DESTDIR)/usr/agl/conf/systemmanager;\
+ install -m 644 -t $(DESTDIR)/usr/agl/conf/sm_launch sm_launch_agl.xml
+
+install-cfg:$(LAUNCH_CFGFILES)
+ set -e ;\
+ install -d -m 775 $(INST_CONFDIR) ;\
+ for cfgfile in $(LAUNCH_CFGFILES);do \
+ install -m 644 -t $(INST_CONFDIR) $$cfgfile;\
+ done ;\
+
+#Create CFG file
+# %.cfg:%.xml # defined in agl.mk
+
+PHONY:install-cfg
+
+include ../../../../system_service.mk
diff --git a/systemservice/config/library/system_manager_config/xml/launch_cfg2xml.sh b/systemservice/config/library/system_manager_config/xml/launch_cfg2xml.sh
new file mode 100644
index 00000000..57b6ee22
--- /dev/null
+++ b/systemservice/config/library/system_manager_config/xml/launch_cfg2xml.sh
@@ -0,0 +1,69 @@
+#!/bin/bash
+
+#
+# Copyright (c) 2019-2020 TOYOTA MOTOR CORPORATION
+#
+# 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.
+#
+
+export infile=$1
+export g_group=1
+
+if ! [[ "$infile" =~ .+\.cfg ]] ;then
+ echo "$infile is not *.cfg"
+ exit 1
+elif ! [ -e $infile ];then
+ echo "$infile not found"
+ exit 1
+fi
+
+#GROUP extraction
+cat ${infile} | while read line
+do
+ if ! [[ "${line}" =~ ^[#\[] ]]; then #Remove first #[
+ echo $line | sed 's/Launch[0-9]\+=//g' | cut -d '|' -f1-4
+ fi
+done | uniq | while read line
+do
+ echo "<!-- group_id=$g_group -->"
+ echo "<group name=\"`echo $line | cut -d '|' -f1`\" wait_time=\"`echo $line | cut -d '|' -f3`\" trigger=\"`echo $line | cut -d '|' -f4`\" >"
+
+ cat ${infile} | while read line
+ do
+ if ! [[ "${line}" =~ ^[#\[] ]]; then #Remove first #[
+ l_group=`echo $line | sed 's/Launch[0-9]\+=//g' | cut -d '|' -f2`
+
+ #Extract only LAUNCH applicable to g_group
+ if [ ${l_group} = ${g_group} ]; then
+ echo $line | sed 's/Launch[0-9]\+=//g' | cut -d '|' -f5-
+ fi
+ fi
+ done | while read line
+ do
+ echo " <launch "
+ echo " name=\"`echo $line | cut -d '|' -f1`\" path=\"`echo $line | cut -d '|' -f2`\" priority=\"`echo $line | cut -d '|' -f3`\""
+ echo " critical=\"`echo $line | cut -d '|' -f4`\" retry_cnt=\"`echo $line | cut -d '|' -f5`\" arguments=\"`echo $line | cut -d '|' -f6`\""
+ echo " logging_mask=\"`echo $line | cut -d '|' -f7`\" restart=\"`echo $line | cut -d '|' -f8`\" is_start_required=\"`echo $line | cut -d '|' -f9`\""
+ echo " shutdown_critical=\"`echo $line | cut -d '|' -f10`\" shutdown_wait_time=\"`echo $line | cut -d '|' -f11`\" fast_shutdown_wait_time=\"`echo $line | cut -d '|' -f12`\""
+ echo " user_name=\"`echo $line | cut -d '|' -f13`\""
+ echo " />"
+ done
+
+ echo "</group>"
+
+ g_group=$(($g_group + 1))
+done
+
+
+
+
diff --git a/systemservice/config/library/system_manager_config/xml/launch_xml2cfg.sh b/systemservice/config/library/system_manager_config/xml/launch_xml2cfg.sh
new file mode 100644
index 00000000..20fa0979
--- /dev/null
+++ b/systemservice/config/library/system_manager_config/xml/launch_xml2cfg.sh
@@ -0,0 +1,116 @@
+#!/bin/bash
+
+#
+# Copyright (c) 2019-2020 TOYOTA MOTOR CORPORATION
+#
+# 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.
+#
+
+#xpath is slow, so use sed as much as possible
+
+infile=$1
+
+main_file=system_launcher_main.xml
+body_file=system_launcher_body.xml
+
+
+#check xmllint is exist
+if ! which xmllint > /dev/null ; then
+ echo "It need xmllint. Please install it."
+ exit 1;
+fi
+
+#check xpath is exist
+if ! which xpath > /dev/null ; then
+ echo "It need xpath Please install it."
+ exit 1;
+fi
+
+#arg check
+if ! [[ "$infile" =~ .+\.xml ]] ;then
+ echo "$infile is not *.xml"
+ exit 1
+elif ! [ -e $infile ];then
+ echo "$infile not found"
+ exit 1
+fi
+
+cp -f $infile $body_file
+
+#check xml vaild
+if ! xmllint --noout --valid $main_file ;then
+ echo "XML is Invalid. "
+ exit 1;
+fi
+
+#Read into memory after shaping with xpath
+xmem=`xpath -q -e /system_launcher $main_file`
+
+echo "# This file is created from $infile."
+echo "# created date : `LANG=en date`"
+echo "[ModulesLaunchConfig]"
+
+#GROUP LOOP
+group_num=`echo $xmem | xpath -e /system_launcher/group 2>&1 | grep Found | cut -d ' ' -f2`
+
+l_idx=1
+cur_group=1
+until [ $cur_group -gt $group_num ];
+do
+ #LAUNCH LOOP
+ group_text=`echo $xmem | xpath -q -e /system_launcher/group[$cur_group]` #group full XML text
+ group_attr=`echo $group_text | sed 's/\(<group[^>]\+>\)\(.*\)/\1/g'`
+
+ g_name=`echo $group_attr | sed 's/\(.* name="\)\([^"]*\)\(.*\)/\2/g'`
+ g_wait_time=`echo $group_attr | sed 's/\(.* wait_time="\)\([^"]*\)\(.*\)/\2/g'`
+ g_trigger=`echo $group_attr | sed 's/\(.* trigger="\)\([^"]*\)\(.*\)/\2/g'`
+
+# echo $g_name $g_wait_time $g_trigger
+ l_launch_num=`echo $xmem | xpath -e /system_launcher/group[$cur_group]/launch 2>&1 | grep Found | cut -d ' ' -f2`
+
+ cur_launch=1;
+ until [ $cur_launch -gt $l_launch_num ]; do
+ launch_text=`echo $xmem | xpath -q -e /system_launcher/group[$cur_group]/launch[$cur_launch]`
+
+ l_attr="Launch${l_idx}=$g_name|$cur_group|$g_wait_time|$g_trigger"
+ l_attr+="|"`echo $launch_text | sed 's/\(.* name="\)\([^"]*\)\(.*\)/\2/g'`
+ l_attr+="|"`echo $launch_text | sed 's/\(.* path="\)\([^"]*\)\(.*\)/\2/g'`
+ l_attr+="|"`echo $launch_text | sed 's/\(.* priority="\)\([^"]*\)\(.*\)/\2/g'`
+ l_attr+="|"`echo $launch_text | sed 's/\(.* critical="\)\([^"]*\)\(.*\)/\2/g'`
+ l_attr+="|"`echo $launch_text | sed 's/\(.* retry_cnt="\)\([^"]*\)\(.*\)/\2/g'`
+ l_attr+="|"`echo $launch_text | sed 's/\(.* arguments="\)\([^"]*\)\(.*\)/\2/g'`
+ l_attr+="|"`echo $launch_text | sed 's/\(.* logging_mask="\)\([^"]*\)\(.*\)/\2/g'`
+ l_attr+="|"`echo $launch_text | sed 's/\(.* restart="\)\([^"]*\)\(.*\)/\2/g'`
+ l_attr+="|"`echo $launch_text | sed 's/\(.* is_start_required="\)\([^"]*\)\(.*\)/\2/g'`
+ l_attr+="|"`echo $launch_text | sed 's/\(.* shutdown_critical="\)\([^"]*\)\(.*\)/\2/g'`
+ l_attr+="|"`echo $launch_text | sed 's/\(.* shutdown_wait_time="\)\([^"]*\)\(.*\)/\2/g'`
+ l_attr+="|"`echo $launch_text | sed 's/\(.* fast_shutdown_wait_time="\)\([^"]*\)\(.*\)/\2/g'`
+ l_attr+="|"`echo $launch_text | sed 's/\(.* user_name="\)\([^"]*\)\(.*\)/\2/g'`
+ if echo "$launch_text" | grep -sq 'env_cond=' ; then
+ l_attr+="|"`echo $launch_text | sed 's/\(.* env_cond="\)\([^"]*\)\(.*\)/\2/g'`
+ else
+ l_attr+="|"
+ fi
+
+ echo $l_attr
+
+ cur_launch=$(($cur_launch+1))
+ l_idx=$(($l_idx+1))
+ done
+
+ cur_group=$(($cur_group+1))
+done
+
+
+
+
diff --git a/systemservice/config/library/system_manager_config/xml/sm_launch_agl.cfg b/systemservice/config/library/system_manager_config/xml/sm_launch_agl.cfg
new file mode 100644
index 00000000..876ab41d
--- /dev/null
+++ b/systemservice/config/library/system_manager_config/xml/sm_launch_agl.cfg
@@ -0,0 +1,7 @@
+# This file is created from sm_launch_agl.xml.tmp.
+# created date : Tue Aug 29 13:31:32 JST 2017
+[ModulesLaunchConfig]
+Launch1=CoreModules|1|0|False|NS_NPPService|/usr/agl/bin/NS_NPPService|25|True|0|-a SS_SysManager -r output=0x2|NULL|NULL|False|True|20|1000||
+Launch2=CoreModules|1|0|False|NS_BackupMgr|/usr/agl/bin/NS_BackupMgr|25|True|0|-l console|NULL|NULL|True|True|15|1000||
+Launch3=SS_Logger|2|0|False|SS_DevDetectSrv|/tmp/SS_DeviceDetectionService|20|True|0|-l console|NULL|NULL|True|False|1|1000||
+Launch4=SS_Logger|2|0|False|SS_LoggerSrv|/usr/agl/bin/SS_LoggerService|0|True|0|-l console -p thrd=pdg.LogQueReader:30,thrd=pdg.TransmitQueReader:30,thrd=pdg.DumpQueReader:11,thrd=pdg.PerformanceQueReader:11,thrd=pdg.LogQueWriter:30,thrd=pdg.TransmitQueWriter:30,thrd=pdg.EvntLogQue:8,thrd=pdg.UdpQueWriter:10|NULL|NULL|True|True|10|1000||
diff --git a/systemservice/config/library/system_manager_config/xml/sm_launch_agl.xml b/systemservice/config/library/system_manager_config/xml/sm_launch_agl.xml
new file mode 100644
index 00000000..a433be35
--- /dev/null
+++ b/systemservice/config/library/system_manager_config/xml/sm_launch_agl.xml
@@ -0,0 +1,35 @@
+<!-- group_id=1 -->
+<group name="CoreModules" wait_time="0" trigger="False" >
+ <launch
+ name="NS_NPPService" path="/usr/agl/bin/NS_NPPService" priority="25"
+ critical="True" retry_cnt="0" arguments="-a SS_SysManager -r output=0x2"
+ logging_mask="NULL" restart="NULL" is_start_required="False"
+ shutdown_critical="True" shutdown_wait_time="20" fast_shutdown_wait_time="1000"
+ user_name=""
+ />
+ <launch
+ name="NS_BackupMgr" path="/usr/agl/bin/NS_BackupMgr" priority="25"
+ critical="True" retry_cnt="0" arguments="-l console"
+ logging_mask="NULL" restart="NULL" is_start_required="True"
+ shutdown_critical="True" shutdown_wait_time="15" fast_shutdown_wait_time="1000"
+ user_name=""
+ />
+</group>
+<!-- group_id=2 -->
+<group name="SS_Logger" wait_time="0" trigger="False" >
+ <launch
+ name="SS_DevDetectSrv" path="/tmp/SS_DeviceDetectionService" priority="20"
+ critical="True" retry_cnt="0" arguments="-l console"
+ logging_mask="NULL" restart="NULL" is_start_required="True"
+ shutdown_critical="False" shutdown_wait_time="1" fast_shutdown_wait_time="1000"
+ user_name=""
+ />
+ <launch
+ name="SS_LoggerSrv" path="/usr/agl/bin/SS_LoggerService" priority="0"
+ critical="True" retry_cnt="0" arguments="-l console -p thrd=pdg.LogQueReader:30,thrd=pdg.TransmitQueReader:30,thrd=pdg.DumpQueReader:11,thrd=pdg.PerformanceQueReader:11,thrd=pdg.LogQueWriter:30,thrd=pdg.TransmitQueWriter:30,thrd=pdg.EvntLogQue:8,thrd=pdg.UdpQueWriter:10"
+ logging_mask="NULL" restart="NULL" is_start_required="True"
+ shutdown_critical="True" shutdown_wait_time="10" fast_shutdown_wait_time="1000"
+ user_name=""
+ />
+</group>
+