Skip to content
Snippets Groups Projects
Commit 78619514 authored by David Sidrane's avatar David Sidrane
Browse files

ROMFS/CMakeLists build gencromfs

parent e7bf0e03
No related branches found
No related tags found
No related merge requests found
...@@ -176,30 +176,23 @@ add_custom_command(OUTPUT romfs_pruned.stamp ...@@ -176,30 +176,23 @@ add_custom_command(OUTPUT romfs_pruned.stamp
COMMENT "ROMFS: pruning" COMMENT "ROMFS: pruning"
) )
# create romfs.img if("${CONFIG_FS_CROMFS}" STREQUAL "y")
find_program(GENROMFS genromfs) add_custom_command(
if(NOT GENROMFS) OUTPUT
message(FATAL_ERROR "genromfs not found") ${CMAKE_BINARY_DIR}/gencromfs
endif() COMMAND
add_custom_command(OUTPUT romfs.img romfs.txt make --no-print-directory --silent -f Makefile.host gencromfs
COMMAND ${CMAKE_COMMAND} -E remove -f romfs.img romfs.txt COMMAND ${CMAKE_COMMAND} -E copy gencromfs ${CMAKE_BINARY_DIR}/gencromfs
COMMAND ${GENROMFS} -f romfs.img -d ${romfs_gen_root_dir} -V "NSHInitVol" -v > romfs.txt 2>&1 DEPENDS ${PX4_SOURCE_DIR}/platforms/nuttx/NuttX/nuttx/tools/gencromfs.c
DEPENDS WORKING_DIRECTORY ${NUTTX_DIR}/tools
romfs_pruned.stamp )
COMMENT "ROMFS: generating image"
)
if(CONFIG_FS_CROMFS)
#TODO:build gencromfs tool from nuttx and path to it.
find_program(GENCROMFS gencromfs)
if(NOT GENCROMFS)
message(FATAL_ERROR "gencromfs not found")
endif()
# create nsh_romfsimg.c # create nsh_romfsimg.c
add_custom_command(OUTPUT nsh_romfsimg.c add_custom_command(OUTPUT nsh_romfsimg.c
COMMAND ${CMAKE_COMMAND} -E remove -f nsh_romfsimg.c COMMAND ${CMAKE_COMMAND} -E remove -f nsh_romfsimg.c
COMMAND ${GENCROMFS} ${romfs_gen_root_dir} nsh_romfsimg.c COMMAND ${CMAKE_BINARY_DIR}/gencromfs ${romfs_gen_root_dir} nsh_romfsimg.c
DEPENDS DEPENDS
${CMAKE_BINARY_DIR}/gencromfs
${romfs_gen_root_dir}/init.d/rcS ${romfs_gen_root_dir}/init.d/rcS
${romfs_gen_root_dir}/init.d/rc.autostart ${romfs_gen_root_dir}/init.d/rc.autostart
romfs_extras.stamp romfs_extras.stamp
...@@ -208,18 +201,16 @@ if(CONFIG_FS_CROMFS) ...@@ -208,18 +201,16 @@ if(CONFIG_FS_CROMFS)
) )
else() else()
# create romfs.img
find_program(GENROMFS genromfs) find_program(GENROMFS genromfs)
if(NOT GENROMFS) if(NOT GENROMFS)
message(FATAL_ERROR "genromfs not found") message(FATAL_ERROR "genromfs not found")
endif() endif()
# create romfs.img
add_custom_command(OUTPUT romfs.img romfs.txt add_custom_command(OUTPUT romfs.img romfs.txt
COMMAND ${CMAKE_COMMAND} -E remove -f romfs.img romfs.txt COMMAND ${CMAKE_COMMAND} -E remove -f romfs.img romfs.txt
COMMAND ${GENROMFS} -f romfs.img -d ${romfs_gen_root_dir} -V "NSHInitVol" -v > romfs.txt 2>&1 COMMAND ${GENROMFS} -f romfs.img -d ${romfs_gen_root_dir} -V "NSHInitVol" -v > romfs.txt 2>&1
DEPENDS DEPENDS
${romfs_gen_root_dir}/init.d/rcS romfs_pruned.stamp
${romfs_gen_root_dir}/init.d/rc.autostart
romfs_extras.stamp
COMMENT "ROMFS: generating image" COMMENT "ROMFS: generating image"
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment