Patch by Bryce Groff with changes by myself:

* Added missing name parameter to the partitioning system module child creation
  and child creation validation hooks. Pass the name to them.
* Added BPartitionParameterEditor interface, which is/will be used for editing
  disk system specific parameters.
* Implemented partition parameter editors for BFS initialization and Intel
  partition map child creation.
* Fixed the incorrect supported child partition type iteration in the Intel
  partition map add-on. It does now return actual types.
* Handle the "active" flag parameter in the Intel partitioning system module.
* DriveSetup:
  - Replaced the "Create" submenu by a simple menu item. The type can now by
    chosen in the dialog.
  - Make use of initialization and child creation parameter editors. Some
    non-generic code has been moved to the respective editor implementations
    (BFS, intel partitioning system).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31658 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2009-07-20 20:29:16 +00:00
parent 4bb65f96fc
commit 7f96148cac
33 changed files with 751 additions and 292 deletions
@@ -43,11 +43,6 @@
using std::nothrow;
// partition_type
struct partition_type {
uint8 type;
const char *name;
};
static const char* const kUnrecognizedTypeString = "Unrecognized Type ";
static const size_t kUnrecognizedTypeStringLength = 18;
@@ -55,36 +50,39 @@ static const size_t kUnrecognizedTypeStringLength = 18;
static const struct partition_type kPartitionTypes[] = {
// these entries must be sorted by type (currently not)
// TODO: Standardize naming.
{ 0x00, "empty" },
{ 0x01, "FAT 12-bit" },
{ 0x02, "Xenix root" },
{ 0x03, "Xenix user" },
{ 0x04, "FAT 16-bit (dos 3.0)" },
{ 0x05, /*"Extended Partition"*/INTEL_EXTENDED_PARTITION_NAME },
{ 0x06, "FAT 16-bit (dos 3.31)" },
{ 0x07, "OS/2 IFS, Windows NT, Advanced Unix" },
{ 0x0b, "FAT 32-bit" },
{ 0x0c, "FAT 32-bit, LBA-mapped" },
{ 0x0d, "FAT 16-bit, LBA-mapped" },
{ 0x0f, /*"Extended Partition, LBA-mapped"*/INTEL_EXTENDED_PARTITION_NAME },
{ 0x42, "Windows 2000 marker (switches to a proprietary partition table)" },
{ 0x4d, "QNX 4" },
{ 0x4e, "QNX 4 2nd part" },
{ 0x4f, "QNX 4 3rd part" },
{ 0x78, "XOSL boot loader" },
{ 0x82, "Linux swapfile" },
{ 0x83, "Linux native" },
{ 0x85, /*"Linux extendend partition"*/INTEL_EXTENDED_PARTITION_NAME },
{ 0xa5, "FreeBSD" },
{ 0xa6, "OpenBSD" },
{ 0xa7, "NextSTEP" },
{ 0xa8, "MacOS X" },
{ 0xa9, "NetBSD" },
{ 0xab, "MacOS X boot" },
{ 0xaf, "MacOS X HFS" },
{ 0xbe, "Solaris 8 boot" },
{ 0xeb, /*"BeOS"*/ BFS_NAME },
{ 0, NULL }
{ 0x00, "empty", true },
{ 0x01, "FAT 12-bit", false},
{ 0x02, "Xenix root", false },
{ 0x03, "Xenix user", false },
{ 0x04, "FAT 16-bit (dos 3.0)", false },
{ 0x05, /*"Extended Partition"*/INTEL_EXTENDED_PARTITION_NAME, false },
{ 0x06, "FAT 16-bit (dos 3.31)", false },
{ 0x07, "OS/2 IFS, Windows NT, Advanced Unix", true },
{ 0x0b, "FAT 32-bit", false },
{ 0x0c, "FAT 32-bit, LBA-mapped", true },
{ 0x0d, "FAT 16-bit, LBA-mapped", false },
{ 0x0f, /*"Extended Partition, LBA-mapped"*/INTEL_EXTENDED_PARTITION_NAME,
true },
{ 0x42, "Windows 2000 marker (switches to a proprietary partition table)",
false },
{ 0x4d, "QNX 4", true },
{ 0x4e, "QNX 4 2nd part", false },
{ 0x4f, "QNX 4 3rd part", false },
{ 0x78, "XOSL boot loader", false },
{ 0x82, "Linux swapfile", true },
{ 0x83, "Linux native", true },
{ 0x85, /*"Linux extendend partition"*/INTEL_EXTENDED_PARTITION_NAME,
false },
{ 0xa5, "FreeBSD", true },
{ 0xa6, "OpenBSD", true },
{ 0xa7, "NextSTEP", false },
{ 0xa8, "MacOS X", true },
{ 0xa9, "NetBSD", true },
{ 0xab, "MacOS X boot", true },
{ 0xaf, "MacOS X HFS", true },
{ 0xbe, "Solaris 8 boot", false },
{ 0xeb, /*"BeOS"*/ BFS_NAME, true },
{ 0, NULL, false }
};
static const struct partition_type kPartitionContentTypes[] = {
@@ -835,3 +833,12 @@ PartitionMap::Check(off_t sessionSize) const
return result;
}
const partition_type*
PartitionMap::GetNextSupportedPartitionType(uint32 index)
{
if (index > (sizeof(kPartitionTypes) / sizeof(partition_type) - 2))
return NULL;
return kPartitionTypes + index;
}