File tree Expand file tree Collapse file tree 7 files changed +60
-8
lines changed
listeners/libfsservice/cmn Expand file tree Collapse file tree 7 files changed +60
-8
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ include(GNUInstallDirs)
2626set (MINKIDLC_BIN_DIR "${CMAKE_CURRENT_SOURCE_DIR} /idlc" CACHE PATH "Directory containing the idlc executable" )
2727set (SYSTEMD_UNIT_DIR "" CACHE PATH "Directory containing the systemd unit path" )
2828set (UDEV_DIR "" CACHE PATH "Directory containing the UDEV path" )
29+ set (MINKIPC_LIBEXEC_DIR "" CACHE PATH "Directory containing the libexec script/binaries path" )
2930
3031if ("${MINKIDLC_BIN_DIR} " STREQUAL "${CMAKE_CURRENT_SOURCE_DIR} /idlc" )
3132 file (DOWNLOAD
Original file line number Diff line number Diff line change 3232#define LEGACY_DATA_PATH "/data/misc/qsee/"
3333#define LEGACY_PERSIST_PATH "/persist/data/"
3434#define DATA_PATH "/var/tmp/qtee_supplicant/vendor/tzstorage/"
35- #define PERSIST_PATH "/var/persist /qtee_supplicant/"
36- #define PERSIST_MOUNT_PATH "/var/persist "
35+ #define PERSIST_PATH "/var/lib/tee /qtee_supplicant/"
36+ #define PERSIST_MOUNT_PATH "/var/lib/tee "
3737
3838/* Secure File System - version 2 */
3939#define GP_FS_VERSION 2
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ static char *gp_whitelist_paths[] = {
2929
3030bool is_persist_partition_mounted (void )
3131{
32+ bool ret = false;
3233 FILE * f ;
3334 struct mntent * entry ;
3435
@@ -39,14 +40,16 @@ bool is_persist_partition_mounted(void)
3940
4041 while ((entry = getmntent (f ))) {
4142 if (strcmp (entry -> mnt_dir , PERSIST_MOUNT_PATH ) == 0 ) {
42- return true;
43+ ret = true;
44+ goto exit ;
4345 }
4446 }
45- endmntent ( f );
47+ MSGE ( "Persist partition not mounted!\n" );
4648
4749exit :
48- MSGE ("Persist partition not mounted!\n" );
49- return false;
50+ if (f )
51+ endmntent (f );
52+ return ret ;
5053}
5154
5255int check_dir_path (const char * path )
Original file line number Diff line number Diff line change @@ -46,11 +46,17 @@ target_link_libraries(${PROJECT_NAME}
4646)
4747
4848install (TARGETS ${PROJECT_NAME} DESTINATION "${CMAKE_INSTALL_BINDIR} " )
49+ if (DEFINED MINKIPC_LIBEXEC_DIR AND NOT "${MINKIPC_LIBEXEC_DIR} " STREQUAL "" )
50+ configure_file (sfs_config.in sfs_config @ONLY )
51+ install (PROGRAMS "${CMAKE_CURRENT_BINARY_DIR} /sfs_config" DESTINATION "${MINKIPC_LIBEXEC_DIR} " )
52+ endif ()
4953if (DEFINED SYSTEMD_UNIT_DIR AND NOT "${SYSTEMD_UNIT_DIR} " STREQUAL "" )
5054 configure_file (qteesupplicant.service.in qteesupplicant.service @ONLY )
5155 install (FILES "${CMAKE_CURRENT_BINARY_DIR} /qteesupplicant.service" DESTINATION "${SYSTEMD_UNIT_DIR} " )
56+ configure_file (sfsconfig.service.in sfsconfig.service @ONLY )
57+ install (FILES "${CMAKE_CURRENT_BINARY_DIR} /sfsconfig.service" DESTINATION "${SYSTEMD_UNIT_DIR} " )
5258endif ()
53- if (DEFINED SYSTEMD_UNIT_DIR AND NOT "${UDEV_DIR} " STREQUAL "" )
59+ if (DEFINED UDEV_DIR AND NOT "${UDEV_DIR} " STREQUAL "" )
5460 configure_file (qcomtee-udev.rules.in 99-qcomtee-udev.rules @ONLY )
5561 install (FILES "${CMAKE_CURRENT_BINARY_DIR} /99-qcomtee-udev.rules" DESTINATION ${UDEV_DIR} )
5662endif ()
Original file line number Diff line number Diff line change 33[Unit]
44Description=QTEE Supplicant Service
55BindsTo=dev-tee0.device
6- After=dev-tee0.device
6+ After=dev-tee0.device sfsconfig.service
77
88[Service]
99Type=exec
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ # ==============================================================================
3+ # FILE: sfs_config
4+ #
5+ # DESCRIPTION:
6+ # create files and give permissions to the files and directories needed by
7+ # secure file system
8+ #
9+ # Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
10+ # SPDX-License-Identifier: BSD-3-Clause-Clear
11+ # ==============================================================================
12+ set -e
13+
14+ if [ -e /var/lib/tee ]; then
15+ if [ ! -d /var/lib/tee/qtee_supplicant ]; then
16+ echo " Creating /var/lib/tee/qtee_supplicant"
17+ mkdir -p /var/lib/tee/qtee_supplicant
18+ fi
19+ chmod o+rwx /var/lib/tee/qtee_supplicant
20+ fi
21+
22+ if [ ! -d /var/tmp/qtee_supplicant/vendor/tzstorage ]; then
23+ echo " Creating /var/tmp/qtee_supplicant/vendor/tzstorage"
24+ mkdir -p /var/tmp/qtee_supplicant/vendor/tzstorage
25+ fi
26+ chmod o+rwx /var/tmp/qtee_supplicant/vendor/tzstorage
27+
28+ exit 0
Original file line number Diff line number Diff line change 1+ # Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
2+ # SPDX-License-Identifier: BSD-3-Clause-Clear
3+ [Unit]
4+ Description=SFS Configuration Service
5+ SourcePath=@MINKIPC_LIBEXEC_DIR@/sfs_config
6+
7+ [Service]
8+ Type=oneshot
9+ RemainAfterExit=yes
10+ ExecStart=@MINKIPC_LIBEXEC_DIR@/sfs_config
11+
12+ [Install]
13+ WantedBy=multi-user.target
14+
You can’t perform that action at this time.
0 commit comments