[EFI]
authorAlex Ionescu <aionescu@gmail.com>
Wed, 9 Sep 2015 18:43:09 +0000 (18:43 +0000)
committerAlex Ionescu <aionescu@gmail.com>
Wed, 9 Sep 2015 18:43:09 +0000 (18:43 +0000)
- Add BCD creation.
- Add BCD to bootcd, and also to EFISYS.BIN. Verified the BCD is now present on the EFI partition.

svn path=/trunk/; revision=69156

reactos/boot/CMakeLists.txt
reactos/boot/bootdata/CMakeLists.txt
reactos/boot/bootdata/hivebcd.inf [new file with mode: 0644]
reactos/cmake/CMakeMacros.cmake
reactos/tools/mkhive/mkhive.c

index 6f5b583..c30ddd9 100644 (file)
@@ -16,7 +16,7 @@ else()
 endif()
 
 add_custom_target(efisys
-    COMMAND native-fatten ${CMAKE_CURRENT_BINARY_DIR}/efisys.bin -format 2880 EFIBOOT -boot ${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/fat.bin -mkdir EFI -mkdir EFI/BOOT -add $<TARGET_FILE:bootmgfw> EFI/BOOT/boot${EFI_PLATFORM_ID}.efi
+    COMMAND native-fatten ${CMAKE_CURRENT_BINARY_DIR}/efisys.bin -format 2880 EFIBOOT -boot ${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/fat.bin -mkdir EFI -mkdir EFI/BOOT -add $<TARGET_FILE:bootmgfw> EFI/BOOT/boot${EFI_PLATFORM_ID}.efi -add ${CMAKE_BINARY_DIR}/boot/bootdata/BCD EFI/BOOT/BCD
     DEPENDS native-fatten bootmgfw fat
     VERBATIM)
 
index 1966b2e..893abea 100644 (file)
@@ -10,7 +10,8 @@ add_registry_inf(
     hivecls.inf
     hivedef.inf
     hivesft.inf
-    hivesys.inf)
+    hivesys.inf
+    hivebcd.inf)
 
 
 #regtest
diff --git a/reactos/boot/bootdata/hivebcd.inf b/reactos/boot/bootdata/hivebcd.inf
new file mode 100644 (file)
index 0000000..42178b2
--- /dev/null
@@ -0,0 +1,11 @@
+[Version]
+Signature = "$ReactOS$"
+
+[AddReg]
+
+HKLM,"BCD00000000\Description\Control","System",0x00010003,1
+HKLM,"BCD00000000\Description\Control","TreatAtSystem",0x00010003,1
+HKLM,"BCD00000000\Description\Control","KeyName",2,"BCD00000000"
+HKLM,"BCD00000000\Description\Objects",,0x00000012
+
+; EOF
index 68ab5a6..d1edafa 100644 (file)
@@ -793,6 +793,22 @@ function(create_registry_hives)
         DESTINATION reactos/system32/config
         FOR livecd)
 
+    # BCD Hive
+    add_custom_command(
+        OUTPUT ${CMAKE_BINARY_DIR}/boot/bootdata/BCD
+        COMMAND native-mkhive ${CMAKE_BINARY_DIR}/boot/bootdata/ ${CMAKE_BINARY_DIR}/boot/bootdata/hivebcd_utf16.inf
+        DEPENDS native-mkhive ${CMAKE_SOURCE_DIR}/boot/bootdata/hivebcd.inf)
+
+    add_custom_target(bcd_hive
+        DEPENDS ${CMAKE_BINARY_DIR}/boot/bootdata/BCD)
+
+    add_cd_file(
+        FILE ${CMAKE_BINARY_DIR}/boot/bootdata/BCD
+        TARGET bcd_hive
+        DESTINATION efi/boot
+        NO_CAB
+        FOR bootcd regtest livecd)
+
 endfunction()
 
 if(KDBG)
index 3579df7..c5ccfe3 100644 (file)
@@ -143,6 +143,14 @@ int main (int argc, char *argv[])
         return 1;
     }
 
+    convert_path (FileName, argv[1]);
+    strcat (FileName, DIR_SEPARATOR_STRING);
+    strcat (FileName, "bcd");
+    if (!ExportBinaryHive (FileName, &SystemHive))
+    {
+        return 1;
+    }
+
     RegShutdownRegistry ();
 
     printf ("  Done.\n");