[haiku-commits] haiku: hrev49240 - src/add-ons/kernel/partitioning_systems/intel

  • From: jessica.l.hamilton@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 4 Jun 2015 08:36:33 +0200 (CEST)

hrev49240 adds 1 changeset to branch 'master'
old head: e460be6cbdd7f54cb7c79f30d199d70fd7e468c3
new head: d8ba3b09900a13dd91df9536eca8caf68200591a
overview:
http://cgit.haiku-os.org/haiku/log/?qt=range&q=d8ba3b09900a+%5Ee460be6cbdd7

----------------------------------------------------------------------------

d8ba3b09900a: intel partitioning system: fix build for non-x86 systems

* There is no need for the Intel partitioning system to write MBR
bootcode on non-x86 systems
* The MBR_HEADER define is used to prevent Jam from making MBR.h
a dependency; the dependency is then specified explicitly when
building for x86/x86_64 platforms

[ Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision: hrev49240
Commit: d8ba3b09900a13dd91df9536eca8caf68200591a
URL: http://cgit.haiku-os.org/haiku/commit/?id=d8ba3b09900a
Author: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
Date: Thu Jun 4 06:30:55 2015 UTC

----------------------------------------------------------------------------

2 files changed, 10 insertions(+), 1 deletion(-)
src/add-ons/kernel/partitioning_systems/intel/Jamfile | 4 ++++
.../kernel/partitioning_systems/intel/PartitionMapWriter.cpp | 7 ++++++-

----------------------------------------------------------------------------

diff --git a/src/add-ons/kernel/partitioning_systems/intel/Jamfile
b/src/add-ons/kernel/partitioning_systems/intel/Jamfile
index b4fe1d5..6478221 100644
--- a/src/add-ons/kernel/partitioning_systems/intel/Jamfile
+++ b/src/add-ons/kernel/partitioning_systems/intel/Jamfile
@@ -10,6 +10,10 @@ BuildMBR [ FGristFiles mbr.bin ] : mbr.S ;
DataFileToSourceFile [ FGristFiles MBR.h ] : [ FGristFiles mbr.bin ]
: kMBR : kMBRSize ;

+if $(HAIKU_ARCH) = "x86" || $(HAIKU_ARCH) = "x86"64 {
+ Depends [ FGristFiles PartitionMapWriter.cpp ] : [ FGristFiles MBR.h ] ;
+}
+
KernelAddon intel :
intel.cpp
PartitionLocker.cpp
diff --git
a/src/add-ons/kernel/partitioning_systems/intel/PartitionMapWriter.cpp
b/src/add-ons/kernel/partitioning_systems/intel/PartitionMapWriter.cpp
index 0ca194d..c600e5c 100644
--- a/src/add-ons/kernel/partitioning_systems/intel/PartitionMapWriter.cpp
+++ b/src/add-ons/kernel/partitioning_systems/intel/PartitionMapWriter.cpp
@@ -37,7 +37,10 @@ using std::nothrow;
#endif


-#include "MBR.h"
+#if defined(__INTEL__) || defined(__x86_64__)
+#define MBR_HEADER "MBR.h"
+#include MBR_HEADER
+#endif


bool
@@ -103,12 +106,14 @@ PartitionMapWriter::WriteMBR(const PartitionMap* map,
bool writeBootCode)
status_t error = _ReadBlock(0, partitionTable);
if (error != B_OK)
return error;
+#ifdef MBR_HEADER
if (writeBootCode) {
// the boot code must be small enough to fit in the code area
STATIC_ASSERT(kMBRSize <= sizeof(partitionTable.code_area));
partitionTable.clear_code_area();
partitionTable.fill_code_area(kMBR, kMBRSize);
}
+#endif

partitionTable.signature = kPartitionTableSectorSignature;



Other related posts: