Author Topic: Support for volume UUID and/or device tree lookup in "Default Partition"  (Read 18438 times)

0 Members and 1 Guest are viewing this topic.

zarac

  • Observer
  • Posts: 13
could it be possible to expand the functionality of "Default Partition" by adding other ways of identifying the partition?

for instance using volume UUID:
Code: [Select]
"Default Partition"=UUID(EC541531-1D67-3116-A981-6521E97E20FE)
or by device tree:
Code: [Select]
"Default Partition"=PCI0@0/IDE1@1F,2/PRIM@0/PMP@0
the reason i'm asking this is because my disk numbers change depending on how many usb sticks or external disks (usb and esata) i have plugged during boot. for instance, my snow leopard volume can be seen as anything from disk0s2 to disk3s2.

needless to say, chameleon often tries to boot the wrong partition here.

thanks for reading :)

« Last Edit: June 19, 2010, 11:13:02 PM by zarac »

zarac

  • Observer
  • Posts: 13
nobody else has this problem?

i cannot circumvent this problem because my ich9 ahci is flakey, so esata hot-swap doesn't work every time.
then i have to reboot osx with esata plugged in, and my "default partition" isn't there anymore.

well, nevermind. Boot Think deals with this perfectly - even though i'd rather use Chameleon because it's open source.

zef

  • Administrator
  • Posts: 265
Hi zarac,

Just committed your feature request into trunk:

http://forge.voodooprojects.org/p/chameleon/source/commit/182/

Now you can freely swap your disks, the booter should find the given partition if you use this alternate format for
the "Default Partition" option:

Code: [Select]
<key>Default Partition</key>                                                                                               
<string>0A81F3B1-51D9-3335-B3E3-169C3640360D</string>

Bye,
zef
ASUS P8Z68-V PRO/GEN3 | i5-2500k | 16GB RAM | GTX560 | Keyboard | Mouse | Devilsound DAC

zarac

  • Observer
  • Posts: 13
thank you, i appreciate it!

danielkza

  • VoodooLabs
  • Posts: 9
Since we're on the subject, I wrote a patch so devices can be specified as hd(x,y), UUID, and also a label enclosed in quotes. Unlike what's currently committed, it works for renaming, hiding and selecting partitions as default.

It took quite a bit more work than I expected because I had to write code to handle XML entities, which I needed because they're the 'right way' to do things, but mainly because PList Editor uses them.

Some examples that I tested and should work now (based on trunk revision 264) follow. Quotes are mandatory with a single exception: they're optional in the new name to assign to a renamed partition.

Code: ('xml') [Select]
<key>Rename Partition</key>
<string>"Windows" Windows 7; B8EA194F-69BE-35A4-AFF6-C51FCD0DA656 Mac OS X SL; hd(1,1) Hidden Partition</string>
<key>Hide Partition</key>
<string>hd(1,2) "Hidden Partition"</string>
<key>Default Partition</key>
<string>"Mac OS X SL"</string>

Any testers?
« Last Edit: July 27, 2010, 01:06:36 PM by danielkza »

Terc

  • Forum Moderator
  • Posts: 129
Whoah.  Very slick.
Even zef's commit would have been nice, but I _really_ like this.  I'm booting from chameleon on a usb onto a raid, so I've always had to specify the disk.  Labels or uuid would be such a blessing.

danielkza

  • VoodooLabs
  • Posts: 9
@Terc:

Here's a compiled version for you, if you'd like to help with testing.
« Last Edit: July 28, 2010, 05:35:11 AM by danielkza »

Terc

  • Forum Moderator
  • Posts: 129
I'll give it a shot tomorrow.  I was up way too late last night.  Thanks for building it for me though, I'll let you know how it goes.

zarac

  • Observer
  • Posts: 13
whoa! nice development.
i'm on vacation and away from my hackintosh, but will test this as soon as i return home.

thank you!

zef

  • Administrator
  • Posts: 265
@danielkza:

Thanks, this looks pretty awesome! Just added your patch to my todo list :)
ASUS P8Z68-V PRO/GEN3 | i5-2500k | 16GB RAM | GTX560 | Keyboard | Mouse | Devilsound DAC

danielkza

  • VoodooLabs
  • Posts: 9
@zef:

Thank you. But...

I think I found some small mistakes, that I'll be correcting soon. It'd be a good idea to hold it for a while before commiting :P

zef

  • Administrator
  • Posts: 265
@zef:

Thank you. But...

I think I found some small mistakes, that I'll be correcting soon. It'd be a good idea to hold it for a while before commiting :P

How about creating a branch for you in the repo, then you can fix the issues and later we can merge back your changes?

I would need your forge login name to do that.

Thanks!

Bye,
zef
ASUS P8Z68-V PRO/GEN3 | i5-2500k | 16GB RAM | GTX560 | Keyboard | Mouse | Devilsound DAC

danielkza

  • VoodooLabs
  • Posts: 9
@zef:

Just created an account named danielkza on forge.

zef

  • Administrator
  • Posts: 265
Hi danielkza,

Created a branch for you:

http://forge.voodooprojects.org/p/chameleon/source/tree/HEAD/branches/danielkza

You can use your forge login + extra password to get write access for the repo (visit this url: http://forge.voodooprojects.org/p/chameleon/source/help/)

Thanks for your efforts! :)

Bye,
zef
ASUS P8Z68-V PRO/GEN3 | i5-2500k | 16GB RAM | GTX560 | Keyboard | Mouse | Devilsound DAC

zef

  • Administrator
  • Posts: 265
Re: Support for volume UUID and/or device tree lookup in "Default Partition"
« Reply #14 on: August 21, 2010, 09:38:43 PM »
@Danielkza:

Many thanks for your efforts! Merged back your changes with some modifications into the trunk (starting at r413):

http://forge.voodooprojects.org/p/chameleon/source/commit/416/

Tested the new features on the "Hide Partition" option with NTFS partitions' volume labels and volume serials. So far so good :)

Let me know if I missed or messed something :)

Bye,
zef
ASUS P8Z68-V PRO/GEN3 | i5-2500k | 16GB RAM | GTX560 | Keyboard | Mouse | Devilsound DAC