Author Topic: Unable to chainload from grub2 into chameleon on logical partition.  (Read 10075 times)

0 Members and 1 Guest are viewing this topic.

Jediam

  • Entrant
  • Posts: 7
I have a triple boot, win7, ubuntu, mac osx and I am trying to boot osx via grub2 and chameleon.

Set up looks like this:

Code: [Select]
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x1bed746b

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048    27123711    13560832   27  Hidden NTFS WinRE
/dev/sda2   *    27123712    27328511      102400    7  HPFS/NTFS/exFAT
/dev/sda3        27328512   320940031   146805760    7  HPFS/NTFS/exFAT
/dev/sda4       320940032   976771071   327915520    5  Extended
/dev/sda5       320942080   384086015    31571968   83  Linux
/dev/sda6       384088064   410525695    13218816   82  Linux swap / Solaris
/dev/sda7       410529792   829960191   209715200    7  HPFS/NTFS/exFAT
/dev/sda8       829962240   976771071    73404416   af  HFS / HFS+

Grub2 is installed to the mbr of the drive and it recognises the presence of osx, but the automatic entries don't work (send the harddrive a'whirring for 10s or so and then reboot).

As you can see above the boot flag is set to sda2 so that win7 can hibernate, back up etc... I have tried setting the boot flag to sda8 using gparted as well just to see what happens.

So with the following grub2 entries:

Code: [Select]
menuentry "MacOS - hd0,msdos8 - multiboot +uuid" {
insmod hfsplus
set root='(hd0,msdos8)'
search --no-floppy --fs-uuid --set=root 26d07d9c1e639221
        multiboot /boot
}

Boot flag not set: This and all the many permutations ending with "multiboot /boot" give me a black screen and the string: "wrong multiboot magic". I have to hard restart.

Boot flag set: This boots a gui of chameleon (Chimera version? as it has the tony086 logo like in unibeast). When I select the osx option, it shows the apple logo very briefly and then crashes and restarts.

Code: [Select]
menuentry "MacOS - hd0,msdos8 - chainloader" {
insmod hfsplus
set root='(hd0,msdos8)'
search --no-floppy --fs-uuid --set=root 26d07d9c1e639221
chainloader +1

}

Regardless of whether boot flag is set, this and all the many permutations ending with "chainloader +1" give me a black screen and a 7 or 8 char string of weird and wonderful characters. I have to hard restart.

Code: [Select]
menuentry "Mac OS X Boot Loader" {
        insmod hfsplus
        set root='(hd0,msdos8)'
        search --no-floppy --fs-uuid --set=root 26d07d9c1e639221
        chainloader (hd0,msdos5)/boot/chameleon/boot0md
}

I have copied the boot0, boot0hfs and boot0md to the above location on my linux drive (/boot/chameleon/boot0md) based on this post :http://jeffhoogland.blogspot.co.uk/2011/04/howto-chainload-grub2-into-chameleon.html

If boot flag is set: I get the message "boot0:error" and it freezes.
If boot flag is not set: I get the message "boot0:done" on a black screen and then windows instantly starts loading.

I thought that the problem could be that chameleon cannot find boot1h in the boot sector of the logical partition containing mac os x (hda0,msdos8)
I have installed chameleon and chimera a couple of times and manually installed the boot1h file to the bootsector of hda0,msdos8, following this post: http://www.insanelymac.com/forum/index.php?showtopic=164809
I then did it again using unibeast usb and unmounting the partition first.

I'm running out of ideas fast, so if anyone could point me in the right direction, at least on the chameleon side of things, it would be much appreciated!

dmazar

  • Member
  • Posts: 52
Re: Unable to chainload from grub2 into chameleon on logical partition.
« Reply #1 on: April 18, 2012, 10:22:25 PM »
Is this hybrid GPT disk or MBR with extended/logical partitions?
Maybe you can try with chain0 instead of boot0* if you have logical partitions.

Jediam

  • Entrant
  • Posts: 7
Re: Unable to chainload from grub2 into chameleon on logical partition.
« Reply #2 on: April 20, 2012, 12:17:13 AM »
Thanks for the reply dmazar.

Its an mbr partitioned drive with extended + logical partions. The fdisk report is in the code in my post. I patched the osx on unibeast so that it could install on mbr.

Thanks for your suggestion, you mean put the chain0 file on my linux, and chainload to that?

