* 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:
David Quintana 2015-09-08 03:37:47 +00:00
parent d5d4c72825
commit 2f3a69e66f
6 changed files with 25 additions and 10 deletions

View file

@ -112,9 +112,9 @@ if(NOT CMAKE_CROSSCOMPILING)
if(NOT NEW_STYLE_BUILD) if(NOT NEW_STYLE_BUILD)
if(NOT MSVC) 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() 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()
endif() endif()

View file

@ -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 ##bootcd
#clear it out #clear it out
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/bootcd.lst "") file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/bootcd.lst "")

View file

@ -6,7 +6,7 @@ endif()
string(TOUPPER ${CMAKE_BUILD_TYPE} _build_type) string(TOUPPER ${CMAKE_BUILD_TYPE} _build_type)
# List of host tools # 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) if(NOT MSVC)
list(APPEND host_tools_list rsym) list(APPEND host_tools_list rsym)
endif() endif()

View file

@ -39,4 +39,4 @@ if(NOT MSVC)
add_subdirectory(rsym) add_subdirectory(rsym)
endif() endif()
#add_subdirectory(fatten) add_subdirectory(fatten)

View file

@ -1,5 +1,5 @@
add_executable(fatten add_host_tool(fatten
fatten.c fatten.c
fatfs/diskio.c fatfs/diskio.c
fatfs/ff.c fatfs/ff.c

View file

@ -178,11 +178,14 @@ int main(int oargc, char* oargv[])
FILE* fe; FILE* fe;
FIL fv = { 0 }; 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; return 1;
} }
if (f_open(&fv, argv[1], FA_WRITE | FA_CREATE_ALWAYS)) if (f_open(&fv, argv[1], FA_WRITE | FA_CREATE_ALWAYS))
{ {
printf("Error: unable to open file '%s' for writing.", argv[1]); 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]); printf("Error: unable to open file '%s' for reading.", argv[0]);
return 1; 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]); printf("Error: unable to open external file '%s' for writing.", argv[1]);
return 1; return 1;
@ -286,16 +292,18 @@ int main(int oargc, char* oargv[])
NEED_PARAMS(1, 1); NEED_PARAMS(1, 1);
NEED_MOUNT(); NEED_MOUNT();
// Arg 1: folder path // Arg 1: folder path
f_mkdir(argv[1]); f_mkdir(argv[0]);
} }
else if (strcmp(parg, "delete") == 0) else if (strcmp(parg, "delete") == 0)
{ {
NEED_PARAMS(1, 1); NEED_PARAMS(1, 1);
NEED_MOUNT(); NEED_MOUNT();
// Arg 1: file/folder path (cannot delete non-empty folders) // Arg 1: file/folder path (cannot delete non-empty folders)
f_unlink(argv[1]); f_unlink(argv[0]);
} }
else if (strcmp(parg, "list") == 0) else if (strcmp(parg, "list") == 0)
{ {