* Removed no longer used TestBootDrive.* files.

* Added a comment to LegacyBootMenu.cpp on how to conveniently test the boot
  manager, and its menu.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40151 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2011-01-08 13:55:11 +00:00
parent 34bebc2df0
commit d3dd01a500
4 changed files with 14 additions and 149 deletions

View File

@ -29,13 +29,6 @@
#include "WizardView.h"
#define USE_TEST_BOOT_DRIVE 0
#if USE_TEST_BOOT_DRIVE
# include "TestBootDrive.h"
#endif
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "BootManagerController"
@ -45,10 +38,6 @@ BootManagerController::BootManagerController()
fBootDrive(NULL),
fBootMenu(NULL)
{
#if USE_TEST_BOOT_DRIVE
fBootMenu = new TestBootDrive();
#endif
// set defaults
fSettings.AddBool("install", true);
fSettings.AddInt32("defaultPartition", 0);

View File

@ -31,6 +31,20 @@
#include "BootLoader.h"
/*
Note: for testing, the best way is to create a small file image, and
register it, for example via the "diskimage" tool (mountvolume might also
work).
You can then create partitions on it via DriveSetup, or simply copy an
existing drive to it, for example via:
$ dd if=/dev/disk/ata/0/master/raw of=test.image bs=1M count=10
It will automatically appear in BootManager once it is registered, and,
depending on its parition layout, you can then install the boot menu on
it, and directly test it via qemu.
*/
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "LegacyBootMenu"

View File

@ -1,106 +0,0 @@
/*
* Copyright 2008-2011, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Michael Pfeiffer <laplace@users.sourceforge.net>
*/
#include "TestBootDrive.h"
#include <stdio.h>
#include <String.h>
TestBootDrive::TestBootDrive()
{
}
TestBootDrive::~TestBootDrive()
{
}
bool
TestBootDrive::IsBootMenuInstalled(BMessage* settings)
{
return false;
}
status_t
TestBootDrive::ReadPartitions(BMessage *settings)
{
settings->AddString("disk", "bootcylinder");
BMessage partition;
partition.AddBool("show", true);
partition.AddString("name", "TEST Haiku");
partition.AddString("type", "bfs");
partition.AddString("path", "/dev/disk/ide/ata/0/master/0/0_0");
partition.AddInt64("size", 3 * (int64)1024 * 1024 * 1024);
settings->AddMessage("partition", &partition);
partition.MakeEmpty();
partition.AddBool("show", true);
partition.AddString("name", "TEST no name");
partition.AddString("type", "dos");
partition.AddString("path", "/dev/disk/ide/ata/0/slave/0/0_0");
partition.AddInt64("size", 10 * (int64)1024 * 1024 * 1024);
settings->AddMessage("partition", &partition);
partition.MakeEmpty();
partition.AddBool("show", true);
partition.AddString("name", "TEST Data");
partition.AddString("type", "unknown");
partition.AddString("path", "/dev/disk/ide/ata/0/slave/0/0_1");
partition.AddInt64("size", 250 * (int64)1024 * 1024 * 1024);
settings->AddMessage("partition", &partition);
return B_OK;
}
status_t
TestBootDrive::WriteBootMenu(BMessage *settings)
{
printf("WriteBootMenu:\n");
settings->PrintToStream();
BMessage partition;
int32 index = 0;
for (; settings->FindMessage("partition", index, &partition) == B_OK;
index++) {
printf("Partition %d:\n", (int)index);
partition.PrintToStream();
}
return B_OK;
}
status_t
TestBootDrive::SaveMasterBootRecord(BMessage* settings, BFile* file)
{
return B_OK;
}
status_t
TestBootDrive::RestoreMasterBootRecord(BMessage* settings, BFile* file)
{
return B_OK;
}
status_t
TestBootDrive::GetDisplayText(const char* text, BString& displayText)
{
displayText = text;
return B_OK;
}

View File

@ -1,32 +0,0 @@
/*
* Copyright 2008-2010, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Michael Pfeiffer <laplace@users.sourceforge.net>
*/
#ifndef TEST_BOOT_DRIVE_H
#define TEST_BOOT_DRIVE_H
#include "BootDrive.h"
class TestBootDrive : public BootDrive {
public:
TestBootDrive();
virtual ~TestBootDrive();
virtual bool IsBootMenuInstalled(BMessage* settings);
virtual status_t ReadPartitions(BMessage* settings);
virtual status_t WriteBootMenu(BMessage* settings);
virtual status_t SaveMasterBootRecord(BMessage* settings,
BFile* file);
virtual status_t RestoreMasterBootRecord(BMessage* settings,
BFile* file);
virtual status_t GetDisplayText(const char* text,
BString& displayText);
};
#endif // TEST_BOOT_DRIVE_H