#17969 closed bug (fixed)

[Bootmanager] Wrong partition names

Reported by: bipolar Owned by: nobody
Priority: normal Milestone: R1/beta4
Component: Applications/BootManager Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

This is on hrev56511, 64 bits (but I see the same on hrev56480 32 bits install on the same HDD)

Bootmanager seems to have probems reading the partition names (used as initial values for the Bootman boot menu):

It works OK on hrev56193:


Note: both Tracker's Mount menu and DriveSetup show the correct partitions names.

Attachments (2)

Bootmanager-WrongSizes-and-weird-partition-labels.png (81.2 KB ) - added by bipolar 20 months ago.
Bootmanager-hrev56193.png (54.4 KB ) - added by bipolar 20 months ago.

Download all attachments as: .zip

Change History (8)

by bipolar, 20 months ago

Attachment: Bootmanager-hrev56193.png added

comment:1 by bipolar, 20 months ago

Sorry for assigning the wrong component and version: Webpositive logged me out in my early attempt at filling this ticket, and I forgot to change those this time.

comment:2 by bipolar, 20 months ago

The following modification makes it show the correct names:

diff --git a/src/apps/bootmanager/LegacyBootMenu.cpp b/src/apps/bootmanager/LegacyBootMenu.cpp
index 2424c92d..d9d66f80 100644
--- a/src/apps/bootmanager/LegacyBootMenu.cpp
+++ b/src/apps/bootmanager/LegacyBootMenu.cpp
@@ -246,7 +246,7 @@ PartitionRecorder::Visit(BPartition* partition, int32 level)
        partition->GetPath(&partitionPath);
 
        BString buffer;
-       const char* name = partition->ContentName();
+       const char* name = partition->RawContentName();
        if (name == NULL) {
                BString number;
                number << ++fUnnamedIndex;

Does this sounds like the right fix? Should I just send it to gerrit as-is?

Edit: I guess I'm warry as to why BPartition's ContentName() worked for the last partition, but not for the others, so there might be more things involved that I do not know about.

Last edited 20 months ago by bipolar (previous) (diff)

comment:3 by korli, 20 months ago

Could you try with the following? ContentName() returns a BString since hrev56463

@@ -246,8 +246,8 @@ PartitionRecorder::Visit(BPartition* partition, int32 level)
        partition->GetPath(&partitionPath);
 
        BString buffer;
-       const char* name = partition->ContentName();
-       if (name == NULL) {
+       BString name = partition->ContentName();
+       if (name.Length() == 0) {
                BString number;
                number << ++fUnnamedIndex;
                buffer << B_TRANSLATE_COMMENT("Unnamed %d",

in reply to:  3 comment:4 by bipolar, 20 months ago

Replying to korli:

Could you try with the following? ContentName() returns a BString since hrev56463

Works like a charm!

Edit: still scratching my head as to why the last partition was getting the correct name, but not the first ones... and from where that "metype" was being read (from the names of some fields of the BMessage, I guess: "name" and "type"). C++ is scary :-D

Last edited 20 months ago by bipolar (previous) (diff)

comment:5 by bipolar, 20 months ago

Fixed on hrev56513.

(Ticket's Component and Version fields should read: "Applications/BootManager" and "R1/Development" respectively).

comment:6 by nephele, 20 months ago

Component: - GeneralApplications/BootManager
Milestone: UnscheduledR1/beta4
Resolution: fixed
Status: newclosed
Version: R1/beta3R1/Development
Note: See TracTickets for help on using tickets.