overdue-scratch

Author Topic: Extra Folder on each partition  (Read 5427 times)

0 Members and 1 Guest are viewing this topic.

hsparks

  • Entrant
  • Posts: 7
Extra Folder on each partition
« on: August 15, 2009, 03:08:32 PM »
I got myself into difficulties because I thought Chameleon already
worked this way, but I'll move the idea here as a feature request:

On a disk with multiple MacOS partitions, I would like to see support
for having an Extra partition inside each. When the user selects a
partition to be the root at boot time, the kernel and Extra folder inside
that root are used to boot the system.

MacOS1
    boot
    mach_kernel
    Extra/
        com.apple.Boot.list
        DSDT.aml
        Extensions/
        Themes/
    ...

MacOS2
    boot
    mach_kernel
    Extra/
        com.apple.Boot.list
        DSDT.aml
        Extensions/
        Themes/
    ...

This makes it easy to have several versions of MacOS, each with
its own collection of disablers, kexts, efi string, etc. all on the
same drive.

It also makes it easy to recover from updates that don't work out:
A stable version of MacOS can be kept on the drive which is completely
self-contained.

As it is, it seems that all the MacOS partitions on a drive must share the same
kernel and Extra folder. (Right???) So trying out a new MacOS risks making the
whole drive unbootable if it requires changes to the Extra/Extensions,
EFI strings, or DSDT.aml.  Of course recovery is possible via the suggested
boot CD, but that is a pain compared to simply selecting a different root
on the boot screen.



ANARCHiNTOSH

  • Observer
  • Posts: 11
  •  + Ⓐ
    • My InsanelyMac Page
Re: Extra Folder on each partition
« Reply #1 on: May 05, 2010, 01:20:32 PM »
+10000000
this would be so brilliant. i would love the dev team forever if they implemented this.

currently i have to change drive order in bios everytime i am testing new dsdt or efistring hacks,
which is not very logical or dev friendly.

using the /Extra folder on the drive or partition chosen at boot rather than the /Extra folder on the same partition as the booter files
would be great.

those who love having a separate EFI partition could specify which MacOS partition it is linked to in boot.plist


however i dont know how entrenched the code is in regard to this.
 10.6.3 Retail GA-EX58-UD5 and ATI4350

zef

  • Administrator
  • Posts: 265
Re: Extra Folder on each partition
« Reply #2 on: May 06, 2010, 03:34:22 PM »
Guys,

The selected partition's Extra folder will be used automatically for extensions loading and you can also override the default boot.plist entries using the Extra/com.apple.Boot.plist.

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

cosmo1t

  • VoodooLabs
  • Posts: 25
Re: Extra Folder on each partition
« Reply #3 on: May 20, 2010, 05:01:55 PM »
Zef, i can also vouch that it "automatically" doesn't work that way.
I'll test overriding it w/ the com.apple.boot.plist, but i dont' see how that would be any different since it pulls that from the /Extra as well..


Drule

  • Observer
  • Posts: 19
Re: Extra Folder on each partition
« Reply #4 on: June 11, 2010, 06:22:54 AM »
Zef, i can also vouch that it "automatically" doesn't work that way.
I'll test overriding it w/ the com.apple.boot.plist, but i dont' see how that would be any different since it pulls that from the /Extra as well..

Woah, hold on a second. Are you saying that I have a few partitions on one hard drive, that I've been using to test SL installations on. Chameleon is only referencing the '/Extra' folder of one of them, no matter which I select to boot from?

This may actually explain why I can't seem to track down and fix a KP I'm getting all the time.

So you should only have one bootable partition per drive?

Blackosx

  • Forum Moderator
  • Posts: 1150
Re: Extra Folder on each partition
« Reply #5 on: June 11, 2010, 10:53:50 AM »
So you should only have one bootable partition per drive?
That's how I have it set up.

When I first started using Chameleon, I also tried using an /Extra folder per partition but I never got that working. I haven't tried it since.
10.10.5 / 10.11 GM1 | Asus Maximum IV Gene-Z | i7-2600 3.40GHz | 4GB | Radeon 5770 1GB

zef

  • Administrator
  • Posts: 265