Do you have any idea what kind of argument I would call it with from grub2? (sorry, I know this isn't a grub2 forum!)


Jediam

  • Entrant
  • Posts: 7
Re: Unable to chainload from grub2 into chameleon on logical partition.
« Reply #3 on: April 20, 2012, 06:28:04 AM »
So I added chain0 file to /boot/chameleon/ on my linux drive and tried to boot with:

Code: [Select]
menuentry "Mac OS X Boot Loader" {
        insmod hfsplus
        set root='(hd0,msdos8)'
        search --no-floppy --fs-uuid --set=root 26d07d9c1e639221
        chainloader (hd0,msdos5)/boot/chameleon/chain0
}

This time I got chainboot error message and a black screen.

I changed the boot flag back to the windows drive and tried some of the options again and this time the multiboot entry still seemed to boot to chameleon/chimera and starts booting the apple logo screen before crashing and restarting.

Code: [Select]
menuentry "MacOS - hd0,msdos8 - multiboot +uuid" {
insmod hfsplus
set root='(hd0,msdos8)'
search --no-floppy --fs-uuid --set=root 26d07d9c1e639221
        multiboot /boot
}

This entry seems to be working the best so far, so I was wondering what multiboot /boot is doing? It's still calling chameleon isn't it? Could there be a file or some settings in my chameleon installation that I could tweak/debug?

Thx.

dmazar

  • Member
  • Posts: 52
Re: Unable to chainload from grub2 into chameleon on logical partition.
« Reply #4 on: April 20, 2012, 01:25:32 PM »
This entry seems to be working the best so far, so I was wondering what multiboot /boot is doing? It's still calling chameleon isn't it? Could there be a file or some settings in my chameleon installation that I could tweak/debug?
Sorry Jediam, I never played with grub and never played with logical partitions, so can not help more. The only thing I know (or, I think I know) is that you have two options:
1. using grub to start chain0 that should find boot1hfs on your OSX partition which would load boot from OSX partition
grub -> /boot/chameleon/chain0 -> boot1hfs installed to OSX partition -> /boot from OSX partition
I think: chain0 on the linux drive and boot1hfs in the frst 2 sectors of OSX partition and boot (main Chameleon/Chimera file) in the root of OSX partition

2. using grub to start boot through multiboot interface
grub -> multiboot /boot from OSX partition
I think: boot  in the root of OSX partition

This multiboot /boot in your example is probably that. And if it starts loading of OSX as you said, then you made this thing working.

Your next problem now is Chameleon configuration in org.chameleon.Boot.plist (GraphicsEnabler and all other stuff you need) and making OSX working. I can not help much with this. I hope somebody will.

Jediam

  • Entrant
  • Posts: 7
Re: Unable to chainload from grub2 into chameleon on logical partition.
« Reply #5 on: April 21, 2012, 05:17:53 PM »
Thanks for the pointers dmazar. I think I'll mess about with chameleon.boot.plist and see if anything works from there. The annoying thing is that my laptop crashes and reboots instantly even in verbose mode and so it is difficult to see what the final error is. I actually videoed it and tried to freeze frame and I could just make out something about:

Code: [Select]
inject_set_devprop_stringNULL trying string data
Loaded HFS+file: [Extra/smbios.plist]
...
Patched DMITable
Patched ACPI versionDSDT

Starting Darwin x86_64

Or something like that.

I've messed about a bit with the chameleon.boot.plist, made it the same as the plist on my unibeast usb, took out/added graphics enabler, some C-state stuff, Graphics display, restart, darksomething or other... a bunch of stuff but it still seems to crash in the same way.

Hopefully someone else here will have some ideas?!...  :)

Jediam

  • Entrant
  • Posts: 7
Re: Unable to chainload from grub2 into chameleon on logical partition.
« Reply #6 on: April 21, 2012, 06:40:58 PM »
Trying to hunt down any clue as to why my install crashes, I noticed that I have the message "hibernate image too old... " at the chameleon splash screen. Google told me the latest version of chimera solves this. I reinstalled chimera and now I get the "wrong multiboot magic " problem again.

Looking at the tony086 forum, it seems that chimera 1.8 and above have this "wrong multiboot magic" bug: http://www.tonymacx86.com/viewtopic.php?f=118&t=51831

Apparently I solved that problem without realizing by installing chameleon over the top of chimera at some point. It was nothing to do with the boot flag change.

I also noticed that it was you dmazar who contributed the improved multiboot support for chimera 1.7! So,

1) Thank you for that!

2) Do you know where I could get a copy of the old chimera 1.7?

3) Any chance at looking at chimera 1.9 to resolve the wrong multiboot magic problem?!!  ;D ;D

Actually I have another question as well. Given that I can boot fine from unibeast, and that unibeast uses the com.chameleon.boot.plist file on my harddrive, why does one work, and the other not?!

Basically how can I find out what unibeast is doing different to my hdd installation?

Thx again!

dmazar

  • Member
  • Posts: 52
Re: Unable to chainload from grub2 into chameleon on logical partition.
« Reply #7 on: April 21, 2012, 07:06:01 PM »
Hi again.

Did not contributed to multiboot option you are using. Just small mod to boot0h into boot0md for better support in dualboot OSX and win.

If your OSX starts loading, then your Chameleon is working. You should stick with the grub setup you discovered and that works (starts OSX loading).

If you can boot from tonymac's package unibeast, but not when you boot from your hard, then this is usually because you did not install all needed drivers to your OSX. They are present in unibeast, but not on your disk.

I guess you could ask for help about that at tonymac's site or insanelymac.com, since this sounds to me as an installation issue and not bootloader issue. You should at minimum have FakeSMC.kext in /System/Library/Extensions installed, and for the start NullCPUPowerManagement.kext. And then probably some other stuff needed for your laptop.

I hope you'll manage to resolve this soon.

Jediam

  • Entrant
  • Posts: 7
Re: Unable to chainload from grub2 into chameleon on logical partition.
« Reply #8 on: April 22, 2012, 03:36:49 AM »
Woot it boots!!!

Thanks a lot dmazar, I'd been following a guide over at tonymac's but it didn't mention fakesmc only that the plugins were optional. Anyway I installed the fakeSMC kext with multibeast, then installed chameleon with chameleon wizard, I installed boot0hfs instead of boot0md cos of what the tooltips said.

Before I had only updated chameleon so I probably had some frankenstein chimera/chameleon combo which might have caused the hibernate issues (?).

This of course destroyed grub2 on the mbr and then none of my ubuntu live cds worked so I had to redownload that, reinstall grub2, but then success!! it booted straight from the multiboot entry and this time the splash screen hid all the other unnecessary partitions as well.

Anyway I'm sure a hundred and one other problems will rear their ugly head sooner or later, but for now thanks so much, you saved me from yet another late night pulling my hair out!!  ;D

dmazar

  • Member
  • Posts: 52
Re: Unable to chainload from grub2 into chameleon on logical partition.
« Reply #9 on: April 22, 2012, 10:12:41 AM »
Great Jediam! I got the impression that you put quite amount of effort here - so you deserve to get it working.  :)