Voodooprojects

Chameleon => General Discussion => Topic started by: SunLizard on September 15, 2009, 12:16:05 AM

Title: Upgrading from v1.X to v2.x Chameleon... What you need to know (SOLVED)
Post by: SunLizard on September 15, 2009, 12:16:05 AM
Gents n Ladies,

Somewhat of a n00b question here, but I have to ask it as I feel I'll be safer getting with a little guidance.

I've got a 1.0.1xx version of Chameleon I'm using on my Hackintosh and it works perfectly.

Never one to leave fixed things be, I've been reading about the wonderful virtues of DSDT.aml configurations and decided I want to muck about with them.  I've read enough to know v2.0 allows you to play with different dsdt.aml files.

I haven't tried to upgrade my current non-raid system *YET* but I figured I'd get into it tonight.

How does one go about moving from a Chameleon v1.x to v2.x and not find yourself re-building the system from scratch?

(I've thoughtfully cloned my working disk so I have that to fall back on in case I goon something up.)

Any help/pointers/tips would be much appreciated.

regards-
S_L

EDIT: (9/18)  The ultimate answer here is that THERE IS NOTHING you need to bring over from Cham v1 to Cham v2.  You should be aware though, if, like me, you were changing bootloaders, that v1 and v2 releases vary wildly in how/where/and what they put in different locations.  Read through this and it may head questions off before you have them.

EDIT: (9/18) You need to know that v1 also hid the boot file on your root directory of your OSX partition. it also used a boot0 to on the 0 block of the mbr to point to that file.  Installing v2 via guides will replace 'boot0' and put 'boot' in a new location, if those things don't match you will get headaches.  Read lots an make backups.  Good luck[/green]
Title: Re: Upgrading From older Chameleon
Post by: rocksteady on September 15, 2009, 02:08:11 AM
now why you wanna brake our hearts ?

How does one go about moving from a Chameleon v1.x to v2.x and not find yourself re-building the system from scratch?
messing with bootloaders won't screw a stable OS installation, you're just messing with the bootloader(s)

Title: Re: Upgrading From older Chameleon
Post by: SunLizard on September 15, 2009, 03:16:11 AM
Rocksteady,

Not lookin for heartbreak, just some love.

Totally understand bootloaders =/ Stable OS, but I'm building a CloneImage so I have something to muck with DSDT.aml which will rock my stable MacOS.... (or at least render me without a bootable system.)

So how does anyone know of an easy way to put v2RC2 over top of v1?

It maybe easy.... I just figured I'd ask if anyone had done it before I tried it ...

Thanks for the reply.
S_L
Title: Re: Upgrading From older Chameleon
Post by: Firestryke31 on September 15, 2009, 05:30:59 AM
When I upgraded I just used the package installer from the website.

Of course, I don't have any bizarre pre-kernel hacks going on, so YMMV.
Title: Re: Upgrading From older Chameleon
Post by: Gringo Vermelho on September 15, 2009, 07:40:12 AM
Yep, just run the installer package and install Chameleon 2.0 in the same place as your older version.
For example, if the old version is not installed on an EFI partition, don't pick EFI in the installer options.

Also check out the nice SATA/PATA injectors and orange-icon-fix kexts that come with Chameleon 2.0.
If you have any patched kexts for your SATA/PATA controllers already in S/L/E you might not need them anymore.
Title: Re: Upgrading From older Chameleon
Post by: SunLizard on September 15, 2009, 07:56:27 AM
Hmm.. Thanks.

I'll try the installer package, tonight but, after reading the boards (here and at Insanely) I had been scared off the installer.  I personally like the DITY option of installing anyway (I like to see what goes where) But perhaps I'll give the installer a try.

I'll post results tomorrow evening.
Title: Re: Upgrading From older Chameleon
Post by: SunLizard on September 15, 2009, 04:29:21 PM
I attempted to use the package installer.

it hangs here: (from the Log File)

Sep 15 07:18:13 SixMac runner[5055]: Extracting BOM from "/Users/MacOSUser/Downloads/Hackintosh FIles/Chameleon-2.0-RC2-r640.pkg" to "/Volumes/SnowLeopard_Install/Library/Receipts/boms/org.chameleon.core.bom"

** for the record: SnowLeopard_Install is a USB stick with GUID and EFI partitions already built.
partition scheme:
/dev/disk2
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *7.5 Gi     disk2
   1:                        EFI                                  200.0 Mi   disk2s1
   2:              Apple_HFS SnowLeopard_Install       7.1 Gi     disk2s2

=======================
I think for a second attempt I'd like to just do a manual install over-write.

If I use the commands from the readme do I have to have to be concerned about saving anything from my old EFI partition?




Title: Re: Upgrading From older Chameleon
Post by: rocksteady on September 15, 2009, 04:36:21 PM
...do I have to have to be concerned about saving anything from my old EFI partition?

(assuming that you're talking about your 10.5.x files):
KEXTs required for 10.6 will most likely be different but wouldn't hurt to backup

keep your com.apple.Boot.plist, smbios.plist (if you have it) and DSDT.aml (if you have a decent one)

please get a signature with the basic specs of your setup, i'm not a fan of sigs myself but they help troubleshooting hw-specific issues. someone with similar hw may also give you a hint
Title: Re: Upgrading From older Chameleon
Post by: SunLizard on September 15, 2009, 06:46:04 PM
Rocksteady,

Got the sig updated.

As far as I know, nothing in the old Chameleon had any of the Hardware specfic information in it.  I believe (not 100% certain) I was running netkas 9.x PC-EFI.

Is there any way to dump my current EFI partion of my startup disk to see what's there (I'm also unclear if that information would really help me as the file name may be date-stamped but probably maintain same file structure. (IE that information would not be useful to me.)

Correct me if I'm wrong here but the v1 Chameleon didn't support DSDT.aml files, did it?

(I've kept copies of all kexts I've had good luck with since my very first 10.4.x installs.)

I will copy my current com.apple.Boot.plist and smbios.plist.  Those are on the Apple HFS partition in the /Library/, correct?
Title: Re: Upgrading From older Chameleon
Post by: SunLizard on September 15, 2009, 08:50:49 PM
I had a bit of time to do some searching around voodoo and insanely and figured I post my results here for the benefit of anyone else who might be suffering n00bism like my self. (Nothing like answering your own questions...)

Quote
Is there any way to dump my current EFI partion of my startup disk to see what's there
Yes: you have to mount your EFI partion first.

EDIT: (9/18) It may turn out that your EFI partition is formated in something other than HFS/HFS+ in which case read the man page on 'mount' to figure out how to get it to mount on your system.  THe following assumes your EFI partition is formated in HFS.

(ref: http://forum.voodooprojects.org/index.php/topic,327.msg1218.html#msg1218 )
 
How do you mount your EFI partion?:  Good question! 
Like this: (in terminal)
Code: [Select]
mkdir /Volumes/EFI
mount_hfs /dev/diskXs1 /Volumes/EFI
(ref: http://www.insanelymac.com/forum/index.php?showtopic=127330 )

Now your EFI partition *should* show up in finder. 
EDIT: (9/18) If it doesn't, you can try restarting Finder using 'killall Finder'  

Poke around to hearts content...  when your done make things clean:
(in terminal)
Code: [Select]
umount /Volumes/EFI (If this fails, do umount -f /Volumes/EFI).
rm -rf /Volumes/EFI

Quote
I will copy my current com.apple.Boot.plist and smbios.plist.  Those are on the Apple HFS partition in the /Library/, correct?

For my Cham v1 + PC-EFI 9.x I believe these files reside on the Main Apple HFS in /Library/Preferences/SystemConfiguration/ but I have to get back home to confirm....

Anyone with more experience than me on this issue, feel free to correct any mistakes.  [Thanks rocksteady and munky for reference posts.]

More to follow...
S_L
Title: Re: Upgrading From older Chameleon
Post by: rocksteady on September 16, 2009, 01:15:48 AM
Looks like I didn't get your drift right (might be that a new member pissed me off seconds after polishing the faq). I thought that by "dumping" your EFI's contents you had something like dd/cloning in mind. Also thought that you knew the basics (how to mount/unmount, etc). Anyways you got that sorted.

Kudos for following up your own post but for (our forum) completion's sake we don't allow cross-posting (rule 1 (http://forum.voodooprojects.org/index.php/topic,90.0.html)) (only exception being Wikipedia for reference terms). Instead we integrate them here (even by simple copy/paste) and give credit to the OP/author's work. Reason behind this is that lots of other places in the internets go offline/foobar/edited, and it gets just plain hard to make sense. It also helps me + the rest of the Chameleon team spend more time testing Chameleon than ninjaing the forums. I keep track of the most sensible posts to create faqs + tips.

btw: you could find the commands to mount/unmount a EFI partition in Gringo's [How-to] manually install Chameleon 2.0 to an EFI/GPT drive (http://forum.voodooprojects.org/index.php/topic,649.0.html)

Quote
I will copy my current com.apple.Boot.plist and smbios.plist.  Those are on the Apple HFS partition in the /Library/, correct?

For my Cham v1 + PC-EFI 9.x I believe these files reside on the Main Apple HFS in /Library/Preferences/SystemConfiguration/ but I have to get back home to confirm....
Reading your sig, I see you have a retail setup meaning that the contents of Mac OS X folder structure stayed retail/untouched. All you need to backup is your files inside EFI/Extra (ie EFI/Extra/com.apple.Boot.plist, etc).

Title: Re: Upgrading From older Chameleon
Post by: SunLizard on September 16, 2009, 02:47:41 AM
Quote
Anyways you got that sorted...

Yeah.  I'm actually okay with most BSD/Linux/*nix commands.  I knew how to mount a partition, just didn't understand originally it worked the same for EFI (not sure how file structure in there worked... probably could have discerned that if I'd thought for a few seconds... anyway)  disk druid (dd) is old hat..

I've been poking across all your forums.  Had the FAQ forum been working originally (it was under construction when I started reading saturday night) I probably would have been able to format my question more accurately.

Side note: Read rule 1 before posted my own response.  I posted info and listed reference (cross-post) as I just used part of it.  Point well taken the EFI/GPT discussion had same info...

On to the real stuff.

My original question (which I'll change Topic to once its sorted) should have been:

"I'm upgrading from Chameleon 1.0.x to v2.... so what do I need to know?"

I'm continuing to poke here and in other places to compile the information... once done I'll formulate a guide here
Turns out theres quite a bit of information on v2 here, and a lot of info on hardware and why you'd want to elsewhere, but no place for one stop shopping on and what the pitfalls are.  Which is my concern...

Anyway, I'll keep at it.  Thanks for the feedback.

S_L
Title: Re: Upgrading From older Chameleon
Post by: SunLizard on September 16, 2009, 07:19:17 AM
Update....

I tried using my own instructions only to be frustrated...

Code: [Select]
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *698.6 Gi   disk0
   1:                        EFI                         200.0 Mi   disk0s1
   2:                  Apple_HFS Gaff                    349.3 Gi   disk0s2
   3:                  Apple_HFS Rachel                  348.9 Gi   disk0s3
/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *698.6 Gi   disk1
   1:                        EFI                         200.0 Mi   disk1s1
   2:                  Apple_HFS Tyrell                  349.3 Gi   disk1s2
   3:                  Apple_HFS Holden                  348.9 Gi   disk1s3
bash-3.2# mkdir /Volumes/EFI
bash-3.2# mount_hfs /dev/disk0s1 /Volumes/EFI
mount_hfs: Invalid argument
bash-3.2# fsck_hfs /dev/disk0s1
** /dev/rdisk0s1
bash-3.2# mount_hfs /dev/disk0s1 /Volumes/EFI
mount_hfs: Invalid argument
bash-3.2# mount /dev/disk0s1 /Volumes/EFI
/dev/disk0s1 on /Volumes/EFI: Incorrect super block.
bash-3.2# fsck /dev/disk0s1
** /dev/rdisk0s1
BAD SUPER BLOCK: MAGIC NUMBER WRONG

LOOK FOR ALTERNATE SUPERBLOCKS? [yn] y

SEARCH FOR ALTERNATE SUPER-BLOCK FAILED. YOU MUST USE THE
-b OPTION TO FSCK TO SPECIFY THE LOCATION OF AN ALTERNATE
SUPER-BLOCK TO SUPPLY NEEDED INFORMATION; SEE fsck(8).
bash-3.2#


it appears that first thing I needed to know is I'm going to have issues mounting my EFI partition...
Title: Re: Upgrading From older Chameleon
Post by: rocksteady on September 16, 2009, 02:13:08 PM
ok,

since what you were trying to achieve wasn't clear, let's start afresh and forget EFI for a moment:

I see that you have a rocksteady 10.5.8 installation, a backup of it and a spare HD for installing 10.6

1. Leave your 10.5.8 installation as is

2. Boot to your 10.5.8 and copy your /Extra/com.apple.Boot.plist to a stick/hd/wherever you like. Assuming that your /Extra/com.apple.Boot.plist includes hex strings for your GPU/LAN and other useful info for your setup.

3. Search for necessary 10.6 kexts for your hardware and copy them to a stick/hd/wherever you like

4. Decide how you'd like to boot the 10.6 Install DVD (boot dvd, usb stick, etc) and create it accordingly. You'll probably use Chameleon + 10.6 kexts for this step too.

5. Verify that you can boot your 10.6 Install DVD or stick or whatever you used.

Post back to report how your getting along
Title: Re: Upgrading From older Chameleon
Post by: SunLizard on September 17, 2009, 12:44:14 AM
Rocksteady,

I'm with you on way forward for 10.6... but that's not my goal for the moment.  It would be nice, but until I get (a) either a new video card as my 2600xT isn supported (yet) or (b) the long awaited 2xxx fix for my card, I'm not really interested in 10.6 yet.

But your objective is sound. 

My real goal is developing a stable DSDT.aml file for my board under 10.5.8

With that in mind, I'm still with you.
------------------------

1.  10.5.8 is left alone (Gaff SATA HDD)  its been cloned (EFI partition and all) to a second drive (exactly the same)   We'll call my clone 10.5.8 stable HDD "Tyrell".  "Tyrell" confirmed booting system in stable capacity.

2.  When you talk about /Extra/com.apple.Boot.plist I'm assuming from the original HFS partiontion and NOT the EFI partion on "Tyrell"...  (EFI partion on "Tyrell" sufferes same problem described above with failing to mount due to super block incorrect)

3. kexts backed up in safe location (for me there was only about 4.)

4. I can create a bootstick with 10.6, but as I said the goal is just getting Cham 2 RC2 or RC3. So I created jsut a patch-stick with Cham. Should I put 10.5.8 on the stick or stick with 10.6  I have both release kit and installer.mpkg on a seperat (real) Mac and used the install.mpkg to make a boot stick with Cham rc 2.  I changed the com.apple.Boot.plsit Kernel Flags to use -v because nothing frustrates me more than note knowing why something is failing....

I will try booting off the patch-stick and report back...

Thanks for your help

S_L

Title: Re: Upgrading From older Chameleon
Post by: SunLizard on September 17, 2009, 03:16:44 AM
Install to USB went fine.  Had to do a manual prep of EFI partition on the USB stick as the package installer errorred out. (same fault as above)  Anyway, I followed the DFE/GTP Guide to manually install Cham 2 RC2 to the USB stick.

Copied over stable/in use kexts to extras folder....

Noted difference between v1 and v2 chameleon... don't know if v1 used com.apple.Boot.plist.  If it does, its installed on the EFI partition (which I can't read/mount)  in any case, I used the default from the tar ball.

Verified boot loader works from patchstick.

I went ahead and put 10.6 image on the patchstick just to see what kind of issued I was going to go thru at some future date... epic fail on loader (Mac Version not yet set) but as stated, objective here isn't getting 10.6 loaded. (Not yet at least)

So I've got Cham 2.0 rc2 working from a patchstick.  Grand.

Still faced with initial questions of what I need to bring over from my stable Cham v1 system (10.5.8) to make a stable system Cham v2 (10.5.8). 

I have a real feeling the answers to that question are going to be on the EFI partiong of my stable Cham v1 10.5.8 (Gaff SATA HDD).  Only wish I could get the darn thing mounted.

S_L

Title: Re: Upgrading From older Chameleon
Post by: SunLizard on September 17, 2009, 05:35:06 AM
Color me dense.  Especially because I got into OSX from my *nix mucking about... anyway, I solved my own problem (kind of)

turns out the original Chameleon resided on an EFI partition that was msdos FAT.  Ergo you need to pass the file system to the mount command if you want to use it.  (mount_hfs was written by @pple to bypass the need (and include the file structure) of passing any specific argument to the 'mount' command. 

Anyway, the point here is if you have a Cham v1 system, and you need to access the EFI partition, use the following command:
Code: [Select]
bash-3.2# mkdir /Volumes/EFI
bash-3.2# mount -t msdos /dev/diskXsX /Volumes/EFI

!- diskXsX is your EFI Partition -!

One indication that you have the partition written in something other than HFS or HFS+ will be the error message: Incorrect super block. { indicating the file structure wasn't what mount_hfs or mount was expecting }

-------------
On to the next issue.

Now that I have my EFI partition mounted and accessible in finder ( killall Finder after mount }
the contents of the EFI partition are:
Code: [Select]
drwxrwxrwx  1 _unknown  _unknown  512 Sep 16 20:15 .fseventsd
drwxrwxrwx  1 _unknown  _unknown  512 Mar  2  2009 EFI
the EFI directory is laid out like this (only one file):
EFI->APPLE->EXTENSIONS->Firmware.scap

I did a google of Firmware.scap and it yielded about f*ck-all useful info.  I was kind of hoping for a nice clean com.apple.Boot.plist but not a chance.  I have yet to try opening Firmware.scap in a Hex editor but in TextEdit, there's no love to be found.

I'll keep poking and keep you informed.

Title: Re: Upgrading From older Chameleon
Post by: Gringo Vermelho on September 17, 2009, 05:48:42 AM
.fseventsd is some kind of log, I don't know if it's spotlight or something else, obviously it's short for File System Events "something".
Deleting it won't cause any problems but it will appear again. You can get rid of it permanently by disabling logging on the partition, find the command in my guide here:

http://forum.voodooprojects.org/index.php/topic,649.0.html

I heard the EFI partition is formatted with FAT(16? 32? don't remember) on real macs, but I haven't seen it for myself.
I also heard, contrary to what some people have said in the past, that Apple actually does use the EFI partition - for firmware upgrades. Again I don't know for sure.

I'm pretty sure it's safe to delete the files on your EFI partition. But I don't know if it matters to Chameleon whether it's formatted with HFS or FAT. I wouldn't think so.

LOL, that sucked, I know. Better wait for someone who actually knows about these things eh.


 
Title: Re: Upgrading From older Chameleon
Post by: SunLizard on September 17, 2009, 07:13:37 AM
Gringo,

Groovy.  Thanks for the response.  I checked my (real) Mac.  Confirmed EFI is HFS on that (which is probably why munky and other have posted mount_hfs instruction all worked)  I think my FAT Cham 1. EFI partition on my hackintosh was something the JaS group was working on in the 10.4.x days.  I never changed it because it worked.

Evidently it doesn't matter to Chameleon (at least v1) if its a FAT partition.  And I just tested the boot loader portion is actually working on HFS+ Cham v2 (as you can prolly attest to as well)

I can also confirm that my stable 10.5.8 system crashes big time off a 'vanilla' transplant of Cham v2.

BTW: answer my own earlier question.  Originally, com.apple.Boot.plist resides in the {primary OSX partition}/Library/Preferences/SystemConfiguration/ directory.  (that's @pples original residence point, before Cham bumped it to 4 alternate locations..)
-------------------
Back on subject: (what I've learned so far) moving from a stable 10.5.8 Cham v1 to 10.5.8 Cham v2:
1) File system use between 2 Chameleons *may* be different (my Cham v1 was FAT, Cham v2s are normally HFS)
2) Files on v1 are different that v2 (ie, don't expect to find a com.apple.Boot.plist on your v1 system.)
3) Transitioning from v1 to v2 system is not as easy as following directions in Readme for your configuration.
4) Transitioning from v1 to v2 system *may* break your stable system. (regardless of OSX rev)
---------------------
Where to go from here:
1) I could futz around with my experimental drive (Tyrell) trying to find something in the configuration of v2 kext/caches/extras through trial and error.  or
2) I could grab a 'scene' release and use their boot loader installer + 10.5.8 releases to rebuild a working drive. 
The advantage there would be once a working v2 was found I could post my comparison back here.  Although that would be kind of a sellout at this point.
-----------
I have to sleep on that one.
Title: Re: Upgrading from v1.X to v2.x Chameleon
Post by: SunLizard on September 18, 2009, 02:58:53 AM
Alright, so I weenie-d out an went with a completely fresh install from iAtkos v7 installer. 

I'm now at Cham v2 RC3 + 10.5.7 on my experimental drive.

I reformatted my experimental drive (Tyrell) and with a fresh drive installed Cham v2 rc1 from iAtkos installer + a base 10.5.7.  From there I verified I was booting OK and bumped the bootloader to v2 RC2.  [ first I tried using the package installer again... once again, it gave me grief and bom'd out]  I shifted to manual install of RC2 and that went ok.

** I'll pause here to let you know from the v2 rc1 installer on the iAtkos v7 release (they used a shell script which worked after I did some terminal a mano]  The files that got installed to the EFI partition were 'bare bones' since I have no experience with RC1 (until today) I cannot say it was due to iAtkos shell, but it was a definite no-frills affiir.  Just a boot file in the EFI partition (as far as I saw) and one directory called /Library/Temp which contained documentation file for configuring smbios.plist and the smbios.plist itself.

After I put Cham v2 RC2 on the EFI partition manually (following the guides)  I decided to verify that I was seeing all files and grabbed the Automator script Show-Hide. DSDT.aml also showed up in the root partition (of the EFI drive)

Using Show-Hide and Finder I was now able to see that the EFI structure had changed significantly.
the directory .Chameleon was now present (note the dot, making it hidden) inside which was the Extra Folder.  Inside Extra { /.Chameleon/Extra/ } were all the files one normally associates with Chameleon (Themes) etc etc.

--------------
Summary:
1) When you go to mount the EFI partition, ensure you have enabled something that allows you to see hidden files. (not something mentioned elsewhere)
2) As far as I can tell, Cham v1 (which writes boot0 to MBR 0, and places a boot file) in the primary partition contains nothing hardware/driver specific therefore you don't need anything from the Cham 1 to go to Cham 2.
3) When shifting between Release Codes (RC) be careful of what goes where in terms of options here's a note sheet:
com.apple.Boot.plist
    On a Mac: {OS Partition}/Library/Preferences/SystemConfig/
    On Cham v1 : same as above (Cham v1 doesn't use it)
    On Cham v2 RC 1: {EFI Partition}/Library
    On Cham v2 RC 2: in .Chameleon/Extra
    On Cham v2 RC 3: (one of 4 locations)
smbios.plist
    On a Mac: N/A
    On a Cham v1: not used w/o patching
    On a Cham v2 RC1: {EFI Partition} /Library
    On Cham v2 RC 2: in .Chameleon/Extra
    On Cham v2 RC 3: (one of 4 locations)
boot
    On a Mac: N/A
    On a Cham v1: in primary root partition
    On a Cham v2 RC1: {EFI Partition} /
    On Cham v2 RC 2: {EFI Partition} /
    On Cham v2 RC 3: {EFI Partition} /   

If I missed anything important, just let me know.  Hope this helps someone.

----------------

Left to do: 1) bring Test-bed up to 10.5.8
               2) get cracking on my fully patched DSDT.aml for my system
               3) (hope like hell netkas can find a way around Shader issues for ATI2xxx cards. for SL)

----------------
I'm going to update the topic and the original post to SOLVED, as the answer is: nothing, but perhaps anyone looking for information on this topic can find some use in it.

S_L
Title: Re: Upgrading from v1.X to v2.x Chameleon
Post by: Distemperus on September 18, 2009, 08:16:25 AM
I put Cham v2 RC2 on the EFI partition manually (following the guides)
 [When installing, what goes where] com.apple.Boot.plist [and] smbios.plist
    On Cham v2 RC 2: in .Chameleon/Extra
I'm looking at the RC2 source in boot2/drivers.c - the LoadDrivers function. It goes:
(ramdisk)/Extra
(root_partition)/Extra
(boot_partition)/Extra/10.X
(boot_partition)/Extra

I'm not finding any .Chameleon folder - stock Chameleon 2.0 RC2 wouldn't ever find a .Chameleon/Extra folder. The word "Chameleon" isn't really part of the source code itself. And nothing changed those directories in RC3.

Are you sure about this hidden .Chameleon folder?
Title: Re: Upgrading from v1.X to v2.x Chameleon... What you need to know (SOLVED)
Post by: SunLizard on September 18, 2009, 09:49:04 PM
Disteperus,
Quote
Are you sure about this hidden .Chameleon folder?

Positive, however, since I couldn't find the actual shell script off of the iAtkos v7 disk to look at, I can't say for certain that that was a customized version of the source compiled by the iAtkos Cham section.  What did strike me as odd was that it was left intact (and I assume functional) after I changed over to RC2 manually. (I'm certain, I did't reference it in my terminal commands.)

To be completely fair, since I haven't started mucking with the system properly in earnest, I can't verify that Cham RC3 is even looking in that location for anything.

Just to recap: Cham v2 RC1 came off iAtkos install CD (no pedigree provided)
Cham v2 RC2 came off official downloads here.
Cham v2 RC3 also cam off offical downloads link.

Last point: question on your drivers.c layout. 
Quote
(boot_partition)/Extra/10.X
is the X there a coded variable or did you just shorten it for clarity's sake?

Thanks for your response.
S_L
Title: Re: Upgrading from v1.X to v2.x Chameleon... What you need to know (SOLVED)
Post by: Distemperus on September 25, 2009, 05:02:56 AM
Last point: question on your drivers.c layout. 
Quote
(boot_partition)/Extra/10.X
is the X there a coded variable or did you just shorten it for clarity's sake?
Sorry, for the delay (vacation).

The 10.X is shorthand, but it isn't too far off. drivers.c has
Code: [Select]
sprintf(dirSpecExtra, "bt(0,0)/Extra/%s/", &gMacOSVersion);which says to look at (boot partition)/Extra/SOMETHING/ where gMacOSVersion is the SOMETHING that gets inserted. Even if you didn't know where to start, you could grep for "Extra" and see what that got you. You can grep for the gMacOSVersion variable in the source code folder:
grep -e "gMacOSVersion" -r /path/to/chameleon/source
which gets:
Code: [Select]
~/Desktop/Chameleon-2.0-RC3-r658-src/i386/boot2/boot.c: strncpy(gMacOSVersion, val, MIN(len, 4));
~/Desktop/Chameleon-2.0-RC3-r658-src/i386/boot2/boot.c: gMacOSVersion[MIN(len, 4)] = '\0';
~/Desktop/Chameleon-2.0-RC3-r658-src/i386/boot2/boot.c: verbose("Loading Darwin %s\n", gMacOSVersion);
~/Desktop/Chameleon-2.0-RC3-r658-src/i386/boot2/drivers.c:extern char gMacOSVersion;
~/Desktop/Chameleon-2.0-RC3-r658-src/i386/boot2/drivers.c:   sprintf(dirSpecExtra, "bt(0,0)/Extra/%s/", &gMacOSVersion);
so hunting for gMacOSVersion in boot.c, you get:
Code: [Select]
// Find out which version mac os we're booting.
if (!loadConfigFile("System/Library/CoreServices/SystemVersion.plist", &systemVersion) )
if (getValueForKey("ProductVersion", &val, &len, &systemVersion))
{
// getValueForKey uses const char for val
// so copy it and trim
strncpy(gMacOSVersion, val, MIN(len, 4));
gMacOSVersion[MIN(len, 4)] = '\0';
}
which happens very early in the boot process. It loads /System/Library/CoreServices/SystemVersion.plist. You can see it for yourself:
open -a TextEdit /System/Library/CoreServices/SystemVersion.plist
and find the ProductVersion (say 10.5.8). The strncpy copies at most 4 characters ('1', '0', '.' & '5'). So here, gMacOSVersion = 10.5 - which is the how & why Chameleon searches for a 10.X folder.
Title: Re: Upgrading from v1.X to v2.x Chameleon... What you need to know (SOLVED)
Post by: SunLizard on September 26, 2009, 06:53:10 AM
Distemperus,

Outstanding response, thanks.

It was interesting to me as I thought, I may be having issues because I had both 10.5 and 10.6 on different HFS partitions and wondered what got looked at first....

Thanks a lot for adding the code and explaining it.

S_L
Title: Re: Upgrading from v1.X to v2.x Chameleon... What you need to know (SOLVED)
Post by: Distemperus on September 26, 2009, 12:30:40 PM
I think I found the hidden .Chameleon folder issue - and why you are seeing it. [Begin lengthy explanation]

I took a look through Chameleon-2.0-RC2-r640.pkg.zip. I used xar on the package because it doesn't have a traditional folder "Show Package" structure & the Installer build script wasn't released. But the scripts that are included shed light on this hidden .Chameleon folder you've spoken of (and I've never run into - but as I said I install manually).

(parts of scripts edited out)
Scripts.pkg/postinstall:
Code: [Select]
diskloader="boot0"
fdisk -u -f "${bootvolume}/usr/standalone/i386/${diskloader}" -y ${bootdisk}
fdisk -e ${bootdisk} <<-MAKEACTIVE

# setup link for extras
[ -h "${2}/.Chameleon" ] && unlink "${2}/.Chameleon"
echo "Executing command: ln -s . ${2}/.Chameleon"
ln -s "." "${2}/.Chameleon"

Post.pgk/postinstall:
Code: [Select]
# source com.apple.boot.plist
if ! [ -f "${2}/.Chameleon/Extra/com.apple.Boot.plist" ]; then
if [ -f "${2}/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" ]; then
cp -f "${2}/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" "${2}/.Chameleon/Extra"
fi
fi

# fix kext permissions
find "${2}/.Chameleon/Extra/Extensions" -type f -exec chmod 644 {} \;
find "${2}/.Chameleon/Extra/Extensions" -type d -exec chmod 755 {} \;
chown -R 0:0 "${2}/.Chameleon/Extra/Extensions"

# build mkext for extras
[ -d "${temp}" ] && rm -R -f "${temp}"
mkdir -p "${temp}/Extensions"
ditto --noextattr --noqtn --arch i386 "${2}/.Chameleon/Extra/Extensions" "${temp}/Extensions"
find "${temp}" -type f -exec chmod 644 {} \;
find "${temp}" -type d -exec chmod 755 {} \;
chown -R 0:0 "${temp}"
kextcache -m "${temp}/Extensions.mkext" "${temp}/Extensions"
cp -f "${temp}/Extensions.mkext" "${2}/.Chameleon/Extra"
rm -R -f "${temp}"

# remove link for extras install
unlink "${2}/.Chameleon"

So in Scripts.pkg/postinstall the fdisk being used is the stock OS fdisk, not the one Chameleon provies & installs (which goes unused). The Chameleon manual install instructions say to use it - I've always used the stock fdisk (and so apparently has the installer) - no problems on my end. And /usr/bin/standalone/i386 isn't in $PATH either (so Core.pkg seems unecessary as well). The command fdisk -f mbrtemplate file does not utilize a templatefile (which according to apple's mbr.h: MBR_CODE_SIZE 0x1B8 //=440 bytes & boot0 is 512 and not a template file).

The Scripts.pkg/postinstall works directly in the "${2}/Extra" folder, then at the end creates a symlink. I don't know where "." is , but it makes a symbolic link to $2/.Chameleon which I am guessing is on the target volume. So for an EFI install: /Volumes/EFI/.Chameleon is the symbolic link created and used in the next Post.pgk/postinstall script.

The Post.pgk/postinstall does things that I think are unnecessary: making a kextcache, copying the kextcache when the output could have been directed to the destination in the first place. The ditto --noextattr --noqtn --arch i386 only copies 32bit kexts as well (don't know why).

It would seem that the unlink "${2}/.Chameleon" isn't working for you - you shouldn't have one according to that script. In the end, you (should) have the exact same folder structure as everyone else: /Volumes/EFI/Extra. That explains how you have a .Chameleon/Extra/Extensions & Chameleon is able to find your kernel extensions - it uses the existing non-symlinked /Volumes/EFI/Extra/Extensions folder.

To summarize: if you are left with a .Chameleon folder, it is a bug in the install script. The developers have already acknowledged that the installer was imperfect and didn't release one for RC3, so hopefully they will rethink the need for a .Chameleon folder. To verify, I have:

# ls -Al /Volumes/EFI
drwxr-xr-x  7 root  admin     238 Sep  3 18:43 Extra
-rw-r--r--@ 1 root  admin  308288 Sep  3 18:35 boot

you probably have:
lrwxr-xr-x  1 root  admin       1 Sep 26 06:03 .Chameleon -> .
drwxr-xr-x  7 root  admin     238 Sep  3 18:43 Extra
-rw-r--r--@ 1 root  admin  308288 Sep  3 18:35 boot
Title: Re: Upgrading from v1.X to v2.x Chameleon... What you need to know (SOLVED)
Post by: SunLizard on September 28, 2009, 01:08:33 AM
Very similar to what you expected, however (and) of note, the Extras directory ends up in the .Chameleon directory.  That may be causing issues.

I'm going to attempt some changes in how mines laid out that will probably break some stuff tonight.

You were kind enough to go into the code for me, so I thought I'd post a screenshot of what's layout of my EFI disk

here ya go: