diff --git a/src/apps/bootmanager/BootManagerController.cpp b/src/apps/bootmanager/BootManagerController.cpp index 75375cdeff..92905f8cc8 100644 --- a/src/apps/bootmanager/BootManagerController.cpp +++ b/src/apps/bootmanager/BootManagerController.cpp @@ -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); diff --git a/src/apps/bootmanager/LegacyBootMenu.cpp b/src/apps/bootmanager/LegacyBootMenu.cpp index 35754c2051..7ed04990e9 100644 --- a/src/apps/bootmanager/LegacyBootMenu.cpp +++ b/src/apps/bootmanager/LegacyBootMenu.cpp @@ -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" diff --git a/src/apps/bootmanager/TestBootDrive.cpp b/src/apps/bootmanager/TestBootDrive.cpp deleted file mode 100644 index 88c8cad087..0000000000 --- a/src/apps/bootmanager/TestBootDrive.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright 2008-2011, Haiku, Inc. All rights reserved. - * Distributed under the terms of the MIT License. - * - * Authors: - * Michael Pfeiffer - */ - - -#include "TestBootDrive.h" - -#include - -#include - - -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; -} diff --git a/src/apps/bootmanager/TestBootDrive.h b/src/apps/bootmanager/TestBootDrive.h deleted file mode 100644 index ad2e9034da..0000000000 --- a/src/apps/bootmanager/TestBootDrive.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2008-2010, Haiku, Inc. All rights reserved. - * Distributed under the terms of the MIT License. - * - * Authors: - * Michael Pfeiffer - */ -#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