diff --git a/reactos/CMakeLists.txt b/reactos/CMakeLists.txt index dd734f8c19e..dea62321372 100644 --- a/reactos/CMakeLists.txt +++ b/reactos/CMakeLists.txt @@ -112,9 +112,9 @@ if(NOT CMAKE_CROSSCOMPILING) if(NOT NEW_STYLE_BUILD) if(NOT MSVC) - export(TARGETS bin2c widl gendib cabman cdmake hpp mkhive obj2bin spec2def geninc rsym mkshelllink utf16le FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake NAMESPACE native- ) + export(TARGETS bin2c widl gendib cabman cdmake fatten hpp mkhive obj2bin spec2def geninc rsym mkshelllink utf16le FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake NAMESPACE native- ) else() - export(TARGETS bin2c widl gendib cabman cdmake hpp mkhive obj2bin spec2def geninc mkshelllink utf16le FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake NAMESPACE native- ) + export(TARGETS bin2c widl gendib cabman cdmake fatten hpp mkhive obj2bin spec2def geninc mkshelllink utf16le FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake NAMESPACE native- ) endif() endif() diff --git a/reactos/boot/CMakeLists.txt b/reactos/boot/CMakeLists.txt index a1bb5c50e53..2ebc6eaf817 100644 --- a/reactos/boot/CMakeLists.txt +++ b/reactos/boot/CMakeLists.txt @@ -1,3 +1,10 @@ +## efisys.bin + +add_custom_target(efisys + COMMAND native-fatten ${CMAKE_CURRENT_BINARY_DIR}/efisys.bin -format 2880 -mkdir efi -mkdir efi/boot -add $ efi/boot/bootia32.efi + DEPENDS native-fatten bootmgfw + VERBATIM) + ##bootcd #clear it out file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/bootcd.lst "") diff --git a/reactos/cmake/host-tools.cmake b/reactos/cmake/host-tools.cmake index 2433f0ffd97..c4b0dc7f784 100644 --- a/reactos/cmake/host-tools.cmake +++ b/reactos/cmake/host-tools.cmake @@ -6,7 +6,7 @@ endif() string(TOUPPER ${CMAKE_BUILD_TYPE} _build_type) # List of host tools -list(APPEND host_tools_list bin2c hpp widl gendib cabman cdmake mkhive obj2bin spec2def geninc mkshelllink utf16le) +list(APPEND host_tools_list bin2c hpp widl gendib cabman cdmake fatten mkhive obj2bin spec2def geninc mkshelllink utf16le) if(NOT MSVC) list(APPEND host_tools_list rsym) endif() diff --git a/reactos/tools/CMakeLists.txt b/reactos/tools/CMakeLists.txt index 63e69f3d617..f315080dcff 100644 --- a/reactos/tools/CMakeLists.txt +++ b/reactos/tools/CMakeLists.txt @@ -39,4 +39,4 @@ if(NOT MSVC) add_subdirectory(rsym) endif() -#add_subdirectory(fatten) \ No newline at end of file +add_subdirectory(fatten) \ No newline at end of file diff --git a/reactos/tools/fatten/CMakeLists.txt b/reactos/tools/fatten/CMakeLists.txt index 3bda25e73d1..e3d507f8b26 100644 --- a/reactos/tools/fatten/CMakeLists.txt +++ b/reactos/tools/fatten/CMakeLists.txt @@ -1,5 +1,5 @@ -add_executable(fatten +add_host_tool(fatten fatten.c fatfs/diskio.c fatfs/ff.c diff --git a/reactos/tools/fatten/fatten.c b/reactos/tools/fatten/fatten.c index 5b133ccf68e..9063a63c61c 100644 --- a/reactos/tools/fatten/fatten.c +++ b/reactos/tools/fatten/fatten.c @@ -178,11 +178,14 @@ int main(int oargc, char* oargv[]) FILE* fe; FIL fv = { 0 }; - if (fe = fopen(argv[0], "rb")) + fe = fopen(argv[0], "rb"); + + if (!fe) { - printf("Error: unable to open external file '%s' for reading.", argv[0]); + printf("Error: unable to open external file '%s' for reading. errno=%d", argv[0], errno); return 1; } + if (f_open(&fv, argv[1], FA_WRITE | FA_CREATE_ALWAYS)) { printf("Error: unable to open file '%s' for writing.", argv[1]); @@ -218,7 +221,10 @@ int main(int oargc, char* oargv[]) printf("Error: unable to open file '%s' for reading.", argv[0]); return 1; } - if (fv = fopen(argv[1], "wb")) + + fv = fopen(argv[1], "wb"); + + if (!fv) { printf("Error: unable to open external file '%s' for writing.", argv[1]); return 1; @@ -286,16 +292,18 @@ int main(int oargc, char* oargv[]) NEED_PARAMS(1, 1); NEED_MOUNT(); + // Arg 1: folder path - f_mkdir(argv[1]); + f_mkdir(argv[0]); } else if (strcmp(parg, "delete") == 0) { NEED_PARAMS(1, 1); NEED_MOUNT(); + // Arg 1: file/folder path (cannot delete non-empty folders) - f_unlink(argv[1]); + f_unlink(argv[0]); } else if (strcmp(parg, "list") == 0) {