tee-supplicant: add priority prefix for udev rule
The manpage of udev states that "All rule files are read in lexical
order." This coincides with the established convention of assigning a
two-digit priority prefix in front of the respective rule file name.
In case of "optee-udev.rules", we are currently missing that prefix.
When looking for context, it seems suitable to choose a priority in the
realm of the already existing "60-tpm-udev.rules", since that serves a
similar purpose like the rule for optee-client.
This commit hence changes the installed rule file name to
"60-optee-udev.rules", with "60-" being a configurable default value.
Signed-off-by: Holger Assmann <h.assmann@pengutronix.de>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
diff --git a/tee-supplicant/CMakeLists.txt b/tee-supplicant/CMakeLists.txt
index b47d4e3..5a8b387 100644
--- a/tee-supplicant/CMakeLists.txt
+++ b/tee-supplicant/CMakeLists.txt
@@ -18,6 +18,7 @@
# FIXME: Why do we have if defined(CFG_GP_SOCKETS) && CFG_GP_SOCKETS == 1 in the c-file?
set(CFG_GP_SOCKETS "1" CACHE STRING "Enable GlobalPlatform Socket API support")
set(CFG_TEE_PLUGIN_LOAD_PATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}/plugins/" CACHE STRING "tee-supplicant's plugins path")
+set(CFG_UDEV_RULESPREFIX "60-" CACHE STRING "Priority prefix for udev rule")
set(CFG_TEE_GROUP "tee" CACHE STRING "Group which has access to /dev/tee* devices")
set(CFG_TEEPRIV_GROUP "teepriv" CACHE STRING "Group which has access to /dev/teepriv* devices")
@@ -150,6 +151,6 @@
install(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}/tee-supplicant@.service DESTINATION ${SYSTEMD_UNIT_DIR})
endif()
if (CFG_ENABLE_UDEV)
- configure_file(optee-udev.rules.in optee-udev.rules @ONLY)
- install(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}/optee-udev.rules DESTINATION ${UDEV_UDEV_DIR})
-endif()
\ No newline at end of file
+ configure_file(optee-udev.rules.in ${CFG_UDEV_RULESPREFIX}optee-udev.rules @ONLY)
+ install(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}/${CFG_UDEV_RULESPREFIX}optee-udev.rules DESTINATION ${UDEV_UDEV_DIR})
+endif()