Opened 14 years ago

Last modified 13 years ago

#6724 assigned bug

Creating a second active partition should unactive the first one

Reported by: starsseed Owned by: bebop
Priority: normal Milestone: R1
Component: Applications/DriveSetup Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: x86

Description

  1. Create an intel partition-map inside an empty disk
  2. Create a first primary partition with the <active> flag
  3. Create a second primary partition with the <active> flag

you will see 2 actives partitions.

hrev39010 (gcc4)

Attachments (2)

TwoActivePartitions.png (34.2 KB ) - added by starsseed 14 years ago.
active_partition.patch (713 bytes ) - added by bebop 13 years ago.

Download all attachments as: .zip

Change History (6)

by starsseed, 14 years ago

Attachment: TwoActivePartitions.png added

comment:1 by starsseed, 14 years ago

Component: - GeneralApplications/DriveSetup
Owner: changed from nobody to stippi

comment:2 by anevilyak, 14 years ago

Owner: changed from stippi to bebop
Status: newassigned

by bebop, 13 years ago

Attachment: active_partition.patch added

comment:3 by bebop, 13 years ago

When the MBR was being written, the active partition was properly handled. The problem was that the partition_data was not being updated correctly. This means if one was to restart the computer the correct values for the active partition would be displayed.

This patch is the quick and dirty fix to the problem. It sets all of the current primary partitions parameters to an empty string if the partition being created has the active flag set to true.

This works as the intel disk system only uses the parameters string for the active partition. Any comments on how this should/could be handled are welcome.

in reply to:  3 comment:4 by bonefish, 13 years ago

Replying to bebop:

When the MBR was being written, the active partition was properly handled. The problem was that the partition_data was not being updated correctly. This means if one was to restart the computer the correct values for the active partition would be displayed.

This patch is the quick and dirty fix to the problem. It sets all of the current primary partitions parameters to an empty string if the partition being created has the active flag set to true.

This works as the intel disk system only uses the parameters string for the active partition. Any comments on how this should/could be handled are welcome.

Actually that's not quite correct: https://dev.haiku-os.org/browser/haiku/trunk/src/add-ons/kernel/partitioning_systems/intel/intel.cpp?rev=34377#L220. Setting the string the same way would be more correct (refactoring that bit into a separate function would be a bonus :-)). Other than that the locking/marking partitions busy must be adjusted, since ATM _user_create_child_partition() does only mark the parent partition busy, not the also changed pre-existing children. This also holds true for other functions, like _user_set_partition_parameters(), BTW.

Note: See TracTickets for help on using tickets.