mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-27 11:53:32 +00:00
[FATTEN]
* Fix folder creation and external file access. * Add fatten as a host-tool. * Add a target for creating efisys.bin from the bootmgfw TODO: Make the name of the boot*.efi depend on the platform (ia32/x64/arm). TODO: Add efisys as a dependency to the bootcd, when we need to make use of the efisys.bin file for the iso (waiting for hbelusca's cdmake work). svn path=/trunk/; revision=69109
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
@@ -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 $<TARGET_FILE:bootmgfw> efi/boot/bootia32.efi
|
||||
DEPENDS native-fatten bootmgfw
|
||||
VERBATIM)
|
||||
|
||||
##bootcd
|
||||
#clear it out
|
||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/bootcd.lst "")
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -39,4 +39,4 @@ if(NOT MSVC)
|
||||
add_subdirectory(rsym)
|
||||
endif()
|
||||
|
||||
#add_subdirectory(fatten)
|
||||
add_subdirectory(fatten)
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
add_executable(fatten
|
||||
add_host_tool(fatten
|
||||
fatten.c
|
||||
fatfs/diskio.c
|
||||
fatfs/ff.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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user