Re: Extra Folder on each partition
« Reply #6 on: June 11, 2010, 11:45:51 AM »
Ok guys, will investigate this issue. It supposed to be work (and it did in fact) as hsparks described above (except for the Themes since they're loaded once before the booter displays the partition selection).
ASUS P8Z68-V PRO/GEN3 | i5-2500k | 16GB RAM | GTX560 | Keyboard | Mouse | Devilsound DAC

ANARCHiNTOSH

  • Observer
  • Posts: 11
  •  + Ⓐ
    • My InsanelyMac Page
Re: Extra Folder on each partition
« Reply #7 on: June 11, 2010, 12:51:47 PM »
thanks zef!
 10.6.3 Retail GA-EX58-UD5 and ATI4350

digital_dreamer

  • Observer
  • Posts: 11
Re: Extra Folder on each partition
« Reply #8 on: June 14, 2010, 11:10:23 AM »
Yep, this is, indeed, the way it works.
The bootloader always loads the kexts that the BIOS is pointing to. Selecting another install in the bootloader screen will not load the kexts from that install.

I imagine many having boot issues because of this very point. But, as long as you have the same kexts in the various installs, this works out well.

Actually, I think this method is a partial feature, believe it or not. It makes possible the use of bootCDs. Think about it. You load the kexts from the BootCD, eject, and boot into your install DVD. This is only possible if the bootloader preloads from the CD.

However, I think the Cham bootloader should be more intelligent in loading these kexts:
1. If there isn't a /Extra folder on the selected partition/drive (i.e. install DVD), it should just skip it and continue with the preloaded set.
2. If there IS a valid /Extra folder on the selected partition/drive, give the user the option to load or skip, with load being the default action, naturally.

I might add:
You can prove that it works this way by putting a boot-uuid key in the boot plist of the first drive/partition in the BIOS boot order. Once in the bootloader, you will always boot into that first install (the preloaded plist version), regardless of what other Mac OS X partition you select.  :P

MAJ
« Last Edit: June 14, 2010, 11:40:24 AM by digital_dreamer »

Drule

  • Observer
  • Posts: 19
Re: Extra Folder on each partition
« Reply #9 on: June 20, 2010, 06:01:37 AM »
I might add:
You can prove that it works this way by putting a boot-uuid key in the boot plist of the first drive/partition in the BIOS boot order. Once in the bootloader, you will always boot into that first install (the preloaded plist version), regardless of what other Mac OS X partition you select.  :P

MAJ

Still a little confused. I understand that the first drive selected in the BIOS will be the one it boots, and that the Chameleon on that drive will be the one loaded. But how does Chameleon determine which Extra folder to use on the boot drive (first one in the BIOS list) when you have more than one partition, and even an EFI partition with Chameleon installed?

1st Drive In BIOS Boot Order List (BOOT DRIVE - Chameleon on this drive is loaded)
  EFI partition (Chameleon uses boot.plist from the Extra folder here. DSDT.asl, SMBIOS in Extra or root are ignored)
  SL 10.6.2 partition (1. in non-GUI drive list)
  SL 10.6.3 partition (2. in non-GUI drive list)

2nd Drive In BIOS Boot Order List
  Leop 10.5.8 partition (3. in non-GUI drive list)

So if I select 2 from the drive list,  the DSDT.asl, SMBIOS in 2/Extra are loaded, but nothing else)

Is that about right? What I'd like to know is which Extensions.mkext is used (right now it looks like it uses the one EFI/Extra), and how can I get Chameleon to use the DSDT.asl I have placed in the EFI partition?

Azimutz

  • VoodooLabs
  • Posts: 420
  • Paranoid Android
Re: Extra Folder on each partition
« Reply #10 on: June 20, 2010, 09:41:24 PM »
Ok, i've been thinking here about the best way to explain how Chameleon looks for files and it's not easy.. it requires a long post :P so, i'm gonna stick to the essentials and just point were each file is looked at, atm (RC4 & RC5).
First some notions:
Chameleon looks for files in two volumes, boot volume and default/selected volume, on the boot device, being:
- boot device = whatever you have set on the BIOS or choose, to be the first boot device (a local HD, etc...).
- boot volume = partition were the booter is installed.
  The paths for this volume begin with bt(0,0).
- default/selected volume = determined by Chameleon if no default value is provided, usually the Active or
  first bootable partition on the boot device.
  This becomes the selected volume once we press Enter to boot.
  The paths for this volume begin with /.

- boot volume = default/selected volume, when the booter is installed to the default/selected volume.
 
In this situation, both / and bt(0,0)/ point to the same place.

The paths the booter looks at are different for each file, mainly due to the role each file plays on the boot process, but
not only :P These paths are:
 
kernel: it's always loaded from the default/selected volume; override is possible.
Boot.plist: look here for a insight.
drivers: here things are bit more complicated; there are some "rules";
  If there is a ramdisk mounted, it will be the first path searched:
         rd(0,0)/Extra/
  Next is default/selected volume:
         /Extra/
  Then, if no files are found on default/selected volume,
  search the boot volume:
      first on OS specific folders:
         e.g. bt(0,0)/Extra/10.5/
      next on Extra's root:
         bt(0,0)/Extra/
dsdt.aml: there are changes between RC4 and RC5; override is possible.
  RC4: current folder (this was removed on RC5 recently)
          /Extra/dsdt.aml
          bt(0,0)/Extra/dsdt.aml
  RC5:  /Extra/dsdt.aml
          /
          bt(0,0)/Extra/dsdt.aml
smbios.plist: there are changes between RC4 and RC5; override is possible.
  RC4: same as dsdt.
  RC5: it's always loaded from the default/selected volume.
 
Otherwise specified, paths are checked by the order shown, first found is used.
Hope this can clear some doubts.


Now, about the topic's theme, how about doing it the opposite way? hum :)
Ditch /Extra path, leave it just for user override and search for files only on boot volume!?
« Last Edit: June 21, 2010, 05:11:30 AM by Azimutz »
 System & Patches: http://goo.gl/i961
 Chameleon:
- trunk builds: http://goo.gl/9G1Hq
- pref pane: http://goo.gl/OL2UT