kmodloader: fix out-of-bound access when parsing .modinfo
[project/ubox.git] / CMakeLists.txt
index 54434d1..6cf0c93 100644 (file)
@@ -11,51 +11,52 @@ IF(APPLE)
 ENDIF()
 
 find_library(json NAMES json-c json)
-SET(LIBS ubox uci ubus ${json} blobmsg_json)
 
 IF(DEBUG)
   ADD_DEFINITIONS(-DDEBUG -g3)
 ENDIF()
 
-ADD_EXECUTABLE(mount_root mount_root.c)
-TARGET_LINK_LIBRARIES(mount_root ${LIBS})
-
-INSTALL(TARGETS mount_root
-       RUNTIME DESTINATION sbin
+ADD_EXECUTABLE(getrandom getrandom.c)
+INSTALL(TARGETS getrandom
+       RUNTIME DESTINATION bin
 )
 
-ADD_EXECUTABLE(block block.c
-               libblkid-tiny/libblkid-tiny.c
-               libblkid-tiny/md5.c
-               libblkid-tiny/mkdev.c
-               libblkid-tiny/ext.c
-               libblkid-tiny/jffs2.c
-               libblkid-tiny/vfat.c
-               libblkid-tiny/swap.c
-               libblkid-tiny/squashfs.c)
-TARGET_LINK_LIBRARIES(block ${LIBS} blobmsg_json)
-
-INSTALL(TARGETS block
+ADD_EXECUTABLE(kmodloader kmodloader.c)
+TARGET_LINK_LIBRARIES(kmodloader ubox)
+
+INSTALL(TARGETS kmodloader
        RUNTIME DESTINATION sbin
 )
 
-ADD_EXECUTABLE(kmodloader kmodloader.c)
-TARGET_LINK_LIBRARIES(kmodloader ${LIBS})
+ADD_EXECUTABLE(lsbloader lsbloader.c)
+TARGET_LINK_LIBRARIES(lsbloader ubox ubus)
 
-INSTALL(TARGETS kmodloader
+INSTALL(TARGETS lsbloader
        RUNTIME DESTINATION sbin
 )
 
-ADD_EXECUTABLE(board board.c)
-TARGET_LINK_LIBRARIES(board ${LIBS})
+ADD_LIBRARY(validate SHARED validate/validate.c)
+INSTALL(TARGETS validate
+       LIBRARY DESTINATION lib
+)
+
+FIND_PATH(uci_include_dir uci.h)
+INCLUDE_DIRECTORIES(${uci_include_dir})
 
-INSTALL(TARGETS board
+ADD_EXECUTABLE(validate_data validate/cli.c)
+TARGET_LINK_LIBRARIES(validate_data ubox uci validate)
+INSTALL(TARGETS validate_data
        RUNTIME DESTINATION sbin
 )
 
-ADD_EXECUTABLE(lsbloader lsbloader.c)
-TARGET_LINK_LIBRARIES(lsbloader ${LIBS})
+ADD_EXECUTABLE(logd log/logd.c log/syslog.c)
+TARGET_LINK_LIBRARIES(logd ubox ubus)
+INSTALL(TARGETS logd
+       RUNTIME DESTINATION sbin
+)
 
-INSTALL(TARGETS lsbloader
+ADD_EXECUTABLE(logread log/logread.c)
+TARGET_LINK_LIBRARIES(logread ubox ubus ${json} blobmsg_json)
+INSTALL(TARGETS logread
        RUNTIME DESTINATION sbin
 )