Author: dquintana
Date: Tue Sep  8 03:37:47 2015
New Revision: 69109

URL: http://svn.reactos.org/svn/reactos?rev=69109&view=rev
Log:
[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).

Modified:
    trunk/reactos/CMakeLists.txt
    trunk/reactos/boot/CMakeLists.txt
    trunk/reactos/cmake/host-tools.cmake
    trunk/reactos/tools/CMakeLists.txt
    trunk/reactos/tools/fatten/CMakeLists.txt
    trunk/reactos/tools/fatten/fatten.c

Modified: trunk/reactos/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/CMakeLists.txt?rev=69109&r1=69108&r2=69109&view=diff
==============================================================================
--- trunk/reactos/CMakeLists.txt        [iso-8859-1] (original)
+++ trunk/reactos/CMakeLists.txt        [iso-8859-1] Tue Sep  8 03:37:47 2015
@@ -112,9 +112,9 @@
 
     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()
 

Modified: trunk/reactos/boot/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/CMakeLists.txt?rev=69109&r1=69108&r2=69109&view=diff
==============================================================================
--- trunk/reactos/boot/CMakeLists.txt   [iso-8859-1] (original)
+++ trunk/reactos/boot/CMakeLists.txt   [iso-8859-1] Tue Sep  8 03:37:47 2015
@@ -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 "")

Modified: trunk/reactos/cmake/host-tools.cmake
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/host-tools.cmake?rev=69109&r1=69108&r2=69109&view=diff
==============================================================================
--- trunk/reactos/cmake/host-tools.cmake        [iso-8859-1] (original)
+++ trunk/reactos/cmake/host-tools.cmake        [iso-8859-1] Tue Sep  8 
03:37:47 2015
@@ -6,7 +6,7 @@
 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()

Modified: trunk/reactos/tools/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/CMakeLists.txt?rev=69109&r1=69108&r2=69109&view=diff
==============================================================================
--- trunk/reactos/tools/CMakeLists.txt  [iso-8859-1] (original)
+++ trunk/reactos/tools/CMakeLists.txt  [iso-8859-1] Tue Sep  8 03:37:47 2015
@@ -39,4 +39,4 @@
     add_subdirectory(rsym)
 endif()
 
-#add_subdirectory(fatten)
+add_subdirectory(fatten)

Modified: trunk/reactos/tools/fatten/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/fatten/CMakeLists.txt?rev=69109&r1=69108&r2=69109&view=diff
==============================================================================
--- trunk/reactos/tools/fatten/CMakeLists.txt   [iso-8859-1] (original)
+++ trunk/reactos/tools/fatten/CMakeLists.txt   [iso-8859-1] Tue Sep  8 
03:37:47 2015
@@ -1,5 +1,5 @@
 
-add_executable(fatten
+add_host_tool(fatten
     fatten.c
     fatfs/diskio.c
     fatfs/ff.c

Modified: trunk/reactos/tools/fatten/fatten.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/fatten/fatten.c?rev=69109&r1=69108&r2=69109&view=diff
==============================================================================
--- trunk/reactos/tools/fatten/fatten.c [iso-8859-1] (original)
+++ trunk/reactos/tools/fatten/fatten.c [iso-8859-1] Tue Sep  8 03:37:47 2015
@@ -178,11 +178,14 @@
             FILE* fe;
             FIL   fv = { 0 };
 
-            if (fe = fopen(argv[0], "rb"))
-            {
-                printf("Error: unable to open external file '%s' for 
reading.", argv[0]);
-                return 1;
-            }
+            fe = fopen(argv[0], "rb");
+
+            if (!fe)
+            {
+                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 @@
                 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 @@
             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)
         {


Reply via email to