trigger: rework timeout handling and command queueing
[project/procd.git] / CMakeLists.txt
index d749c25..b66fad1 100644 (file)
@@ -18,9 +18,12 @@ INSTALL(TARGETS setlbf
 )
 
 
-SET(SOURCES procd.c signal.c watchdog.c state.c        inittab.c rcS.c ubus.c system.c
+SET(SOURCES procd.c signal.c state.c inittab.c rcS.c ubus.c system.c
        service/service.c service/instance.c service/validate.c service/trigger.c service/watch.c
-       plug/coldplug.c plug/hotplug.c utils/utils.c)
+       utils/utils.c)
+IF(NOT DISABLE_INIT)
+  SET(SOURCES ${SOURCES} watchdog.c plug/coldplug.c plug/hotplug.c)
+ENDIF()
 
 SET(LIBS ubox ubus json-c blobmsg_json json_script)
 
@@ -28,6 +31,10 @@ IF(DEBUG)
   ADD_DEFINITIONS(-DDEBUG -g3)
 ENDIF()
 
+IF(EARLY_PATH)
+  ADD_DEFINITIONS(-DEARLY_PATH="${EARLY_PATH}")
+ENDIF()
+
 IF(ZRAM_TMPFS)
   ADD_DEFINITIONS(-DZRAM_TMPFS)
   SET(SOURCES_ZRAM initd/zram.c)
@@ -43,7 +50,12 @@ INSTALL(TARGETS procd
        RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
 )
 
+FIND_PATH(ubox_include_dir libubox/uloop.h)
+INCLUDE_DIRECTORIES(${ubox_include_dir})
 
+IF(DISABLE_INIT)
+ADD_DEFINITIONS(-DDISABLE_INIT)
+ELSE()
 ADD_EXECUTABLE(init initd/init.c initd/early.c initd/preinit.c initd/mkdev.c watchdog.c
        utils/utils.c ${SOURCES_ZRAM})
 TARGET_LINK_LIBRARIES(init ${LIBS})
@@ -51,11 +63,11 @@ INSTALL(TARGETS init
        RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
 )
 
-
 ADD_EXECUTABLE(udevtrigger plug/udevtrigger.c)
 INSTALL(TARGETS udevtrigger
        RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
 )
+ENDIF()
 
 
 ADD_EXECUTABLE(askfirst utils/askfirst.c)
@@ -87,7 +99,7 @@ ADD_DEPENDENCIES(preload-seccomp syscall-names-h)
 endif()
 
 IF(JAIL_SUPPORT)
-ADD_EXECUTABLE(ujail jail/jail.c jail/elf.c jail/capabilities.c)
+ADD_EXECUTABLE(ujail jail/jail.c jail/elf.c jail/fs.c jail/capabilities.c)
 TARGET_LINK_LIBRARIES(ujail ubox blobmsg_json)
 INSTALL(TARGETS ujail
        RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}