# The Ubuntu Forum Community > Ubuntu Specialised Support > Apple Hardware Users > [other] grub2 EFI boot loader internal/external booting

## pxwpxw

Grub2 Ubuntu Wiki
Good intro to the Grub2 packages current status and testing, common features for grub-pc grub-efi.
https://wiki.ubuntu.com/Grub2
https://wiki.ubuntu.com/KernelTeam/Grub2Testing

Grub wiki howto's for Apple efi
http://grub.enbug.org/TestingOnMacbook
http://grub.enbug.org/TestingOnEFI

grub2 source.
http://svn.savannah.gnu.org/viewvc/t...ub2/?root=grub

MailingLists - Grub Wiki grub-devel.
http://grub.enbug.org/MailingLists

IRC channel *#grub*


grub.efi installation booting Xserve
https://help.ubuntu.com/community/Xserve2-1
https://help.ubuntu.com/community/Xserve1-1

Ubuntu wiki page for grub.efi
https://help.ubuntu.com/community/Ma...FI-Boot-Mactel

MactelSupportTeam/CommunityHelpPages
https://wiki.ubuntu.com/MactelSuppor...unityHelpPages
------------------------------------
13 july 2009 
Bean's latest update to support later Apple Macs  EFI graphics protocol change from UGA Draw to Graphics UEFI (MBP5.2, 5.3 and others).

Source Patch at grub-devel thread 'Support graphics output protocol in EFI, Bean' 12july2009, link at post #856
Beta binary grub.efi , note fakebios --enable-rom at post #849
Check graphics protocol using' About rEFIt', post #847/8 

23 june 2099 post #772
grub-efi64.tar.gz at post #772 is a small package with a 64bit binary from the grub-efi_1.96+20090523-1ubuntu1_amd64.deb, plus example grub.cfg for an external boot.

17 june 2009 (page 77 post #766 )
Ubuntu karmic alpha has < grub-efi_1.96+20090523-1ubuntu1_amd64.deb >, which is up to SVN grub2 rev 2233 - with all the Apple Intel Mac revs from grub devs Bean and phcoder, you can install this in ubuntu and then run grub-mkimage from linux to build your grub.efi with preloaded modules.

14 may 2009 post #762
rev 2202 fat binary posted (for 64 and 32 bit efi).

24 april 2009
Xserve2,1 with 10GB RAM booting linux. post #680 patched svn grub2 rev 2121

11 april 2009
SVN grub2 rev 2074 has latest patches for Apple efi as debugged on here..

 9 april 2009
Latest grub.efi binaries at post #523, some later binaries with additional debugging output. Not finalised on grub-devel  and SVN yet.

25 march 2009

Testing svn rev 2043 starting post #483 with separate patch loadrom.diff for
imac81 x86_64 with ati radeon 2600HD and ati fglrx driver agp. (all working).

17 March2009.
Latest binary grub32 and grub64 efi at post #405
Not yet on SVN trunk

=========
This thread is a record of discussion and debugging about the grub2 grub-efi bootloader on an Apple intel mac. ( Grub2 can also be configured for pc-bios and openfirmware. ) grub.efi can boot external drives and can be installed on OSX or other HFSPlus partitons. *Requires kernel version 2.6.26 or later.*

2008 Apple intel macs changed from 32bit to 64 bit firmware. 
So there is grub.efi for 32 bit and 64 bit.

You can use it without refit, but then it must be blessed which can only be done by Macosx or the Macosx install DVD.

It is blessed using a terminal in macosx
Something like this (drag the filenames from the finder widow to the terminal window command line)

mb:~ pxw$ sudo bless --folder /Volumes/hfsp/efi/   --file /Volumes/hfsp/efi/grub/grub.efi 

Links -
GNU GRUB Wiki
http://grub.enbug.org/
TestingOnEFI
http://grub.enbug.org/TestingOnEFI
TestingOnMacbook
http://grub.enbug.org/TestingOnMacbook
Browsing the SVN Repository
http://svn.savannah.gnu.org/viewcvs/?root=grub

----------


## pxwpxw

Update - 20090409
Not necessary to blacklist agp for later MBP nvida and IMAC radeon.
grub efi boot can run agp with ATI fglrx on IMAC81 for ubuntu 810, or xorg radeon driver for ubuntu904, but only xorg fbdev for MBP nvidia.
For MacBook2,1 a special 'fix_video' hack enabled using intel_agp for intel video chip (945,965) without blacklist.
-----------

To work with the efi framebuffer efifb, 
in grub.cfg we have (example)-
 linux /vmlinuz root=/dev/sda3  video=efifb agp=off 

In ubuntu we need to disable the agp modules to access the console, and use the fbdev driver for the desktop in X.

1. blacklist agp
copy this text to a file named blacklist-agp.


```
## /etc/modprobe.d/blacklist-agp
## blacklist to disable agp for use with efifb framebuffer
## agpgart and all agp modules in ubuntu 810 i386 intrepid.
## modprobe -l *agp
## 20081129 pxw
##
blacklist agpgart
blacklist amd-k7-agp
blacklist amd64-agp
blacklist sworks-agp
blacklist ati-agp
blacklist via-agp
blacklist sis-agp
blacklist efficeon-agp
blacklist intel-agp
blacklist ali-agp
blacklist nvidia-agp
##
```

then copy it to the /etc/modprobe.d/ directory



```
$ sudo cp blacklist-agp /etc/modprobe.d/
```

To return to agp, remove this file from the /etc/modprobe.d/ directory

2. edit /etc/X11/xorg.conf to use fbdev.
Save a copy of existing xorg.conf for changing back to existing x configuration.

Here is a single Section mini xorg.conf for intrepid xubuntu on a MacBook to use the fbdev driver.

If you have an xorg.conf with Section "Device", just edit that Section  in the Driver line, leave the Identifier line as is.

/etc/X11/xorg.conf



```
Section "Device"
	Identifier	"Configured Video Device"
	Driver 		"fbdev"
EndSection
```

----------


## pxwpxw

Testing on intel mac models.

It took 3   minutes to download to Macosx desktop extract and install the grub folder in /efi with refit, change the folder name from efi to EFI, restart to refit and boot grub.efi to the grub boot menu, and from the grub menu boot back into Macosx, or reboot.

That is sufficient to show whether grub.efi runs on the mac model firmware, and should boot an i386 kernel version 2.6.26 or later (internal or external booting), graphics using the efi framebuffer. To complete this to linux text login then requires blacklisting agpgart and the agp module, xserver requires driver fbdev for the desktop.

(Similar install time without refit, blessing the EFI folder and the grub.efi file.)

Results so far for different mac models -
Test results grub-efi bootloader for apple intel mac models.

1. Mac models (Macosx menu:apple--aboutthismac--more--hardware)

Works for Mac mini (models unknown)

Works for MacBook2,1.

Does not work for MacBook3,1
Does not work for MacBook4,1

Untested for other intel mac models. 

2. Kernels (uname -r)

Works for i386 2.6.26 or later (EFI is enabled in ubuntu generic kernel)

Does not work for amd64 (loads kernel, but linux initialization fails)

----------


## pxwpxw

Test reports.

MacBook2,1 (or earlier?) i386 kernel (pxwpxw)
http://grub.enbug.org/TestingOnMacbook
-----------------
MacBook2,1 amd64 (12021)
Blessable Boot Partition
http://ubuntuforums.org/showthread.php?t=995276

gub.efi loads its full grub text menu and command line.
loads the amd64 kernel and initramfs, intscripts run. Then fails to load root, no keyboard, no logs. 
I tried an x86_64 build of grub, refit but apple efi refused to load it.
Could still be used for another i386 internal or external system on the same mac.
--------------------
Intel Mac mini - model? i386 kernel
http://grub.enbug.org/TestingOnEFI

Intel Mac mini c2d
Finally a solution to USB-booting ubuntu on a mac (Nosferax)
http://ubuntuforums.org/showthread.php?t=869324
-----------------
MacBook3,1 i386 kernel. (MackTracker)
Installing Ubuntu on Portable Hard Drive???
http://ubuntuforums.org/showthread.php?t=999892

Mac3,1 firmware will not load grub.efi. refit says unsupported.
--------------
MacBook4,1   (shadowdude1794)
Unsupported while loading grub.efi
http://ubuntuforums.org/showpost.php...38&postcount=8
--------------

----------


## shadowdude1794

I think the MacBook 4,1 should be added as unable to load grub.efi.

----------


## pxwpxw

> I think the MacBook 4,1 should be added as unable to load grub.efi.


Thanks for reporting, sorry it did not work (I take it you tried it and got nothing).

----------


## shadowdude1794

No need to be sorry, and I did. All I get is this:


```
Unsupported while loading grub.efi
```

However, I am using the rEFIt CD instead of installing it, but I don't think that would effect it. I have heard (but I'm not sure) that the 3,1 and 4,1 are similar, so they both might be effected by the same problem.

Hope this helps!

----------


## pxwpxw

Yes, thats the kiss of death. refit cd should be ok if it was going to work. It helps.

----------


## shadowdude1794

Do you know of anything that might work instead? I have frantically been trying to get my MacBook to boot from the 8gb USB stick I bought, and nothing seems to work.

----------


## pxwpxw

> Do you know of anything that might work instead? I have been franticly been trying to get my MacBook to boot from the 8gb USB stick I bought, and nothing seems to work.


No, I have not seen any alternative to grub2-efi for external booting, but there may be. There was elilo for efi but I have no info on that. The Santa Rosa 3,1 4,1 apparently have different firmware which does not accept the current grub.efi. No one has tried the later mac models versions so far. Possibly grub2 development may solve that, but coud be a while before that happens.
We could swap macbooks, I have an 8gb stick booting intrepid on the MacBook2,1.

----------


## step21

> if it shows in refit you dont need to bless. But you should check out the refit efi shell


What I thought, just wanted to clarify.




> Why cant you build your own grub.efi if necessary on a PC cross compiled, or why cant you install linux on the MacBook Air?


Mmmh, will check out the refit shell if that gives some more info.

1. The only pc I could maybe put a wubi install on (which I did last week) turned out to be a Pentium 4 model that's still 32-bit, and I couldn't find any good guides/how-tos about cross-compiling to 64-bit especially not on ubuntu(I learned that gentoo has cross-dev, but i think it's gentoo specific). I'm not allowed to partition this one, so anything else won't fly. I could install linux on the macbook air, but disk space is very tight for me, so I'd prefer to install in some kind of loop disk like wubi does, so if I need space I can transfer the disk to an external drive or something. I made a 100 MB partition now where I'd like to install grub2-pc but so far this was not succesful, as the ubuntu livecd (which runs) does not include grub2, and wireless needs the windows drivers for ndiswrapper to work, which I couldn't extract yet on my macbook air, cause trying to install grub from the livecd or something seems I inadvertedly overwrote my windows mbr or something (i.e. windows won't boot anymore), so either I have to fix this (but my windows xp cd for some reason refuses to boot) or try on another windows pc, and then transfer the files to my macbook air in some way. This might seem a little weird, but that's how it is. Also, if some dev guy makes changes, running grub-mkimage shouldn't take him long ...

----------


## step21

UPDATE: not sure if you experienced this one too, but at least on the macbook air after about 2 minutes no more input was accepted which looked like a hang/freeze. However it seems through lots of testing we were able to fix this, Vladimir Serbinenko/phcoder from #grub did the code changes, I did the testing on my macbook air.

This means that now at least I can work inside the grub shell without a time limit. Apple or legacy chainloading and linux loading do not work yet.

So, once it gets merged into grub svn, hopefully some other ppl with never macs can test it.

----------


## pxwpxw

> UPDATE: not sure if you experienced this one too, but at least on the macbook air after about 2 minutes no more input was accepted which looked like a hang/freeze. However it seems through lots of testing we were able to fix this, Vladimir Serbinenko/phcoder from #grub did the code changes, I did the testing on my macbook air.
> 
> This means that now at least I can work inside the grub shell without a time limit. Apple or legacy chainloading and linux loading do not work yet.
> 
> So, once it gets merged into grub svn, hopefully some other ppl with never macs can test it.


Yes I just saw phcoder's keyboard patch on grub-dev, well done.
Not so far a problem here, but all helps.

----------


## pxwpxw

> What I thought, just wanted to clarify.
> 
> 
> 
> Mmmh, will check out the refit shell if that gives some more info.
> 
> 1. The only pc I could maybe put a wubi install on (which I did last week) turned out to be a Pentium 4 model that's still 32-bit, and I couldn't find any good guides/how-tos about cross-compiling to 64-bit especially not on ubuntu(I learned that gentoo has cross-dev, but i think it's gentoo specific). I'm not allowed to partition this one, so anything else won't fly. I could install linux on the macbook air, but disk space is very tight for me, so I'd prefer to install in some kind of loop disk like wubi does, so if I need space I can transfer the disk to an external drive or something. I made a 100 MB partition now where I'd like to install grub2-pc but so far this was not succesful, as the ubuntu livecd (which runs) does not include grub2, and wireless needs the windows drivers for ndiswrapper to work, which I couldn't extract yet on my macbook air, cause trying to install grub from the livecd or something seems I inadvertedly overwrote my windows mbr or something (i.e. windows won't boot anymore), so either I have to fix this (but my windows xp cd for some reason refuses to boot) or try on another windows pc, and then transfer the files to my macbook air in some way. This might seem a little weird, but that's how it is. Also, if some dev guy makes changes, running grub-mkimage shouldn't take him long ...


If you install ubuntu810 i386 in wubi, I would have thought you could compile grub2  configured --with-platform=efi --target=x86_64 by simply installing build-essential bison and gcc-multilib.
Re the Macbook Air HD space you only need ~5GB for ubuntu compiling.
But I accept you have limitations there - just looking for support.
If you have any test *.efi from the devs you think worth me trying, or anything for inclusion in a grub.efi I could compile, let me know.

----------


## step21

> If you install ubuntu810 i386 in wubi, I would have thought you could compile grub2 configured --with-platform=efi --target x86_64 by simply installing build-essential bison and gcc-multilib.


 Well, afaik gcc-multilib just installs gcc and stuff? I tried on x86 but it did not want to compile for x86_64.



> Re the Macbook Air HD space you only need ~5GB for ubuntu compiling.
> But I accept you have limitations there - just looking for support.


 yeah, I have a 5 GB root disk file on my hfs+ partition. however from inside the livecd, as I said I couldn't get grub2 to install yet, so so far it's just an empty file. This is likely just a matter of time and effort (e.g. providing ndiswrapper with the wland driver, then installin grub2) so I guess this might change soonish.



> If you have any test *.efi from the devs you think worth me trying, or anything for inclusion in a grub.efi I could compile, let me know.


I attached the latest efi I have, with the fix applied. Maybe just check if it works for you, apart from this one patch there are no changes. (meaning apple loader or loading linux still doesnt't work for me)

----------


## pxwpxw

> Well, afaik gcc-multilib just installs gcc and stuff? I tried on x86 but it did not want to compile for x86_64.
>  yeah, I have a 5 GB root disk file on my hfs+ partition. however from inside the livecd, as I said I couldn't get grub2 to install yet, so so far it's just an empty file. This is likely just a matter of time and effort (e.g. providing ndiswrapper with the wland driver, then installin grub2) so I guess this might change soonish.
> 
> I attached the latest efi I have, with the fix applied. Maybe just check if it works for you, apart from this one patch there are no changes. (meaning apple loader or loading linux still doesnt't work for me)


1. compiling grub2-efi (on Imac8,1 OR Macbook2,1) 

Linux im81 2.6.27-7-generic #1 SMP Fri Oct 24 06:42:44 UTC 2008 i686 GNU/Linux
Ubuntu 8.10 intrepid (xubuntu-desktop)

Needs the base libraries and support that come with a standard i386 ubuntu810 install plus multilib for cross compile to x86_64.

The gcc libs -


```
pxw@im81:~$ aptitude search gcc | grep ^i
i   gcc                             - The GNU C compiler                        
i   gcc-4.3                         - The GNU C compiler                        
i   gcc-4.3-base                    - The GNU Compiler Collection (base package)
i A gcc-4.3-multilib                - The GNU C compiler (multilib files)       
i   gcc-multilib                    - The GNU C compiler (multilib files)       
i A lib64gcc1                       - GCC support library (64bit)               
i   libgcc1                         - GCC support library
```

All I needed to add were 
 build-essential subversion bison gcc-multilib
maybe some I missed.

2. Tried your attached grubfix_mod.efi

On imac81 (2GB RAM) works ok.
No timeout in command line grub>

 Loads vmlinuz  initrd.img
( 2.6.27-7-generic #1 SMP Fri Oct 24 06:42:44 UTC 2008 i686 GNU/Linux ) 
 Then
 grub> boot ... after < 1 sec boot screen goes to black and dies.

As before. 

I will post about this and other reports on grub-devel, its all been seen before.

----------


## [LocK]

Hi,

I'm try to run standalone linux on my MacBook 3,1 with 4GB of ram.

So i put 64bit grub.efi and config files in to \EFI\grub\, rebooted and using lastest version of rEFIt (burned on CD) booted grub.efi and get this:


```
rEFIt - Booting OS

Starting grub.efi
_
```

Does anyone manage to run grub-efi on MacBook 3,1 ?

----------


## step21

I don't know about specifics for macbook 3,1, but basicalls I'd say if you want grub to run linux, just install it with pc-grub (so that it runs in bios emulation moder) until grub has better EFI support, and especially better EFI support for macs, cause Apple sometimes implemented stuff in a non-standard way. Or is there a special reason you need/want to use EFI grub?

----------


## pxwpxw

> Will it load a CD?


Yes, CD or  the MBR i.e. using bios compatibility mode only.

----------


## pxwpxw

> Hi,
> 
> I'm try to run standalone linux on my MacBook 3,1 with 4GB of ram.
> 
> So i put 64bit grub.efi and config files in to \EFI\grub\, rebooted and using lastest version of rEFIt (burned on CD) booted grub.efi and get this:
> 
> 
> ```
> rEFIt - Booting OS
> ...


If you pull out a RAM DIMM to drop the RAM below 4GB, grub64.efi will load and load a kernel. But nobody so far has got a kernel to boot and run using grub.efi 64bit for current macs. There are also other problems,  needs some serious catch up work in grub-devel.

However, these results have been for later macbook models, yours is the first MacBook3,1 and would be good to try if you feel like reducing your ram temporarily to get another result.

see my previous post -

http://ubuntuforums.org/showpost.php...&postcount=107
grub.efi 64bit bugs.



> So there are 3 main issues -
> 
> 1. 4GB RAM is too much (until the bug is fixed)
> 2. Can not boot Mac OSX
> 3. After loading linux, linux wont boot.
> (I could load but not boot, any of the debian or ubuntu installer kernels or my installed ubuntu810 )

----------


## [LocK]

> Or is there a special reason you need/want to use EFI grub?


I want to install linux only once, and do it with out any emulation as far as it is possible. Elier I have had installed "dual booting", for single operating system (linux), under "dual bootng" I understand first boot rEFIt and secondly boot grub, on emeulated bios, as you said before. It isn't nice way ... but for now time i suppose it is only one way :/  :Sad: 




> If you pull out a RAM DIMM to drop the RAM below 4GB, grub64.efi will load and load a kernel.


Yes, after remove one of RAM DIMM grub has started, but I can't manage to boot kernel (it stats to load and stops, but I'll work on it).

Is tehere any way to enable verbose mode or debug messages when grub.efi is loading (I want to know when it stops, I think that would be helpful for grub dev team) ?

----------


## CaptainChickenpants

Hmmm, I could do with an idiots guide for this. I guess I will give it a go and try and document the steps as I go.

My initial understanding is.

1) Install refit on the mac internal drive.

2) Partition the usb drive using the Mac disk utils to create a small HFS+ Partition with GUID partitioning mode enabled.

3) Get the grub efi tarball and extract it into a folder EFI in this partition.

4) Boot the machine at the refit screen should be able to select the USB drive. Which should (all things willing) boot into the efi grub.

The following bits are where I am not as sure what to do.

5) Boot off the live CD and select advanced options for the install and tell it not to install a boot loader? Creating a 2nd partition that is ext3 for the installation.

6) After install has completed, boot into grub again and configure it to know about the new linux partition.

Does this seem about right?

At what point do I need to blacklist the agp device? Presumably once grub is installed I can load the usb installation in some kind of safe mode in order to make the blacklist changes. (Which will also involve some kind of text mode only editor bleugh!).
Would it make sense to create the blacklist config file in OSX and put it on the boot partition.

I would like to be able to use the usb stick on both Mac and normal windows machine. Would I be better using a fat32 partition to store the GRUB EFS stuff?




Cheers,
CC

----------


## [LocK]

@CaptainChickenpants: if you only want to try how grub efi works you better done it this way (it is how i play with elilo and grub-efi)
 You must have Os X installed on GUID partiton table If you have GUID partition table created by apple's disc utility you have minimum 2 partitions becouse it always create first hidden small partition for efi (it is always vfat) If you want to build on your on grub.efi you must have linux somewhere (i have 64bit gentoo under VirtualBox and i scp grub-efi data from virtual machine to localhot) On Os X termianl app mount first partion


```
moint -t msdos /dev/disk0s1 /Volumes/efi
```

 Create dir /Volumes/efi/EFI/grub and put there grub.efi (and *.mod, *.lst, grub.conf files) Download rEFIt livecd and burn it. reboot Holt down alt/option key, choose rEFIt and secondly grub/grub.efi

That procedure won't break yours exisiting system.

I'm not sure, but efi prefers boot *.efi instead of bios/mbr boot loaders. so even if you manage to install grub or lilo it won't work without rEFIt

----------


## step21

@Lock: I don't think you understand what emulation means here. It does not mean it will be slower. In fact, cause graphics acceleration won't work with EFI it's guaranteed to be faster if you install it without EFI. EFI booting simply is highly experimental at this point, not really working and there is nothing nice and clean about it.

@CaptainChickenPants: What mac model do you have? I strongly advise you to read all of the thread.

----------


## CaptainChickenpants

> @Lock: I don't think you understand what emulation means here. It does not mean it will be slower. In fact, cause graphics acceleration won't work with EFI it's guaranteed to be faster if you install it without EFI. EFI booting simply is highly experimental at this point, not really working and there is nothing nice and clean about it.
> 
> @CaptainChickenPants: What mac model do you have? I strongly advise you to read all of the thread.


Thanks,

Am at work at the moment so can't check. But I beleive it is a 2,1 Macbook. 

Will definatly be reading the whole thread in a little more detail. Just trying to boil the information down into a clean simple set of instructions. As my macbook is my only machine I will not be able to pause half-way and refer to the thread.

CC

----------


## step21

@Lock Why do you put stuff on the hidden partition? While that might not have any bad implications for now, I think it's much easier to just install refit and then put you grub.efi etc. into /EFI/* 




> I'm not sure, but efi prefers boot *.efi instead of bios/mbr boot loaders. so even if you manage to install grub or lilo it won't work without rEFIt


I'm not sure what you mean by this exactly, but know this: The firmware will only allow you to boot mbr bootloaders if they are on a seperate partition, for EFI this doesn not have to be the case. Apart from that it doesn't prefer much.

----------


## [LocK]

> I would like to be able to use the usb stick on both Mac and normal windows machine. Would I be better using a fat32 partition to store the GRUB EFS stuff?


AFAIK Apple EFI system can boot system for mbr partiotn table, so you don't have to install grub-efi or elilo or even rEFIt. It take some time to boot (using original Apple efi boot mgr) but it boot's.

AFAIR my macbook boots gentoo from mbr partion using grub but that take some time (2-3 minutes of white screen but it runs).

I personaly recommend you keep it as simple as it is possible, so better (if you want to boot yours srick on efi and bios systems) solution would be have normal MBR partion and boot system (like grub or lilo) instead of playing with efi and brub on efi and non-efi systems.

----------


## CaptainChickenpants

Hmmm,
In that case I have kind of misunderstood the point of this thread. My understanding was that to get the mac too boot from usb it was necessary to use the grub-efi. As the normal grub would be trying to use a normal PC bios.

If what you say is correct, then perhaps when I tried booting from a USB stick I simply didn't leave it long enough. I seem to recall that long boot times are sometimes associated with trying to boot from a non blessed partition. 

So you reckon, format stick with MBR partioning and just do a live-cd boot and then just do the USB install that is in the ibex system menu?

CC

----------


## pxwpxw

> Thanks,
> 
> Am at work at the moment so can't check. But I beleive it is a 2,1 Macbook. 
> 
> Will definatly be reading the whole thread in a little more detail. Just trying to boil the information down into a clean simple set of instructions. As my macbook is my only machine I will not be able to pause half-way and refer to the thread.
> 
> CC


A MacBook 2,1 is one of the lucky ones that will run grub.efi very well, the 32bit version as in the top of the thread. You just got to get it installed and configured correctly as described and use an i386 2.6.27 kernel (ubuntu 810). Whatever you do, get rEFIt installed and on a CD FIRST.

----------


## [LocK]

@step21: yes, i know that support for efi under linux is experimental but i want to try. i don't think that creating some files on hidden vfat partion could broke something. this way works elilo when you install it (i mean that elilo install script creates caltalog on hidden partition, puts thete elilo.efi, elilo.conf, boot catalog, and README.txt file  :Wink: ), so whay it could break something ?

----------


## pxwpxw

> Hmmm,
> 
> My understanding was that to get the mac too boot from usb it was necessary to use the grub-efi. As the normal grub would be trying to use a normal PC bios.
> 
> CC


That is correct. And grub.efi can be on the internal HD or on the USB.

----------


## step21

Apple firmware can boot from mbr partition




> yes, i know that support for efi under linux is experimental but i want to try. i don't think that creating some files on hidden vfat partion could broke something. this way works elilo when you install it (i mean that elilo install script creates caltalog on hidden partition, puts thete elilo.efi, elilo.conf, boot catalog, and README.txt file ), so whay it could break something ?


I don't know of anything, but why put it on a seperate partition if it just works with the os x partition?




> As my macbook is my only machine I will not be able to pause half-way and refer to the thread.


 Yeah, that's what refit is for. If you install an mbr-grub, it can't overwrite any EFI stuff anyway, so booting to os x/refit at least should not be compromised.




> AFAIK Apple EFI system can boot system for mbr partiotn table, so you don't have to install grub-efi or elilo or even rEFIt. It take some time to boot (using original Apple efi boot mgr) but it boot's.


Yes it can, in fact it's quite fast, at least for me.




> ... instead of playing with efi and brub on efi and non-efi systems.


 Yes, second that, however iirc it is not possible with the apple firmware too boot "legacy os's" (everything non-EFI) from a usb stick, only from cd or disk.

----------


## CaptainChickenpants

> A MacBook 2,1 is one of the lucky ones that will run grub.efi very well, the 32bit version as in the top of the thread. You just got to get it installed and configured correctly as described and use an i386 2.6.27 kernel (ubuntu 810). Whatever you do, get rEFIt installed and on a CD FIRST.


I have refit installed. Why do I need it on a CD? Looking through the thread I am under the impresssion that refit jiggles around the drive numbers when booted from a CD. If I wan't to be able to boot without the refit CD surely I need to be booting through the refit installed on my internal hd?

Or have I completly got the wrong end of the stick?

----------


## pxwpxw

> I have refit installed. Why do I need it on a CD? Looking through the thread I am under the impresssion that refit jiggles around the drive numbers when booted from a CD. If I wan't to be able to boot without the refit CD surely I need to be booting through the refit installed on my internal hd?
> 
> Or have I completly got the wrong end of the stick?


Yes. You install refit to the HD and use that normally for boot manager and to update (resync ) the MBR for Windows or Grub-pc.
You also make a rescue copy of refit on the CD for the times when you cant boot the HD (it happens sometimes after using the ubuntu partitioning tools ). You don't normally us the refit CD. If you have a blessed copy of grub.efi on external USB, you probably won't have those problems.

----------


## cyberdork33

> AFAIK Apple EFI system can boot system for mbr partiotn table, so you don't have to install grub-efi or elilo or even rEFIt. It take some time to boot (using original Apple efi boot mgr) but it boot's.
> 
> AFAIR my macbook boots gentoo from mbr partion using grub but that take some time (2-3 minutes of white screen but it runs).
> 
> I personaly recommend you keep it as simple as it is possible, so better (if you want to boot yours srick on efi and bios systems) solution would be have normal MBR partion and boot system (like grub or lilo) instead of playing with efi and brub on efi and non-efi systems.


The boot delay can be shortened by blessing the Linux partition as bootable.
http://ubuntuforums.org/showpost.php...8&postcount=21

----------


## pxwpxw

> @step21: yes, i know that support for efi under linux is experimental but i want to try. i don't think that creating some files on hidden vfat partion could broke something. this way works elilo when you install it (i mean that elilo install script creates caltalog on hidden partition, puts thete elilo.efi, elilo.conf, boot catalog, and README.txt file ), so whay it could break something ?


I have a grub.efi on the 200MB EFI FAT32 partition on both internal HD and external.

Then rEFIt can load grub.efi, or Mac OSX can bless it --setBoot and the Apple firmware will load grub.efi directly. This could be a way to boot a Linux only installation.
But I also have other grub.efi available, and Mac OSX installed.
The FAT32 installation can be difficult to manage unless there is an alternative boot loader or rescue CD. Mac OSX will also use the FAT32 EFI partition for firmware upgrades.

However with your MacBook 3,1 there seems to be the problem booting the linux kernel with grub.efi - the same problem with other 64bit EFI Macs, so that is the main problem you have if you want to experiment. (same as my problem on imac8,1 - it does not depend on where grub.efi is installed).

----------


## CaptainChickenpants

The USB stick has been formatted in osx with a single fat parition, using MBR partition mode.

I then booted the Intepid live CD and did a usb installation, I then put the EFI folder onto the drive,

When trying to boot directly  to the usb drive using refit without the grub-efi I get an error saying that Apple firmware has compatability problems booting legacy drives.

I can run the efi-grub fine from rEFIt. and see a bunch of menu options (list partition, search hd0 etc).

When I try and run any of the search/set options I get an error saying I need to launch the kernel first.


Examining the layout of the usb stick it looks like the path to vmlinuz is /casper/vmlinuz I can't find an initrd.img but there is a initrd.gz also in the /casper folder (prezumably this is compressed to save space on a usb stick install?).
I am wondering if with this information I can simply edit the /EFI/grub/grub.cfg.

Any suggestions how I progress this?

[edit] Ok a little more progress.
I modified the grub.cfg like so
menuentry "sdb1" {
 linux  (hd0,1)/casper/vmlinuz root=/dev/sdb1  agp=off video=efifb
 initrd  (hd0,1)/casper/initrd.gz
}

This certainly looks like it is doing linuxy stuff.
It is going through the boot process and gets as far as 

running scripts/init-bottom...
mount: mounting /root/dev on /dev/.static/dev failed no such file or directory
mount: mounting /root/dev on /dev/.static/dev failed no such file or directory
mount: mounting /proc on /root/proc failed no such file or directory
Target files system doesn't have /sbin/init
no init found try passing init= bootarg

busybox built in shell....
(initramfs)


Wondering if this is because the filesystem is maybe laid out differently because of the usb persistant storage stuff. If so how do I install on a usb drive as though it were a disk drive?

----------


## pxwpxw

CaptainChickenpants

You seem to have put a live cd on the usb stick for a persistent live usb.
I prefer a standard full installation to the usb stick (i.e. no casper) just like an install to the HD. Never bothered with the persistent live usb approach.

The kernel is linked to /vmlinuz and /initrd.img and now that you know how to boot linux, you should have no trouble if you do it that way.
That is the type of installation expected by  the sample grub.cfg.

----------


## CaptainChickenpants

> CaptainChickenpants
> 
> You seem to have put a live cd on the usb stick for a persistent live usb.
> I prefer a standard full installation to the usb stick (i.e. no casper) just like an install to the HD. Never bothered with the persistent live usb approach.
> 
> The kernel is linked to /vmlinuz and /initrd.img and now that you know how to boot linux, you should have no trouble if you do it that way.
> That is the type of installation expected by  the sample grub.cfg.


Yes that is exactly what I have done. When I try and do a straight install, then Ibex doesn't show the USB key as an option to install on.

I seem to recall when I was trying with Hardy Heron, that it would accept the key as a drive but it wants to partition it. I feel like I am frustratingly clos to having this working!

Cheers,
CC

----------


## pxwpxw

> Yes that is exactly what I have done. When I try and do a straight install, then Ibex doesn't show the USB key as an option to install on.
> 
> I seem to recall when I was trying with Hardy Heron, that it would accept the key as a drive but it wants to partition it. I feel like I am frustratingly clos to having this working!
> 
> Cheers,
> CC


Try partitioning the usb stick again using Mac OSX Disk Utility.

Select GUID partition scheme.

Make 1 small hfsplus (MacOS Extended) partition about 100MB

Make the rest MSDOS - you can delete that in the installer and then use it as ext3 root, no swap.

That may also produce an EFI FAT32 200MB in the USB as a by product - if so just leave it there, but check the partiton numbers.

Try to avoid getting grub-pc in the HD MBR - you can continue without bootloader.

After the ubuntu install, you can install the EFI/grub2 in the hfsplus partition and boot /vmlinuz /initrd.img


If the installer messes up the usb MBR, it will need the ubuntu refit gptsync utility to check and update, but I dont think it should be needed.

----------


## CaptainChickenpants

> Try partitioning the usb stick again using Mac OSX Disk Utility.
> 
> Select GUID partition scheme.
> 
> Make 1 small hfsplus (MacOS Extended) partition about 100MB
> 
> Make the rest MSDOS - you can delete that in the installer and then use it as ext3 root, no swap.
> 
> That may also produce an EFI FAT32 200MB in the USB as a by product - if so just leave it there, but check the partiton numbers.
> ...


Ok will give that a try thanks!

Do you know if I have to use Intrepid Ibex, or could I use Hardy Heron? I ask because KScope doesn't seem to work on Intrepid Ibex.

CC

----------


## pxwpxw

> Ok will give that a try thanks!
> 
> Do you know if I have to use Intrepid Ibex, or could I use Hardy Heron? I ask because KScope doesn't seem to work on Intrepid Ibex.
> 
> CC


To use grub.efi it needs kernel version 2.6.26 or later. That is ubuntu 810 ibex (2.6.27) or debian lenny (2.6.26), hardy is 2.6.24, wont work. Try 810, get it working and then see how you can tweak it, you may not have to go without agp. IDK about Kscope, maybe that can be fixed.

Scratch my comment about using refit to update usb MBR - it can only do the HD. You can do the USB mbr by installing the linux refit package, which has the gptsync utility, and can update MBR on any drive. Hopefully you wont need that at first.

I cant recall any major problems last time I did it.

----------


## CaptainChickenpants

Thanks for the help. Got it working now.

The trick to getting the installer program to recognize the USB stick as a valid install media is to leave the non-boot partition as unalloacted space.
Make sure to unmount the boot partition (this was my biggest stumbling block).
You can then just choose the guided use all free space partition mode in the installer.

Once I had it installed, it booted up fine. 
I let the system update and the system stopped booting due to the 
PCI INT A try and use pci-biosirq (can't remember the error exactly). But I stuck the acpi=force into my grub.cfg and that sorted that.

Whilst updating I seemed to get quite a few failures, which meant that updating took 5 or 6 reboots. In the end I had to remove some items and re-install them as package manager had gotten into a mess with partially installed packages.

I finally had it installed and working fine, and then started tweaking, so now I have managed to lock myself out of the installation  :Smile: 
I am not sure that my flash drive is behaving too well anyway so I will try on slightly larger portable hard drive instead, as I think some of the update issues were caused by the usb drive dropping out.

So, a final question!
I used a MBR fat partition as my boot partition as I would like to use this installation on a normal windows PC as well as my macbook. Will blessing the drive work on a non HFS drive GUID drive? I tried blessing both the efi directory and the drive itself but it didn't seem to show up in my boot menu when I started up my mac.

p.s. If I write up my experiences/issues would anyone object to me posting it to Lifehacker.com, as it would probably result in quite a number of people trying to usb boot their macs, and I wouldn't want to flood you guys with cries for help.

Cheers
CC

----------


## bean123

Please test this new version of grub.efi (64-bit), it contains new code for appleloader command to handle late 2008 modal (nv chipset).

btw, if you have 4G memory, please try t.efi and see if it hangs.

----------


## [LocK]

@bean123: on my MacBook 3,1 (with 4Gb ram) t.efi shows only (for less than second):


```
Hello World!
Hello World!
```

and go back to rEFIt menu.

----------


## cyberdork33

> Please test this new version of grub.efi (64-bit), it contains new code for appleloader command to handle late 2008 modal (nv chipset).
> 
> btw, if you have 4G memory, please try t.efi and see if it hangs.


judging from this description, it is targeted at the macbook5,1 and macbookpro5,1

----------


## pxwpxw

> Please test this new version of grub.efi (64-bit), it contains new code for appleloader command to handle late 2008 modal (nv chipset).
> 
> btw, if you have 4G memory, please try t.efi and see if it hangs.


imac8,1 ( april 2008 ) radeon HD2600 and MacBook Pro 4,1. NVidia8600,  both 2GB RAM
bean123 x86_64 test version grub.efi t.efi

0. appleloader HD or CD works (slowly) from mennuentry but not from grub> command line
(same as before)

1. grub.efi chainloader now loads Mac OSX 10.5 (very fast) using grub.cfg
(did not work before)

menuentry "MacOSX" {
	search --set /usr/standalone/i386/boot.efi
	chainloader /usr/standalone/i386/boot.efi
}

However, from the grub> command line chainloader, no errors,  but does not load MacOSX, just returns /EndEntire/filepath:..... /End Entire.
( That is the same behaviour as grub.efi x86 on MacBook2,1.)

2. t.efi flashes "Hello World" and exits.

I had tested the gnu-efi 3.0 apps (t.efi....t7.efi) on Imac8,1  amd MPP4,1
with 4GB RAM, with similar result for t.efi, some others ran partly.

3. Have not tested this grub.efi with 4GB RAM as yet.

4. From previous rev 1972, grub.efi is booting unbuntu 2.6.27 i386 kernel and displaying startup text until it hangs looping on ata4 timeout (see picture). 
To get visible text I had to change Video frame buufer settings in 
 /loader/i386/efi/linux.c: 
 grub_find_video_card and grub_linux_setup_video 
---------------

----------


## pxwpxw

> @bean123: on my MacBook 3,1 (with 4Gb ram) t.efi shows only (for less than second):
> 
> 
> ```
> Hello World!
> Hello World!
> ```
> 
> and go back to rEFIt menu.


Could you see if the bean123 grub.efi runs with your 4GB ram please? There was a problem with it just hanging for 4GB.

----------


## bean123

> imac8,1 ( april 2008 ) radeon HD2600 and MacBook Pro 4,1. NVidia8600,  both 2GB RAM
> bean123 x86_64 test version grub.efi t.efi
> 
> 0. appleloader HD or CD works (slowly) from mennuentry but not from grub> command line
> (same as before)
> 
> 1. grub.efi chainloader now loads Mac OSX 10.5 (very fast) using grub.cfg
> (did not work before)
> 
> ...


Have you forgot to use boot command at the command line ?

search --set /usr/standalone/i386/boot.efi
chainloader /usr/standalone/i386/boot.efi
boot

When used in menuentry, the boot command is appended automatically.




> 2. t.efi flashes "Hello World" and exits.
> 
> I had tested the gnu-efi 3.0 apps (t.efi....t7.efi) on Imac8,1  amd MPP4,1
> with 4GB RAM, with similar result for t.efi, some others ran partly.


Oh, gnu-efi is working, then the problem might be in the elf -> pe32+ conversion tool. I would post another testing efi later.




> 4. From previous rev 1972, grub.efi is booting unbuntu 2.6.27 i386 kernel and displaying startup text until it hangs looping on ata4 timeout (see picture). 
> To get visible text I had to change Video frame buufer settings in 
>  /loader/i386/efi/linux.c: 
>  grub_find_video_card and grub_linux_setup_video 
> ---------------


I think the problem is caused by disk parameter fields in the linux header, which is set to all zeros. Usually, kernel can figure it out itself, but it can fail in some occasion.

----------


## pxwpxw

> Have you forgot to use boot command at the command line ?
> 
> search --set /usr/standalone/i386/boot.efi
> chainloader /usr/standalone/i386/boot.efi
> boot
> 
> When used in menuentry, the boot command is appended automatically.


Yes that was it. appleloader and chainloader both boot from command line now.




> Oh, gnu-efi is working, then the problem might be in the elf -> pe32+ conversion tool. I would post another testing efi later.


Pleas do




> I think the problem is caused by disk parameter fields in the linux header, which is set to all zeros. Usually, kernel can figure it out itself, but it can fail in some occasion.


Maybe a problem with 1920x1200 and/or dedicated VRAM as on the Imac8,1 and the MBP4,1 ?

----------


## bean123

This version of grub.efi changes base address to 0x3000, please check if it solves the 4G memory issue.

----------


## pxwpxw

> This version of grub.efi changes base address to 0x3000, please check if it solves the 4G memory issue.


Nope.

Imac8,1 with 4GB RAM now.



```
rEFIt - Booting OS
Starting grub.efi
-
```

Then it hangs there, as before.

It seems odd that the rEFIt EFI shell shows the EFI Header at BFE9EF18 (full table attached) for 4GB RAM (i.e. 1GB below top), but around 7F000000 - at the top, for 2GB.  That is for both Imac and MBP.

----------


## bean123

please try these two efis in 4g memory machine.

----------


## pxwpxw

> please try these two efis in 4g memory machine.


Using refit EFI shell

Imac81 4GB RAM

fs2:\> \EFI\test\test1.efi
hello

fs2:\>
fs2:\> \EFI\test\test2.efi
-
(hangs there).

Also checked on MBP41 2GB RAM, both say hello.

----------


## bean123

> Using refit EFI shell
> 
> Imac81 4GB RAM
> 
> fs2:\> \EFI\test\test1.efi
> hello
> 
> fs2:\>
> fs2:\> \EFI\test\test12.efi
> ...


please try this one.

----------


## pxwpxw

> please try this one.




```
EFI Shell

fs2:\> \EFI\test\test3.efi
hello

fs2:\>
```

----------


## bean123

> ```
> EFI Shell
> 
> fs2:\> \EFI\test\test3.efi
> hello
> 
> fs2:\>
> ```


Please try this one.

----------


## pxwpxw

> Please try this one.


Imac8,1 4GB - YES,
 Welcome to GRUB!, grub rescue> exits normally. See pic.

----------


## bean123

> Imac8,1 4GB - YES,
>  Welcome to GRUB!, grub rescue> exits normally. See pic.


Thanks a lot for your testing, this is a full version that contains most useful commands.

----------


## pxwpxw

> Thanks a lot for your testing, this is a full version that contains most useful commands.


Will try that now, many thanks for all that, will there be a patch for the MacOSX chainloader and  this 4GB RAM fix?

----------


## pxwpxw

> Thanks a lot for your testing, this is a full version that contains most useful commands.


Full version is in trouble again, starts to the



```
  Welcome to GRUB!
 -
```

Then it hangs there. Have not yet tried on 2GB.

----------


## pxwpxw

> Full version is in trouble again, starts to the
> 
> 
> 
> ```
>   Welcome to GRUB!
>  -
> ```
> 
> Then it hangs there. Have not yet tried on 2GB.


Also  giving the original chainloader error "cannot load image"
for MacOSX, as checked with 2GB RAM on MBPro41.

----------


## bean123

Perhaps you can try this one.

It it still hangs, you can rename grub.cfg and see if it can boot to command line.

BTW, the "cannot load image" issue is compiler related ! Previously, I use gcc 4.2.3 which generate a working image. But when I switch to 4.3.2, this problem occurs. Unfortunately, the old 4.2.3 doesn't support large memory modal which is essential for the workaround on 4G memory. I'm looking at the source code more closely and try to figure it out.

----------


## pxwpxw

> Perhaps you can try this one.
> 
> It it still hangs, you can rename grub.cfg and see if it can boot to command line.
> 
> BTW, the "cannot load image" issue is compiler related ! Previously, I use gcc 4.2.3 which generate a working image. But when I switch to 4.3.2, this problem occurs. Unfortunately, the old 4.2.3 doesn't support large memory modal which is essential for the workaround on 4G memory. I'm looking at the source code more closely and try to figure it out.


Thanks, that latest grub.efi 64 is now working on 4GB Imac for linux boot.

That leaves me with the blank linux boot and init screen, and I would need to try changing the source video settings again to see the linux init text. 

The video settings shown for 4GB RAM are now


```
Video mode 1920x1200 - 32@60
Video frame buffer: d0520000    ( was 0x90520000 for 2GB RAM )
```

I expect the VFB value needs changing again.

So I cant try that until I can build with your fix for the 4GB.

I am using gcc-4.3
pxw@im81:~$ aptitude search gcc | grep ^i
i   gcc                             - The GNU C compiler                        
i   gcc-4.3                         - The GNU C compiler                        
i   gcc-4.3-base                    - The GNU Compiler Collection (base package)
i A gcc-4.3-multilib                - The GNU C compiler (multilib files)       
i   gcc-multilib                    - The GNU C compiler (multilib files)       
i A lib64gcc1                       - GCC support library (64bit)               
i   libgcc1                         - GCC support library                       
pxw@im81:~$ 

I have posted more (as 'Cros' ) about the video problem on grub-devel list in reply to you.

----------


## bean123

This is the patch file, you may need to ignore white space when applying it. After the patch is applied, run ./autogen.sh to update the makefiles.

----------


## bean123

> Perhaps you can try this one.
> BTW, the "cannot load image" issue is compiler related ! Previously, I use gcc 4.2.3 which generate a working image. But when I switch to 4.3.2, this problem occurs. Unfortunately, the old 4.2.3 doesn't support large memory modal which is essential for the workaround on 4G memory. I'm looking at the source code more closely and try to figure it out.


I've isolated this bug to the hfs+ file system driver hfsplus.mod. Perhaps it has some well hidden bug that would trigger when compiled with gcc 4.3 (it may also has problem in 4.2, but at least not so visible). I replace hfsplus.mod with the one compiled with gcc 4.2 and the problem goes away. Another method is to copy boot.efi to some other partition, like fat. Just make sure root variable is pointing to osx partition:

set root=(hd0,2)
chainloader (hd0,3)/boot.efi
boot

----------


## bean123

> The video settings shown for 4GB RAM are now
> 
> 
> ```
> Video mode 1920x1200 - 32@60
> Video frame buffer: d0520000    ( was 0x90520000 for 2GB RAM )
> ```
> 
> I expect the VFB value needs changing again.


Please try this grub.efi, which would dump extra information in the linux command.

----------


## pxwpxw

> Please try this grub.efi, which would dump extra information in the linux command.


Attached picture,thanks for patches and suggestions, working on that.

----------


## bean123

Oh, it seems the pci scan method doesn't work very well. Fortunately, there are only a few different frame buffer addresses, we can try them one by one. Currently, I check the following location:

0x40000000, 0x80000000, 0x80010000

If your model uses a different frame buffer address, please let me known.

This new version also detect line length instead of using fixed number 8192.

----------


## pxwpxw

> Oh, it seems the pci scan method doesn't work very well. Fortunately, there are only a few different frame buffer addresses, we can try them one by one. Currently, I check the following location:
> 
> 0x40000000, 0x80000000, 0x80010000
> 
> If your model uses a different frame buffer address, please let me known.
> 
> This new version also detect line length instead of using fixed number 8192.


Just about to try that, meanwhile progress report for the efi.diff and some initial fiddling with video. 

Patched rev 1996 now running on Imac81 with 4GB RAM.

pxw@im81:~/src/grub1996b$ patch  -p1 <efi.diff 
patching file conf/x86_64-efi.rmk
patching file include/grub/efi/pe32.h
patching file kern/x86_64/dl.c
patching file kern/x86_64/efi/startup.S
patching file loader/efi/appleloader.c
patching file util/i386/efi/grub-mkimage.c
pxw@im81:~/src/grub1996b$ ./autogen.sh 
pxw@im81:~/src/grub1996b/build$ ../configure --with-platform=efi --target=x86_64
... make ...
pxw@im81:~/src/grub1996b/build$ ./grub-mkimage -d . -o grub4g.efi  `cat ../../modules` 

pxw@im81:~/src/grub1996b/build$ cat ../../modules 
apple appleldr boot cat chain configfile cpio date ext2 echo fat gpt help hexdump hfs hfsplus iso9660 linux ls normal pc reboot reiserfs scsi search sleep xfs

Results -

Initially Video frame buffer d0520000, no linux video
Change to 0xc0000000, giving visible raw video

 then changed

   params->lfb_line_len = 8192;
/*pxwdebug*/   params->lfb_line_len = width*4;

giving clear linux text, horiz shifted 1/2 screen, but all readable.

----------


## pxwpxw

> Oh, it seems the pci scan method doesn't work very well. Fortunately, there are only a few different frame buffer addresses, we can try them one by one. Currently, I check the following location:
> 
> 0x40000000, 0x80000000, 0x80010000
> 
> If your model uses a different frame buffer address, please let me known.
> 
> This new version also detect line length instead of using fixed number 8192.


On the Imac81 "Can't find frame buffer address"

see pic

I will also check on the MBP.

I dont have a spec for frame buffer address, just guessing.

EDIT: same error result on MBP41  2GB ram.

----------


## bean123

> On the Imac81 "Can't find frame buffer address"
> 
> see pic
> 
> I will also check on the MBP.
> 
> I dont have a spec for frame buffer address, just guessing.
> 
> EDIT: same error result on MBP41  2GB ram.


From the previous reply #171, I guess your frame buffer address is 0xc000000, the new grub.efi add that to the list, please see if it works.

----------


## pxwpxw

> From the previous reply #171, I guess your frame buffer address is 0xc000000, the new grub.efi add that to the list, please see if it works.


Its still giving 'Can't find ......... ', and not showing any 'Video frame buffer: ..... ' line ?

(Imac81, 4GB)

EDIT: have you got a typo? c000000 ?

----------


## bean123

> Its still giving 'Can't find ......... ', and not showing any 'Video frame buffer: ..... ' line ?
> 
> (Imac81, 4GB)
> 
> EDIT: have you got a typo? c000000 ?


yeah, it's c0000000. But that's strange, if you can make it working by setting the frame buffer address to 0xc0000000, the program should be able to detect it. Perhaps you can try this one:

----------


## pxwpxw

> yeah, it's c0000000. But that's strange, if you can make it working by setting the frame buffer address to 0xc0000000, the program should be able to detect it. Perhaps you can try this one:


Yes, thats it -
v1:0 v2:131211
vfb:  0x c0010000
vll: 7600

boots to correct linux text and correct position.

Is it workable for MBP?
EDIT:

MBP41 2GB

vmode 1920x1200 32@0   yes 0
v1: ffffffff v2: ffffffff
Can't find f b addr

----------


## bean123

> Yes, thats it -
> v1:0 v2:131211
> vfb:  0x c0010000
> vll: 7600
> 
> boots to correct linux text and correct position.
> 
> Is it workable for MBP?


Ha, I'm just guessing, as you mention previously video is off by some amount, I try offset 0x10000, and it turn out to be the case.

Other model should work, providing that the frame buffer address is in the scan list.




> MBP41 2GB
> 
> vmode 1920x1200 32@0 yes 0
> v1: ffffffff v2: ffffffff


What value do you set manually to see the correct video output ?

----------


## pxwpxw

> ha, i'm just guessing, as you mention previously video is off by some amount, i try offset 0x10000, and it turn out to be the case.
> 
> Other model should work, providing that the frame buffer address is in the scan list.
> 
> 
> 
> What value do you set manually to see the correct video output ?


0x80000000

er thats for 2GB, haven't tried for 4GB on MBP yet

----------


## bean123

btw, you may be able to find the frame buffer address by looking into the kernel/x.org log file.

----------


## bean123

> 0x80000000
> 
> er thats for 2GB, haven't tried for 4GB on MBP yet


My guess is that the real value is somewhere around 0x80000000, please try this test version that scan the area for a possible match.

----------


## pxwpxw

> My guess is that the real value is somewhere around 0x80000000, please try this test version that scan the area for a possible match.


Trying now.

Meanwhile heres something -

This is the MBP41 2GB syslog but from grub-pc-bios boot, so dont know what relevance to efifb - and cannot boot fully from grub.efi just yet.
Nothing in Xorg.0.log, I think the Nvidia driver takes over.



```
[    1.486410] Write protecting the kernel read-only data: 936k
[    1.529073] vesafb: framebuffer at 0x91000000, mapped to 0xf8880000, using 1536k, total 14336k
[    1.529081] vesafb: mode is 1024x768x8, linelength=1024, pages=3
[    1.529084] vesafb: scrolling: redraw
[    1.529087] vesafb: Pseudocolor: size=8:8:8:8, shift=0:0:0:0
[    1.529219] Console: switching to colour frame buffer device 128x48
[    1.541977] fb0: VESA VGA frame buffer device
```

----------


## bean123

> Trying now.
> 
> Meanwhile heres something -
> 
> This is the MBP41 2GB syslog but from grub-pc-bios boot, so dont know what relevance to efifb - and cannot boot fully from grub.efi just yet.
> Nothing in Xorg.0.log, I think the Nvidia driver takes over.
> 
> 
> 
> ...


That's it, 0x91000000 is the magic number, this version should be working now.

----------


## pxwpxw

> That's it, 0x91000000 is the magic number, this version should be working now.


Tried both, still not  there, both similar result -



```
Video mode 1920x1200 - 32@0
i: 40000
Can't find f b.....
```

That 32@0 again.

 I should recheck and confirm the MBP manual 0x80000000 setting with the patches, not done so far. Unless you have another one to try now, I will recheck first thing tomorrow, its late here, could be making errors.

----------


## bean123

> Tried both, still not  there, both similar result -
> 
> 
> 
> ```
> Video mode 1920x1200 - 32@0
> i: 40000
> Can't find f b.....
> ```
> ...


OMG, I found a silly typo, 0x910000000. This one should really work.

----------


## pxwpxw

> OMG, I found a silly typo, 0x910000000. This one should really work.


Not yet. Still  'Can't find .... '
I added debug=linux, see picture.

The earlier grub.efi were showing correctly -
 Video mode: 1920x1200 - 32 @60
 then it went to 32@0

I am reviewing previous MBP results with manual setting video_base , and will try get some debugging from the iteration, and with rev 1996 + efi.diff - lot of changes there, noted that some differ for MBP v/s IMAC. 

Previously  MBP wanted line_length left at 8192.

If the VFB is at 0x91000000 then it would have to be virtual and/or in VRAM when there is only 2GB RAM - I don't know how that works.

Also need to check the IMAC81 with 2GB RAM.

Will post when I have something useful.

----------


## bean123

> Not yet. Still  'Can't find .... '
> I added debug=linux, see picture.
> 
> The earlier grub.efi were showing correctly -
>  Video mode: 1920x1200 - 32 @60
>  then it went to 32@0
> 
> I am reviewing previous MBP results with manual setting video_base , and will try get some debugging from the iteration, and with rev 1996 + efi.diff - lot of changes there, noted that some differ for MBP v/s IMAC. 
> 
> ...


Frame buffer can be mapped to any address inside 4G, it's not related to the available memory. In fact, it's usually mapped to address above the physical memory limit to avoid conflict.

Perhaps you can try to set the address manually and see when the video is displayed correctly, here is a list:

0x80000000, 0x80010000, 0x80100000, 0x81000000,
0x90000000, 0x90010000, 0x90100000, 0x91000000

----------


## pxwpxw

> Frame buffer can be mapped to any address inside 4G, it's not related to the available memory. In fact, it's usually mapped to address above the physical memory limit to avoid conflict.
> 
> Perhaps you can try to set the address manually and see when the video is displayed correctly, here is a list:
> 
> 0x80000000, 0x80010000, 0x80100000, 0x81000000,
> 0x90000000, 0x90010000, 0x90100000, 0x91000000


Yes, I have rev 1996 (unpatched) running, iteration finds 0x90000000,
that gives undecoded video, overriding video_base to 0x80000000 gives linux full screen good text. Just about to check some other numbers as you suggest. (MBP41 2GB)

----------


## bean123

> Yes, I have rev 1996 (unpatched) running, iteration finds 0x90000000,
> that gives undecoded video, overriding video_base to 0x80000000 gives linux full screen good text. Just about to check some other numbers as you suggest. (MBP41 2GB)


This grub.efi adds it to the scan list, hopefully it will detect the frame buffer.

----------


## pxwpxw

> This grub.efi adds it to the scan list, hopefully it will detect the frame buffer.


Try that now, heres result for some others -

checked for linux startup text on mbp41 with 2GB ram grub2 rev1996

correct text display
80000000, 80010000

scrambled text (dots) in full screen
90000000, 90010000

nothing (black)
c0010000

----------


## pxwpxw

> This grub.efi adds it to the scan list, hopefully it will detect the frame buffer.


No, still Cant find---

I note that my grub2 r 1996 is now returning 
Video mode 1920x1200 - 32@0

Does this mean there is bug in efi_call_5 (....  &rate) ? 



```
static int
grub_linux_setup_video (struct linux_kernel_params *params)
{
  grub_efi_uga_draw_protocol_t *c;
  grub_uint32_t width, height, depth, rate;

  c = grub_efi_locate_protocol (&uga_draw_guid, 0);
  if (! c)
    return 1;

  if (efi_call_5 (c->get_mode, c, &width, &height, &depth, &rate))
    return 1;

  grub_printf ("Video mode: %ux%u-%u@%u\n", width, height, depth, rate);
```

----------


## bean123

> No, still Cant find---
> 
> I note that my grub2 r 1996 is now returning 
> Video mode 1920x1200 - 32@0
> 
> Does this mean there is bug in efi_call_5 (....  &rate) ? 
> 
> 
> 
> ...


efi_call_5 seems ok, however, I do find issue in efi_call_6. After fixing it, grub.efi can now chainloader osx without error. What a catch !

----------


## pxwpxw

27 Nov 2009.
Menu posts on this thread are now out of date, a lot more has been done -
You should see the current latest links in particular burg-devel for up to date menu examples and discussion, all listed on 
Fancy menu for GRUB EFI
http://ubuntuforums.org/showthread.php?t=1248647

----------


## TheW4rden

Hi,

I have skimmed through this thread and have played with the compiled grub64.efi samples provided. 

In summary am I right in thinking that on a MBP4.1 (EFI1.1) there is still no way to get the nvidia drivers working but on a MBP5.1 (UEFI2) it is possible (with fakebios)? I have only tried a MBP4.1 so far and can boot Linux off a USB stick and have the efifb working but as soon as X tries to start I get:

NVRM: failed to copy vbios to system memory.
NVRM: RmInitAdapter failed! (0x30:0xffffffff:909)
NVRM: rm_init_adapter(0) failed

Is this something that is being worked on or is it simply not possible to get it working for the older EFI1.1 Macs? Does anyone know if it works under ELILO?

Keep up the amazing work done so far!

----------


## sroecker

Just noticed, if you want to boot lucid you need to change initrd.gz to initrd.lz in grub.cfg.

----------


## robyz80s

Hi all

i have a mbp 5,3 and i compiled grub2 with --with-platform=efi --target=x86_64. As primary bootloader i use refit. I executed grub_install with disk0s1 mounted (EFI partition) and i moved the directory grub2 in EFI. This the relevant portion of grub.cfg: 

menuentry "GNU/Linux, with Linux 2.6.32.2" {
        insmod ext2
        fakebios
        set root=(hd0,3)
        search --no-floppy --fs-uuid --set a36c5327-bf7d-49a3-81fa-774bb8e422e0
        linux   /vmlinuz-2.6.32.2 root=/dev/sda4 ro agp=off video=efifb
        initrd  /initramfs-2.6.32.2.img
}

Refit sucessfully detected grub.efi and then i executed grub2 and i selected from the menu the entry. But after grub2 displayed the two lines relative to the loading of the kernel and the initrd, nothing happened. What's wrong?
Thanks in advance for replies

----------


## robyz80s

OK, i followed the instructions in past posts, i tried the grub64.efi in the post #844 and it worked.
Now the boot process hangs when mounting the root device. First, i cannot see any message from the initrd (i suspect it never be executed). I have compiled built-in all required modules and the root cannot get mounted. The last message is the list of the partitions of my disk with a strange numeration: 0801 for sda1, 0802 for sda2 etc... Does it depend from grub2 and do i need to insert extra modules?

----------


## robyz80s

I tried both ubuntu and fedora, with different kernel versions/config.
There's always one issue:

[    1.279579] RAMDISK: Couldn't find valid RAM disk image starting at 0.

Fedora cannot proceed because it's unable to find the console. Ubuntu works.
How to solve the problem with the initramfs?

----------


## TheW4rden

> NVRM: failed to copy vbios to system memory.
> NVRM: RmInitAdapter failed! (0x30:0xffffffff:909)
> NVRM: rm_init_adapter(0) failed
> 
> Is this something that is being worked on or is it simply not possible to get it working for the older EFI1.1 Macs? Does anyone know if it works under ELILO?


Just to follow up. I can get the Nvidia card working on a MBP5.4 (EFI2.0) but not on the MBP4.1 (EFI1.1). This is with the same USB stick/grub2/kernel. Also kernels > 2.6.30 give the "failed to find valid ramdisk" error on my MBP5.4 but not on a MBP4.1. Linux 2.6.30 boots fine on both. This may or may not be related to:

http://bugzilla.kernel.org/show_bug.cgi?id=14658

----------


## toxicer

I am trying to get an actual Mac Mini (3,1) installed using an usb stick.
This is my grub.conf:

menuviewer="text"

timeout=20
default=0

set F1=ctrl-x

set color_normal=yellow/red

menuentry "A ubuntu-9.10-desktop-i386.iso " {
 fakebios
 set root=(hd0,1)
 search --set -f /ubuntu-9.10-desktop-i386.iso
 loopback loop /ubuntu-9.10-desktop-i386.iso
 linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/ubuntu-9.10-desktop-i386.iso noefi fbdev video=efifb
 initrd (loop)/casper/initrd.lz
}
menuentry "B ubuntu-9.10-desktop-i386.iso fbdev " {
 fakebios
 search --set -f /ubuntu-9.10-desktop-i386.iso
 loopback loop /ubuntu-9.10-desktop-i386.iso
 linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/ubuntu-9.10-desktop-i386.iso video=efifb fbdev noefi single
 initrd (loop)/casper/initrd.lz
}
menuentry "xubuntu-9.10-desktop-i386.iso" {
	fakebios
	set root=(hd0,1)
	loopback loop /ubuntu-9.10-desktop-i386.iso
	linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/ubuntu-9.10-desktop-i386.iso noefi video=efifb --
	initrd (loop)/casper/initrd.lz
}

I can load grub2 and make my selection but after some EXT4-fs related outputs on the screen I am dropped into BusyBox together with an error message starting with:
(initramfs) Could not find the ISO /ubuntu-9.10-desktop-i386.iso....
The iso is located in the root of the usb stick. At this time the Mac doesn't react on any inputs anymore.
Any ideas?

----------


## TheW4rden

> [    1.279579] RAMDISK: Couldn't find valid RAM disk image starting at 0.


This can be fixed by reverting this patch:

http://git.kernel.org/?p=linux/kerne...96db05202a12fe

----------


## robyz80s

Ok, thanks. Works fine with the latest stable kernel 2.6.32.4. Still problem with the DMI (when booting in efi native mode) and the nvidia backlight. I tried the instructions in the post #398, and prompting the command loadbios /boot/bios.bin seems to work. But after the shutdown of the machine this file is no longer valid and i need to regenerate it another time. When the bios informations are correctly loaded, either pommed or the mbp_nvidia_bl module don't work. I also tried to modify the kernel module (by adding Macbook Pro 5,3) in the identification string list but no success. Does someone has knowledge of a solution? Thanks

----------


## bdkoepke

I'm just sort of curious whether anyone actually successfully boots efi with a macbook pro 3,1 (nvidia 8600GT). I am able to boot efi fine, and load X11 with the fbdev driver, but I would like to have accelerated graphics. Currently I am using a custom grub-efi-amd64 from this ppa: fzielcke/grub that I built myself by running: 
apt-get build-dep grub-efi-amd64 && apt-get source grub-efi-amd64 && cd $SOURCEDIR && ./configure --target=x86_64 --with-platform=efi && make && checkinstall -D

I am able to get efi to load, and can boot into the kernel fine, but nothing I have tried has made any difference. 

(I tried this two years ago on a gentoo system, right when grub.efi was first starting, and was able to get accelerated nvidia, but I was unable to get the mb_nvidia_bl driver to work, so I gave up). 

The boot options I have tried include: 

loadbios /vbios.bin /int10.bin (also tried with agp=off)
loadbios /bios.bin (also tried with agp=off)
fakebios (with noefi, agp=off)

I'm not really sure where to go from here. 

Just as a side note, I was able to get nvidia-glx-173 to work, but the screen backlight turns off completely so I can't see anything. (The driver obviously loads, but I'm not sure what happens after that). 

The driver I am currently using is nvidia-glx-195, but I also tried nvidia-glx-185. 

Any word on this would be grealy appreciated.

----------


## tonymartin

One day I decided to install ubuntu linux 7.1 from the Linux Starter Kit DVD104 I got from the Linux Format magazine.

  I am very familiar with the old linux, going al the way back to 1995 with Infomagic, Slackware and Red Hat distros.

  I just upgraded the HD in my Macbook Pro 17 to 500 GB and dual boot Mac OS X and Windows XP. 

  The install of ubuntu was very easy. I noticed a customize | advance option where I could turn OFF the lilo boot loader. So I thought to myself I dont want that, I prefer the Max OS X default boot method, so I turned off using the lilo bootloader.

  OK, Im going to omit the lengthy description of how the MBR got screwed up and rendered my boot camp partition unbootable, thanks to unbuntu, and that it took rEFIt to fix the MBR to regain bootability of Windows.

      At this point I can dual boot OS X and Windows as before ubuntu installation. I removed rEFIt (nice tool, but prefer the standard Mac boot scheme). 


I CAN boot the ubuntu installation using the Parted Magic  CD I created from the partedMagic4.8.ISO image I downloaded. I do that by booting the CD and selecting the *Super Grub Disk 2* option on one of the sub menus. Selecting that option gives me the ability to boot ubuntu off my HD.

  THE QUESTION is how can I install the grub(2?) loader onto the ubuntu partition to boot it? Im not familiar with grub at all. I did find an excellent page on triple booting Macbooks at the onmac.net wiki titled Tripple boot via bootcamp ubuntu. It described several techniques, the one I favored is to boot NTLDR and select ubuntu. It copies the MBR from the ubuntu partition onto the windows partition  and adds and entry to the windows boot.ini for it.

  The problem is there is no boot loader on that partition (remember I skipped lilo with the ubuntu installation).

  So how do I get a boot loader installed on the ubuntu partition? I would like to duplicate the parted magic Super grub2 boot process and I think all I need is to get the boot loader on the ubuntu partition.

  I have all the Op Systems installed and working, its just a matter of how to boot the ubuntu OS through Windows.

----------


## tonymartin

Here's what I did for a tripple boot setup. I went through alot of trials and I'm not sure if the order is important. Here is the setup I now have and it works for me on my Macbook Pro 1,2. But as they say, "your mileage may vary" :).

I have a 500GB disk partitioned like this:



```
   
   1              40          409639   200.0 MiB   EF00  EFI System Partition
   2          409640       251281447   119.6 GiB   AF00  Apple_HFS_Untitled_1
   3       251543592       670187559   199.6 GiB   AF00  Apple_HFS_Untitled_2
   4       670449704       879902759   99.9 GiB    0700  Windows XP
   5       958028994       976773134   8.9 GiB     8200  Ubuntu Swap
   6       879902760       958027760   37.3 GiB    0700  Ubuntu 7.10
```

I use 2 partitions for OS X. Using the gdisk on the Parted Magic CD (version 4.8 ), I created a hybrid MBR:



```
   
Number   Boot    Start (sector)  Length (sectors)       Type
   1                        1            409639         0xEE
   2                   409640         250871808         0xAF
   3                879902760          78125001         0x83
   4       *        670449704         209453056         0x07
```

Now I can tell you that when I partitioned the 500GB I used the GUI disk utility on Max OS X, and left 50GB unallocated. After OS X and Windows XP were setup on a Boot Camp scheme I decided to install Ubuntu 7.10 from the Linux Format Magazine DVD. I installed it running Windows XP. I DID NOT install a boot loader, thinking it would screw up my Mac OS X booting. That was before I knew anything about EFI booting. 

I found rEFIt, Parted Magic, gdisk, etc and various posts about triple booting Macbooks. I like rEFIt but for 2 reasons don't use it: 1) it interferes with Macbook updates, 2) it cannot be configured like lilo, grub or grub2 can be, at least not yet (I am using v0.12). I may go with rEFIt in the future however, as it looks like it will be the prefered way to boot EFI systems. The current version doesn't allow me to specify the boot rules for my setup. It didn't recognize my Ubuntu installation on partition 6 until I installed lilo. Plus, I kindof like to have the Linux OS hidden. So chainloading it from Windows XP is the setup I use. 

Using the Parted Magic CD, I copied the lilo files and shared libs it requires and the  Super Grub2 file sgd2.gz to the Ubuntu partition from the Parted Magic CD. Then I booted Ubuntu using the "Super Grub2 Disk" option under the "Other Features" menu. 

I then created a /etc/lilo.conf":


```
# Global LILO settings
boot=/dev/sda6                            
timeout=0              
default=SuperGrub2

# Kernel specific LILO settings

image=/boot/vmlinuz-2.6.22-14-generic
append="figure out kernel command line to set proper root"
label=Ubuntu

# This loads the grub2 boot loader to boot Ubuntu. Eliminate when above is figured out 
image=/boot/syslinux/memdisk initrd=/boot/sgd/sgd2.gz
label=SuperGrub2
```

I didn't have the manpage for lilo.conf, and I couldn't figure out how to set the root, (I  don't have Internet at the house!) so booting Ubuntu directly always caused a kernel panic when it failed to mount the root fs. 

I then wrote the lilo boot sector to /dev/sda6 using:

lilo -v -P ignore

Then I copied the boot sector over to my Windows XP C:

dd if=/dev/sda6 of=/media/DOS_FAT_32_Untitled_3/sda6MBR.bin bs=512 count=1

The last step was to change the Windows boot.ini to chainload to the Ubuntu partition:



```
   
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(4)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(4)\WINDOWS="Windows XP SP3" /noexecute=optin /fastdetect
C:\sda6MBR.bin="Ubuntu Linux 7.10"
```

And thats it. Ubuntu is booted through the "Windows" boot camp partition.

----------


## bopher

Hello Sir,


Good Day,





> Your right, the EFI on Xserves is particularly limiting in what it allows to boot. The easiest way round this is to use rEFIt software which gives you a nice configurable GUI to use on boot. In my testing I was using a USB stick + rEFIt software for convenience.
> 
> 
> 
> I'm sorry but this isn't true, it works just fine  (I can provide a video to prove if you like?)
> 
> D4T



Can you please send me the USB Stick  + reFit ( Files and configurations) and also the video ?

Thanks

Christopher

----------


## Lokesh123

Many informations, very challenging....
I have an iMac51, believed it is a 64 bit by definition, though no longer sure after this thread.

I want to install Linux on a firewire drive and boot into it after pressing the alt key at startup. The internal should house my OSX 10.4.11 (Tiger).

What is the latest version of grub*.efi, grub.cfg and possibly xorg.conf to use to get it working? Is rEFIt mandatory to get it running?

Any insight is appreciated, I am not an expert and suffer from headaches after a week of extensive search.

Lokesh

----------


## uebermodean

Hi,

I am trying to boot Ubuntu Server 9.10 on an Xserve 3.1 model (model-info.jpg) using rEFIt plus grub2. Grub2 bails out with a "can't frame buffer address" message (grub2-boot.jpg). The Xserve uses an Nvidia GeForce GT 120 device (nvidia-info.jpg).

This is my grub.cfg menu entry:



```
menuentry "Ubuntu Server 9.10 installer cd" {
        fakebios
        root=cd0
        linux /install/vmlinuz video=efifb
        initrd /install/initrd.gz
}
```

Can somebody provide me some pointers on how to overcome the "can't frame buffer address" message?

Thanks!

Daniel

EDIT:

Used grub2 from post #405 and a manually compiled grub 1.97.2.

----------


## binary10

I'm pretty much in the same boat with a iMac i7 , ATI HD4850


I'm getting the 'can't frame buffer address' message, when booting usb stick with efi mods.

I'll try some more settings just thought I'd add my current status.

Has anyone got the iMac i7 booting ubuntu off a external disk?

----------


## uebermodean

Actually I've been told on the grub IRC channel at freenode to use grub2-experimental. But the last time I compiled grub2-experimental, grub-mkimage bailed out with a symbol not found...

Cheers
Daniel

----------


## binary10

One thing I noticed about it booting was after it had loaded initrd it just seemed to switch off (and never re-lite) the usb hub that the external drive / stick was plugged in. 

Also my iMac i7 just doesn't like lucid lynx release alpha 3. While it quite happily boot the cd of 9.04 and 9.10 with 10.04a3 it would start to boot the CD (click on 'try') start loading the kernel and then go to a blank screen. I'm hoping that Beta1 this week change something :s.

----------


## bean123

> Hi,
> 
> I am trying to boot Ubuntu Server 9.10 on an Xserve 3.1 model (model-info.jpg) using rEFIt plus grub2. Grub2 bails out with a "can't frame buffer address" message (grub2-boot.jpg). The Xserve uses an Nvidia GeForce GT 120 device (nvidia-info.jpg).
> 
> This is my grub.cfg menu entry:
> 
> 
> 
> ```
> ...


Try this one. It's compiled with burg, the configure file should be named burg.cfg.

----------


## binary10

Has anyone been able to boot their i7 iMac 11,1 (ATI Radeon HD 4850) using this external method ? 

I'm stuck where it loads the files from the usb and still bails out in grub with the 'framebuffer address' problem.

I can boot the ubuntu lucid install CD with boot options:

  radeon.modeset=0 nomodeset

Do all the install stuff to the external usb stick, then after booting off of its EFI boot loader and grub2 on the external stick I just get the small window and the 'framebuffer' problem.

My efi grub entry (/efi/boot/grub.cfg) looks like this:


```
menuentry "MAC Ubuntu, with Linux 2.6.32-19-generic" {
        search --set /grub/grub.cfg
	insmod ext2
	linux	/vmlinuz-2.6.32-19-generic root=UUID=dbe5a02f-8f32-44f2-9d26-684188cc0e3c ro   quiet radeon.modeset=0 nomodeset splash
	initrd	/initrd.img-2.6.32-19-generic
}
```

Any ideas? I just want to my mac ubuntu build portable like my intel laptop ubuntu build.

----------


## krazyd

I've been trying to install grub2 to an EFI partition on my HP elitebook. Has anyone done this who can give me some instructions? Thanks!

----------


## bean123

> Has anyone been able to boot their i7 iMac 11,1 (ATI Radeon HD 4850) using this external method ? 
> 
> I'm stuck where it loads the files from the usb and still bails out in grub with the 'framebuffer address' problem.
> 
> I can boot the ubuntu lucid install CD with boot options:
> 
>   radeon.modeset=0 nomodeset
> 
> Do all the install stuff to the external usb stick, then after booting off of its EFI boot loader and grub2 on the external stick I just get the small window and the 'framebuffer' problem.
> ...


Have you tried my BURG version, does it have the same problem ?

----------


## bean123

> I've been trying to install grub2 to an EFI partition on my HP elitebook. Has anyone done this who can give me some instructions? Thanks!


I have tested BURG on HP ProBook, it works. BTW, this wiki have some tips on installing Windows 7, OSX, Ubuntu Lucid and FreeBSD 8 using UEFI/Apple EFI:

http://code.google.com/p/burg/wiki/QuadBoot

----------


## binary10

> I have tested BURG on HP ProBook, it works. BTW, this wiki have some tips on installing Windows 7, OSX, Ubuntu Lucid and FreeBSD 8 using UEFI/Apple EFI:
> 
> http://code.google.com/p/burg/wiki/QuadBoot


Thanks bean123 - I'll give it a go later on when the hurdle of lucid final is out.

----------


## bfroemel

Hey there,

new model - hopefully old problems.

I tried several of the recently posted grub EFI applications here - nothing worked at all. Finally, I could make some progress by using the stock grub as shipped with Lucid:


```
grub-mkimage -o grub.efi part_gpt hfsplus fat ext2 normal sh chain boot configfile linux videotest loadenv search lvm help lspci datetime loadenv efi_gop loadbios appleldr ls acpi
```

Unfortunately the boot process hangs very early if 'noefi' is not supplied to the kernel - I have no means of finding out how and why: the framebuffer isn't available that early. I don't have one of those USB debug key for early printks pushed over USB EHCI.

When not using the kernel EFI services (noefi), a 2.6.34-rc6 kernel boots with framebuffer (and luckily netconsole) to the point where it expects a root device. Still, ACPI and DMI seem to be messed up and so most of the devices (incl. the SATA controller) just aren't detected (regardless of acpi=force). I tested with fakebios and with loadbios: no difference.

Any hints are very much appreciated!

----------


## bfroemel

I can boot into a shell now - it's been again ''efi_enter_virtual_mode'' that's causing the grief. I didn't debug further, but at least ACPI + DMI is working properly when I disable EFI right before that call in init/main.c (may break other things...).

I can see both graphcis adapters now (lspci). The discrete Nvidia seems to be still the active one. Unfortunately the 195.36.15 driver is not able to work with the current setup:




```
(--) PCI:*(0:0:2:0) 8086:0046:0000:0000 Intel Corporation Core Processor Integrated Graphics Controller rev 18, Mem @ 0xc1400000/4194304, 0xb0000000/268435456, I/O @ 0x00003130/8
(--) PCI: (0:1:0:0) 10de:0a29:106b:00c7 nVidia Corporation rev 162, Mem @ 0xc0000000/16777216, 0x90000000/268435456, 0xa0000000/33554432, I/O @ 0x00002000/128, BIOS @ 0x????????/524288
(II) Open ACPI successful (/var/run/acpid.socket)
(II) "extmod" will be loaded by default.
(II) "dbe" will be loaded by default.
(II) "glx" will be loaded. This was enabled by default and also specified in the config file.
(II) "record" will be loaded by default.
(II) "dri" will be loaded by default.
(II) "dri2" will be loaded by default.
(II) LoadModule: "glx"
(II) Loading /usr/lib/xorg/extra-modules/libglx.so
(II) Module glx: vendor="NVIDIA Corporation"
        compiled for 4.0.2, module version = 1.0.0
        Module class: X.Org Server Extension
(II) NVIDIA GLX Module  195.36.15  Fri Mar 12 01:17:05 PST 2010
(II) Loading extension GLX
(II) LoadModule: "extmod"
(II) Loading /usr/lib/xorg/modules/extensions/libextmod.so
(II) Module extmod: vendor="X.Org Foundation"
        compiled for 1.7.6, module version = 1.0.0
        Module class: X.Org Server Extension
        ABI class: X.Org Server Extension, version 2.0
(II) Loading extension MIT-SCREEN-SAVER
(II) Loading extension XFree86-VidModeExtension
(II) Loading extension XFree86-DGA
(II) Loading extension DPMS
(II) Loading extension XVideo
(II) Loading extension XVideo-MotionCompensation
(II) Loading extension X-Resource
(II) LoadModule: "dbe"
(II) Loading /usr/lib/xorg/modules/extensions/libdbe.so
(II) Module dbe: vendor="X.Org Foundation"
        compiled for 1.7.6, module version = 1.0.0
        Module class: X.Org Server Extension
        ABI class: X.Org Server Extension, version 2.0
(II) Loading extension DOUBLE-BUFFER
(II) LoadModule: "record"
(II) Loading /usr/lib/xorg/modules/extensions/librecord.so
(II) Module record: vendor="X.Org Foundation"
        compiled for 1.7.6, module version = 1.13.0
        Module class: X.Org Server Extension
        ABI class: X.Org Server Extension, version 2.0
(II) Loading extension RECORD
(II) LoadModule: "dri"
(II) Loading /usr/lib/xorg/modules/extensions/libdri.so
(II) Module dri: vendor="X.Org Foundation"
        compiled for 1.7.6, module version = 1.0.0
        ABI class: X.Org Server Extension, version 2.0
(II) Loading extension XFree86-DRI
(II) LoadModule: "dri2"
(II) Loading /usr/lib/xorg/modules/extensions/libdri2.so
(II) Module dri2: vendor="X.Org Foundation"
        compiled for 1.7.6, module version = 1.1.0
        ABI class: X.Org Server Extension, version 2.0
(II) Loading extension DRI2
(II) LoadModule: "nvidia"
(II) Loading /usr/lib/xorg/extra-modules/nvidia_drv.so
(II) Module nvidia: vendor="NVIDIA Corporation"
        compiled for 4.0.2, module version = 1.0.0
        Module class: X.Org Video Driver
(II) NVIDIA dlloader X Driver  195.36.15  Fri Mar 12 00:38:50 PST 2010
(II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
(II) Primary Device is: PCI 00@00:02:0
(II) Loading sub module "fb"
(II) LoadModule: "fb"
(II) Loading /usr/lib/xorg/modules/libfb.so
(II) Module fb: vendor="X.Org Foundation"
        compiled for 1.7.6, module version = 1.0.0
        ABI class: X.Org ANSI C Emulation, version 0.4
(II) Loading sub module "wfb"
(II) LoadModule: "wfb"
(II) Loading /usr/lib/xorg/modules/libwfb.so
(II) Module wfb: vendor="X.Org Foundation"
        compiled for 1.7.6, module version = 1.0.0
        ABI class: X.Org ANSI C Emulation, version 0.4
(II) Loading sub module "ramdac"
(II) LoadModule: "ramdac"
(II) Module "ramdac" already built-in
(II) NVIDIA(0): Creating default Display subsection in Screen section
        "Default Screen" for depth/fbbpp 24/32
(**) NVIDIA(0): Depth 24, (--) framebuffer bpp 32
(==) NVIDIA(0): RGB weight 888
(==) NVIDIA(0): Default visual is TrueColor
(==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)
(**) NVIDIA(0): Option "NoLogo" "True"
(**) NVIDIA(0): Option "RegistryDwords" "PowerMizerEnable=0x1; PerfLevelSrc=0x2222; PowerMizerLevel=0x3; PowerMizerDefaultAC=0x3"
(**) NVIDIA(0): Option "Coolbits" "1"
(**) May 10 15:47:17 NVIDIA(0): Enabling RENDER acceleration
(II) May 10 15:47:17 NVIDIA(0): Support for GLX with the Damage and Composite X extensions is
(II) May 10 15:47:17 NVIDIA(0):     enabled.
(EE) May 10 15:47:17 NVIDIA(0): Failed to initialize the display subsystem for the NVIDIA
(EE) May 10 15:47:17 NVIDIA(0):     graphics device!
(EE) May 10 15:47:17 NVIDIA(0): Failed to determine chip display capabilities
(EE) May 10 15:47:17 NVIDIA(GPU-0): Failed to get supported display device(s)
(EE) May 10 15:47:17 NVIDIA(0): Failed to initialize dac HAL
(II) UnloadModule: "nvidia"
(II) UnloadModule: "wfb"
(II) UnloadModule: "fb"
(EE) Screen(s) found, but none have a usable configuration.

Fatal server error:
no screens found

Please consult the The X.Org Foundation support
         at http://wiki.x.org
 for help.
Please also check the log file at "/var/log/Xorg.0.log" for additional information.
```

Next step is to further debug and fix ''efi_enter_virtual_mode'' so that this EFI stuff is certainly not interfering. Then I experiment some more with the Nvidia card.

----------


## engelsma

> Try this one. It's compiled with burg, the configure file should be named burg.cfg.


I've tried the burg from this post (#1110) on an Xserve 3,1 with the Ubuntu Server 10.04 CD... using the following menuentry, i get the output shown in the attached screenshot.

menuentry "Ubuntu Server 10.04 installer cd" {
        fakebios
        root=cd0
        linux /install/vmlinuz video=efifb nomodeset
        initrd /install/initrd.gz
}


From what I can tell, the kernel loads successfully as well as the initrd.gz. However, the system hangs here...

----------


## bean123

> I've tried the burg from this post (#1110) on an Xserve 3,1 with the Ubuntu Server 10.04 CD... using the following menuentry, i get the output shown in the attached screenshot.
> 
> menuentry "Ubuntu Server 10.04 installer cd" {
>         fakebios
>         root=cd0
>         linux /install/vmlinuz video=efifb nomodeset
>         initrd /install/initrd.gz
> }
> 
> ...


You can try the noefi option.

----------


## engelsma

Thanks bean. I tried the noefi option -- with the following line:

linux /install/vmlinuz video=efifb noefi

No luck -- after loading the initrd.gz, and issuing the boot command, the machine hangs.

"About rEFIt" gives the following information:

EFI Version: 1.1
Platform: x86_64 (64 bit)
Firmware: Apple 1.10
Screen Output: Graphics Output (UEFI), 1024x768

Are the different versions of "burg" you've posted dependent on a particular kernel version?

----------


## bean123

> Thanks bean. I tried the noefi option -- with the following line:
> 
> linux /install/vmlinuz video=efifb noefi
> 
> No luck -- after loading the initrd.gz, and issuing the boot command, the machine hangs.
> 
> "About rEFIt" gives the following information:
> 
> EFI Version: 1.1
> ...


No, it doesn't depend on kernel. But some kernel has bugs that may hang without the noefi option. Perhaps this is some new issue regarding 10.04 release, I'd test it on my mac soon.

----------


## engelsma

So it might be worthwhile to try Karmic (9.10) then?

I'll give that a try.

----------


## engelsma

No luck booting Karmic (9.10) with the following menuentry:

menuentry "Ubuntu Server 9.10 installer cd" {
fakebios
root=cd0
linux /install/vmlinuz video=efifb noefi
initrd /install/initrd.gz
}

the kernel loads as does the initrd.gz. 

the system hangs when the 'boot' command is issued.

----------


## bean123

BTW, do you have more than 4G memory ?

----------


## engelsma

The machine is currently configured with 3 GB of RAM (base configuration).

----------


## bean123

> The machine is currently configured with 3 GB of RAM (base configuration).


You can try the amd64 version as well. The EFI firmware is 64-bit, it works better with a 64-bit kernel. It may even work without fakebios and the noefi option.

If it still fails, try debian 5.0 amd64.

----------


## engelsma

I assume you are referring to using the amd64 versions of Ubuntu, correct? That's what I've been using -- 64 bit ubuntu server. I haven't tried any 32-bit versions.

I'll try booting with no options and see what happens. Next, I'll try Debian.

----------


## engelsma

Thanks bean -- the Debian 5.0.4 Net Install ISO (amd64 platform) boots with:

fakebios
root=cd0
linux /install.amd/vmlinuz video=efifb
initrd /install.amd/initrd.gz

The kernel messages scroll by and I get the initial "Choose Language" screen from the Debian installer.

I'm going to try the Ubuntu 10.04 amd64 mini ISO installer with the same options.

----------


## engelsma

The Ubuntu 10.04 amd64 mini.iso does not boot.

Tried the same options as with the Debian net install CD... the kernel and initrd.gz load, then the system hangs when executing the 'boot' command. No kernel messages or anything...

Is my only option to install Debian? I was really hoping for Ubuntu Server...

----------


## bean123

> The Ubuntu 10.04 amd64 mini.iso does not boot.
> 
> Tried the same options as with the Debian net install CD... the kernel and initrd.gz load, then the system hangs when executing the 'boot' command. No kernel messages or anything...
> 
> Is my only option to install Debian? I was really hoping for Ubuntu Server...


You can use debian for the time being. Ubuntu is based on debian, most package is available in both ubuntu and debian. I'd test the ubuntu kernel when I have some spare time.

----------


## ngativ

I'd finally installed grub-efi on my macbook 2.1 an d now i have snow leopard and ubuntu lucid. The only problem now is that i can not use bright keys under kde, it fails to adjust the screen brightness. (but using grub-pc works)

Here's my grub.cfg:



```
set timeout=100


menuentry "MacOSX Snow Leopard" {
  chainloader /usr/standalone/i386/boot.efi   
}
 
menuentry "Linux" {
  loadbios (hd0,5)/boot/vbios.bin (hd0,5)/boot/int10.bin
  linux (hd0,5)/boot/vmlinuz-2.6.32-22-generic root=/dev/sda5 ro  video=efifb    quiet splash
  initrd (hd0,5)/boot/initrd.img-2.6.32-22-generic
}
```

I there any problem  using the load bios option along the kms kernel module? i cannot adjust my lcd brightness !

----------


## jamesixgun

Have you tried pommed? It got the brightness keys working for me, but that was in Gnome, so I don't know if it's available for KDE.

I have no idea about editing your bios or kernel or anything.

Hopefully someone more knowledgeable in the code arts will come along with better suggestions.

----------


## scriptedSheep

hej folks,

I got a little problem using a Ubuntu 10.04 Lucid Lynx Installation, put to an external hard drive, and my MacBook. Like in many threads mentioned I already installed rEFIt successfully...The problem: My bootloader, that means rEFIt recognizes the Linux-Partition on the plugged-in external HD, and when I select it, the penguine appears for some seconds. Then "the dash" appears in the upper left corners, it appears to blink some times, and exactly in the moment where I get happy that it seems to work, Windows (found on my internal HD, installed vie BootCamp side by side with Snow Leopard...) is starting to boot! I tried many things, I reinstalled GRUB several times, same try with the MBR of the external HDR and more on....Now I found myself reading through the german Ubuntu-Wiki and I discovered this project, used mainly when setting up a Live-USB media. I wondered if it could be needed/useful to install the grub2 EFI boot loader on my external HD and if yes, how I can manage this. Or do you guys got any other ideas solving my problems? I would be really, really, really happy to finally start using Ubuntu, I even can´t wait for it, so please help me folks  :Smile:

----------


## scriptedSheep

Situation changed a little: I managed it to install Ubuntu correctly on my ext. HD, I´m also able to boot into GRUB right now...But like always, I got another psroblem...when selecting an entry related to my Ubuntu-installation, I got the following error which I´m not really able to fix by myself, so please help me guys  :Smile:  


```
Unknown Graphic card: 64710de
[Linux-bzImage, setup=0x3400, zize=0x3bef40]
Videomode 1440-900:32
Frame buffer base: 0xb0010000
Video line length: 8192
[Initrd, addr=0x3fa6f00, size=0x590e71]
```

----------


## Elv13

I compiled an image (tried with both 1686 and x86_64 target) of grub 1.98 and it work with rEFIt! But when I try to bless it with 

bless --folder=/ --file=/efi/grub/grub.efi --setBoot

MacOSX start without showing a menu. What am I doing wrong?

----------


## peterisza

Hi!

I'm facing the same problem (Macbook Pro 7,1, Geforce 320M). I have  tried loading a prerecorded video BIOS image, but it didn't help. Have  you found any solution?




> ```
> (**) May 10 15:47:17 NVIDIA(0): Enabling RENDER acceleration
> (II) May 10 15:47:17 NVIDIA(0): Support for GLX with the Damage and Composite X extensions is
> (II) May 10 15:47:17 NVIDIA(0):     enabled.
> (EE) May 10 15:47:17 NVIDIA(0): Failed to initialize the display subsystem for the NVIDIA
> (EE) May 10 15:47:17 NVIDIA(0):     graphics device!
> (EE) May 10 15:47:17 NVIDIA(0): Failed to determine chip display capabilities
> (EE) May 10 15:47:17 NVIDIA(GPU-0): Failed to get supported display device(s)
> (EE) May 10 15:47:17 NVIDIA(0): Failed to initialize dac HAL
> ```

----------


## Taoye

Has anyone had any success with Lucid on the macbook pro 5,5?

I set up my hard drive like this:
/dev/sda1 HFS+ 1GB
/dev/sda2 ext4 127GB 

and put grub2 (which I compiled from source) on the first partition and blessed it with OS X. Grub2 starts fine, and it loads the kernel and initrd, but it freezes when I enter the boot command.



```
root=hd0,1
linux /vmlinuz-2.6.32-24-generic root=/dev/sda2 rootfstype=ext4 video=efifb
initrd /initrd.img-2.6.32-24-generic
boot
_
```

I've tried it with fix_video, fakebios and loadbios using a vbios and int10 bios captures... nothing seems to work. Maybe it's an issue with this kernel: Fedora 13 boots fine using a 2.6.33 kernel... so tonight I'll try Karmic and Maverick and see if something else will work.

Any ideas?

Thanks,

----------


## metatechbe

> I've tried it with fix_video, fakebios and loadbios using a vbios and int10 bios captures... nothing seems to work. Maybe it's an issue with this kernel: Fedora 13 boots fine using a 2.6.33 kernel... so tonight I'll try Karmic and Maverick and see if something else will work.


Taoye,

It looks like I have a similar problem.  
I have rEFIt 0.14, Ubuntu 10.04 32-bit and grub-1.98 downloaded and compiled from gnu.org, and I added in my kernel parameters :


```
video=efifb:base:0xc0030000,stride:2048,width:1440,height:900
```

Grub seems to hang at the end :


```
ROM image is present
   [Linux-bzImage, setup=0x3400, size=0x3d56c0]
Video mode: 1440x900-32@0
Display Controller: 2:0.0
Device id: 64710de
MMIO(0): 0xe4000000
VMEM(1): 0xc0000000
MMIO(3): 0xe2000000
Frame buffer base : 0xc0030000
Video line length: 8192
   [Initrd, addr=0x3f7fff000, size=0x7f0349]
```

Any idea ?

metatech

----------


## engle.aj

Has anyone been able to get Fedora 13 Live to boot from USB on a mac using Grub 2?

Thanks in advance.

----------


## Sidolin

Hey, I just wanted to tell everyone here that using the patch from this thread (http://140.211.166.79/mailarchive/li...4607435/thread) I am able to boot without the noefi option on a mbp 6,2. dmidecode, applesmc etc. work great.

----------


## TGIK

I got a version of Fedora 12 running on an EXT USB drive using Refit

----------


## TGIK

> Has anyone been able to get Fedora 13 Live to boot from USB on a mac using Grub 2?
> 
> Thanks in advance.


I have Fedora 12 installed and booting off an ext. USB drive 

Derek

sorry for double post

----------


## smutbert

Hello there,

I hope it is ok to start my membership in this forum with a question:

I tried many times to boot linux with grub2-efi and since Maverick it worked for the first time like a charm :Smile: . Having a MacPro with a 32bit efi running Ubuntu amd64, I need either fakebios or loadbios.
But no matter what I use, loading applesmc fails (it works, if i boot with grub-pc):



```
FATAL: Error inserting applesmc (/lib/modules/2.6.35-22-server/kernel/drivers/hwmon/applesmc.ko): No such device
```



```
[   68.577271] applesmc: supported laptop not found!
[   68.577274] applesmc: driver init failed (ret=-19)!
```

Do you know any solution? None of the hints i found so far did help...


Thank you

----------


## Ubuntious

_Machine: 2008 Mac Pro
Keyboard: Aluminum/wired/numeric keypad/US layout
Kernel: 2.6.35-22-generic x64 (maverick)
Bootloader: GRUB 1.99 Beta_

I have been trying to EFI boot Ubuntu since June - without success. My goal, for 
now, is to boot into an initramfs environment succesfully. 

I'm booting with these grub commands:

insmod efi_uga
linux (hd1,gpt1)/ubuntu/vmlinuz-2.6.35-22-generic video=efifb noefi
initrd (hd1,gpt1)/ubuntu/initramfs-2.6.35-22-generic

If "noefi" is missing, the screen goes blank and stays blank. I suspect the kernel is 
hanging (no disk noise).

After I boot into the initramfs, there is no keyboard control. That makes it hard to 
diagnose the problem.

I have tried other kernels (with apple_hid compiled in). Same problem.

The keyboard is connected to the USB hub on an Apple Cinema Display, and the ACD 
is connected via a USB cable to the Mac Pro. It's not practical here to make a direct
connection, but that the above setup is common with this machine.

Although the keyboard doesn't work in  the initramfs, and the CAPS LOCK light won't 
go on there when the key is pressed, the keyboard does work before that inside GRUB.

Any help very much appreciated, as I'm on the verge admitting defeat, which I'd 
prefer not to do  :Smile: 

Thanks.

ps This machine has 64-bit EFI and the kernel is 64-bit also.

----------


## DanaG

If all else fails, you can try sticking a PCI (or PCIe) Serial card in the thing, and use serial console.  

On my laptop, I can't even use EFI boot nowadays... https://bugs.launchpad.net/ubuntu/+s...b2/+bug/612432

----------


## kosumi68

> Hello there,
> 
> I hope it is ok to start my membership in this forum with a question:
> 
> I tried many times to boot linux with grub2-efi and since Maverick it worked for the first time like a charm. Having a MacPro with a 32bit efi running Ubuntu amd64, I need either fakebios or loadbios.
> But no matter what I use, loading applesmc fails (it works, if i boot with grub-pc):
> 
> 
> 
> ...


What do you get when using the latest applesmc-dkms package in ppa:mactel-support?

----------


## Ubuntious

Some success at last. I managed to boot into the initramfs with a working
keyboard. GRUB commands used:

_insmod efi_uga
rmmod efi_gop
gfxterm=1680x1050x32
fakebios
linux (hd1,gpt1)/linux/vmlinuz-2.6.37-rc1 break=premount video=efifb noefi
initrd (hd1,gpt1)/linux/initramfs-2.6.37-rc1
boot_ 

I think the key difference is the _fakebios_ command. I suspect the rmmod and 
gfxterm setting commands are not necessary.

Note: this is using a custom compiled kernel. The Ubuntu Maverick kernel used 
before fails with a fatal error when _fakebios_ is used.

----------


## Ubuntious

thought i might add: fakebios is giving me the rom is present msg, which i understand to be an error msg, but it resolves the keyboard problem nevertheless. would love to know why noefi still needed. btw: using grub 1.99 beta.

----------


## larsribe

Hi Ubuntious
Could you elaborate a bit on what you changed in the kernel configuration to make it work?

Best,

Lars

----------


## Ubuntious

> Hi Ubuntious
> Could you elaborate a bit on what you changed in the kernel configuration to make it work?
> 
> Best,
> 
> Lars


 Everything  :Smile:  

More seriously: I made a lot of changes to the default config. 
Rather too many to list here, I think, but here's the config file:

config.zip

----------


## tschuliaen

Hello guys

I had a long read through this thread however did not quite find out whether nvidia with 3D now is "supported" using grub-efi on my MacBookPro 4,1.

Booting using refit and bios graphics using nvidia drivers work fine however when booting with alt and grub-efi i get the error: "No screens found".

Here is my grub.cfg (of grub-efi)



```
timeout=10
default=0

menuentry "Linux (with bios dump)" {
  insmod efi_uga
  fakebios
  search --set -f /vmlinuz
  loadbios /boot/vbios.bin /boot/int10.bin
  linux /vmlinuz root=/dev/sda3 video=efifb noefi
  initrd /initrd.img
}

menuentry "Linux (with bios dump and fix video)" {
  insmod efi_uga
  fakebios
  search --set -f /vmlinuz
  fix_video
  loadbios /boot/vbios.bin /boot/int10.bin
  linux /vmlinuz root=/dev/sda3 video=efifb
  initrd /initrd.img
}

menuentry "Linux (without bios dump)" {
  insmod efi_uga
  search --set -f /vmlinuz
  fakebios
  linux /vmlinuz root=/dev/sda3 video=efifb insmod efi_uga
  initrd /initrd.img
}
```

Thanks!

Edit: By the way I'm not using Ubuntu, but debian testing but I think it should't matter...

----------


## metatechbe

> linux /vmlinuz root=/dev/sda3 video=efifb insmod efi_uga
> }


Hello,

insmod efi_uga should be a separate line of the grub.cfg, not a kernel parameter.

Regards,

metatech

----------


## tschuliaen

> Hello,
> 
> insmod efi_uga should be a separate line of the grub.cfg, not a kernel parameter.
> 
> Regards,
> 
> metatech


Ok I corrected it:



```
timeout=10
default=0

menuentry "Linux (with bios dump)" {
  insmod efi_uga
  fakebios
  search --set -f /vmlinuz
  loadbios /boot/vbios.bin /boot/int10.bin
  linux /vmlinuz root=/dev/sda3 video=efifb noefi
  initrd /initrd.img
}

menuentry "Linux (with bios dump and fix video)" {
  insmod efi_uga
  fakebios
  search --set -f /vmlinuz
  fix_video
  loadbios /boot/vbios.bin /boot/int10.bin
  linux /vmlinuz root=/dev/sda3 video=efifb
  initrd /initrd.img
}

menuentry "Linux (without bios dump)" {
  insmod efi_uga
  search --set -f /vmlinuz
  fakebios
  linux /vmlinuz root=/dev/sda3 video=efifb
  initrd /initrd.img
}
```

Is it correct now?


The Xorg log gives me this:


```
(EE) Nov 19 13:49:34 NVIDIA(0): Failed to initialize the NVIDIA graphics device PCI:1:0:0.
```

----------


## metatechbe

> Is it correct now?


Yes it looks correct.




> The Xorg log gives me this:
> 
> 
> ```
> (EE) Nov 19 13:49:34 NVIDIA(0): Failed to initialize the NVIDIA graphics device PCI:1:0:0.
> ```


Strange, I already had this error ("No screens found") but that was on a dual-graphic card (MacBookPro5,3), with the wrong card activated.

You could try the following things : 
- Remove "fakebios" and "loadbios".  On my machine with Nvidia graphics I do not need it.
- Remove "fixvideo". This is only for Intel graphics.
- Do you see the boot log on the console ?
- Which version of the kernel/grub/linux distribution do you have ?

metatech

----------


## tschuliaen

> Yes it looks correct.
> 
> 
> 
> Strange, I already had this error ("No screens found") but that was on a dual-graphic card (MacBookPro5,3), with the wrong card activated.
> 
> You could try the following things : 
> - Remove "fakebios" and "loadbios".  On my machine with Nvidia graphics I do not need it.
> - Remove "fixvideo". This is only for Intel graphics.
> ...


I tried without fakebios and loadbios and all i got was something like: Set cpu governor frequency: fail. afterwards my keyboard input is not detected anymore...

I do see the boot log on the console.

I have a debian testing with kernel 2.6.32-5-amd64 and grub 1.98 for bios and grub-efi new from trunk...

----------


## metatechbe

> I do see the boot log on the console.
> 
> I have a debian testing with kernel 2.6.32-5-amd64 and grub 1.98 for bios and grub-efi new from trunk...


Are you sure you have UGA graphics ? What does "About rEFIt" say ?
Can you add "set debug=fb" before "insmod efi_uga" in grub.cfg ?
+ please check if the framebuffer console is enabled in your kernel (fbcon).
+ type "videoinfo" in grub

metatech

----------


## tschuliaen

> Are you sure you have UGA graphics ? What does "About rEFIt" say ?
> Can you add "set debug=fb" before "insmod efi_uga" in grub.cfg ?
> + please check if the framebuffer console is enabled in your kernel (fbcon).
> + type "videoinfo" in grub
> 
> metatech


Yes it says UGA.

videoinfo in grub-efi says: 

```
P=Packed pixel, D=Direct color, mask/pos=R/G/B/reserved
```

What should "set debug=fb" do?

and i get this:


```
CONFIG_FRAMEBUFFER_CONSOLE=y
```

----------


## metatechbe

> What should "set debug=fb" do?


It should print debug lines such as : 
Display controller + VMEM + MMIO

----------


## tschuliaen

> It should print debug lines such as : 
> Display controller + VMEM + MMIO


where do I read this?

Does it matter which version of the nvidia drivers I use? Currently I have the 195.36.24

----------


## metatechbe

> where do I read this?
> 
> Does it matter which version of the nvidia drivers I use? Currently I have the 195.36.24


They are the first thing printed when grub runs (after rEFIt).  
You can add a line in the beginning of the grub.cfg
"echo startup" and this debug should appear just afterwards.

metatech

----------


## tschuliaen

> They are the first thing printed when grub runs (after rEFIt).  
> You can add a line in the beginning of the grub.cfg
> "echo startup" and this debug should appear just afterwards.
> 
> metatech


Ok i get:


```
video/efi_uga.c:102: Display controller: 1:0.0
Device id: 40710de
video/efi_uga.c:131:MMIO(0):0xd2000000
video/efi_uga.c:131:VMEM(1):0xc0000000
video/efi_uga.c:131:MMIO(3):0xd0000000
```

Thanks for your help metatech!

----------


## metatechbe

> Ok i get:
> 
> 
> ```
> video/efi_uga.c:102: Display controller: 1:0.0
> Device id: 40710de
> video/efi_uga.c:131:MMIO(0):0xd2000000
> video/efi_uga.c:131:VMEM(1):0xc0000000
> video/efi_uga.c:131:MMIO(3):0xd0000000
> ...


OK it looks normal.

Can you add "initcall_debug" to your kernel parameters and look for "efifb" in the files
/var/log/kern.log.[0-n]. 

metatech

----------


## tschuliaen

> OK it looks normal.
> 
> Can you add "initcall_debug" to your kernel parameters and look for "efifb" in the files
> /var/log/kern.log.[0-n]. 
> 
> metatech


Here comes the kern log:


```
Nov 19 21:09:51 joesmbp kernel: [    0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz root=/dev/sda3 video=efifb initcall_debug
Nov 19 21:09:51 joesmbp kernel: [    0.424884] calling  efifb_init+0x0/0x1de @ 1
Nov 19 21:09:51 joesmbp kernel: [    0.424893] efifb: dmi detected MacBookPro4,1 - framebuffer at 00000000c0060000 (1920x1200, stride 8192)
Nov 19 21:09:51 joesmbp kernel: [    0.424912] efifb: probing for efifb
Nov 19 21:09:51 joesmbp kernel: [    0.425873] efifb: framebuffer at 0xc0060000, mapped to 0xffffc90005100000, using 7232k, total 7232k
Nov 19 21:09:51 joesmbp kernel: [    0.425878] efifb: mode is 1440x900x32, linelength=8192, pages=1
Nov 19 21:09:51 joesmbp kernel: [    0.425880] efifb: scrolling: redraw
Nov 19 21:09:51 joesmbp kernel: [    0.425883] efifb: Truecolor: size=8:8:8:8, shift=24:16:8:0
Nov 19 21:09:51 joesmbp kernel: [    0.583282] initcall efifb_init+0x0/0x1de returned 0 after 154684 usecs
```

----------


## metatechbe

> Here comes the kern log:


It seems that the hard-coded resolution for your model in the kernel is not correct. But the other parameters might be wrong as well.
Can you please run the following command under MacOS X : 


```
sudo ioreg -lw0 |grep manufacturer|cut  -b25-80;sudo ioreg -lw0|grep "product-name"|cut -b 25-80;sudo dtrace -qn  'BEGIN{boot_args=((struct  boot_args*)(`PE_state).bootArgs);printf("FrameBufferBase:  0x%08x\nPixelsPerScanLine: %d\nHorizontalResolution:  %d\nVerticalResolution: %d", boot_args->Video.v_baseAddr,  boot_args->Video.v_rowBytes/4, boot_args->Video.v_width,  boot_args->Video.v_height);exit(0)} '
```

+ how much RAM do you have ?
metatech

----------


## tschuliaen

> It seems that the hard-coded resolution for your model in the kernel is not correct. But the other parameters might be wrong as well.
> Can you please run the following command under MacOS X : 
> 
> 
> ```
> sudo ioreg -lw0 |grep manufacturer|cut  -b25-80;sudo ioreg -lw0|grep "product-name"|cut -b 25-80;sudo dtrace -qn  'BEGIN{boot_args=((struct  boot_args*)(`PE_state).bootArgs);printf("FrameBufferBase:  0x%08x\nPixelsPerScanLine: %d\nHorizontalResolution:  %d\nVerticalResolution: %d", boot_args->Video.v_baseAddr,  boot_args->Video.v_rowBytes/4, boot_args->Video.v_width,  boot_args->Video.v_height);exit(0)} '
> ```
> 
> + how much RAM do you have ?
> metatech


Here the output:


```
 <"Apple Inc.">
 <"MacBookPro4,1">
FrameBufferBase:  0xc0060000
PixelsPerScanLine: 2048
HorizontalResolution:  1440
VerticalResolution: 900
```

RAM: 4GB

----------


## metatechbe

> Here the output:
> 
> 
> ```
>  <"Apple Inc.">
>  <"MacBookPro4,1">
> FrameBufferBase:  0xc0060000
> PixelsPerScanLine: 2048
> HorizontalResolution:  1440
> ...



FrameBufferBase and PixelsPerScanLine are correct for your model, only the resolution is not correct.  I am not sure it is the cause of the problem.

Maybe in kern.log, another driver takes over the framebuffer/console after efifb, do you see something like this ? Maybe some driver needs to be blacklisted ? 

I am running out of ideas... I hope you will find the problem...

metatech

----------


## tschuliaen

> FrameBufferBase and PixelsPerScanLine are correct for your model, only the resolution is not correct.  I am not sure it is the cause of the problem.
> 
> Maybe in kern.log, another driver takes over the framebuffer/console after efifb, do you see something like this ? Maybe some driver needs to be blacklisted ? 
> 
> I am running out of ideas... I hope you will find the problem...
> 
> metatech


Ok thank you... I'm not quite getting a clue of the log file, it's attached.

Maybe there needs to be done some patching?

Here http://grub.enbug.org/TestingOnMacbook someone that has tested the MBP4,1 writes: Model details of "drivers/video/efifb.c" were wrong and needed patching/recompiling

I also found that this patch is needed: https://help.ubuntu.com/community/Ma...get=e820.patch

Are they really needed? And do I really have to install the latest nvidia drivers (which I did by the way but I'm not sure whether they are "active"

----------


## metatechbe

> Ok thank you... I'm not quite getting a clue of the log file, it's attached.
> 
> Maybe there needs to be done some patching?


You forgot the attachment.

You can also try the "agp=off" 
then
Option         "NvAgp" "1"
in xorg.conf
then try to blacklist the agp modules
then the other patches you mentioned.

Good luck, keep us posted once you find the solution...
Regards,

metatech

----------


## tschuliaen

> You forgot the attachment.
> 
> You can also try the "agp=off" 
> then
> Option         "NvAgp" "1"
> in xorg.conf
> then try to blacklist the agp modules
> then the other patches you mentioned.
> 
> ...


I have found that in the linux-source/drivers/video/efifb.c the line for my MacBookPro 4,1 is wrong: 


```
        [M_MBP_4] = { "mbp4", 0xc0060000, 2048 * 4, 1920, 1200 },
```

instead of 


```
        [M_MBP_4] = { "mbp4", 0xc0060000, 2048 * 4, 1440, 900 },
```

I reckon the config before was for the 17inch modell or just wrong...
I'm now recompiling a kernel, it's the first time I'm doing this, it takes ages and well I'll see whether it was successful later :S

----------


## metatechbe

tschuliaen,

Is your int10.bin file correct ?
You could also try adding "RenderAccel 0" in xorg.conf

metatech

----------


## tschuliaen

> tschuliaen,
> 
> Is your int10.bin file correct ?
> You could also try adding "RenderAccel 0" in xorg.conf…
> 
> metatech


how do I check my int10.bin file?

I successfully compiled my own kernel, the resolution is now correct, however the error stays the same  :Sad: 

Edit: Here is the latest kern.log

Edit: The the other Options did not change anything, blacklisting agp did neither.

Edit: How do I apply this patch: https://help.ubuntu.com/community/Ma...get=e820.patch ?

----------


## metatechbe

> Edit: Here is the latest kern.log
> Nov 20 18:33:39 joesmbp kernel: [   37.874717] NVRM: failed to copy vbios to system memory.
> Nov 20 18:33:39 joesmbp kernel: [   37.878147] NVRM: RmInitAdapter failed! (0x30:0xffffffff:868)
> Nov 20 18:33:39 joesmbp kernel: [   37.878158] NVRM: rm_init_adapter(0) failed


The 3 last lines seem to point the cause of the error.
This is the same error as in post 1092 :
http://ubuntu-virginia.ubuntuforums....postcount=1092
It looks like he could not fix the problem.

Do you have the latest version of the EFI Apple firmware ?

Regards,

metatech

----------


## metatechbe

> Edit: How do I apply this patch: https://help.ubuntu.com/community/Ma...get=e820.patch ?


You could try this patch https://patchwork.kernel.org/patch/119823/, it is a cleaner way to address the 4 GB problem.

metatech

----------


## tschuliaen

> You could try this patch https://patchwork.kernel.org/patch/119823/, it is a cleaner way to address the 4 GB problem.
> 
> metatech


ok thanks how do I do that? Sorry, I'm really a beginner in kernel patching/compiling whatever...

I tried the whole thing with a ubuntu 10.10 with the newer kernel as well but I'm getting the same errors!

Cheers tschuliaen

----------


## metatechbe

> ok thanks how do I do that? Sorry, I'm really a beginner in kernel patching/compiling whatever…
> 
> Cheers tschuliaen


something along the lines of :
cd /usr/src
patch -p2 < v2-EFI-Run-EFI-in-physical-mode.patch
fixed : should be -p0

Regards,

metatech

----------


## tschuliaen

> something along the lines of :
> cd /usr/src
> patch -p2 < v2-EFI-Run-EFI-in-physical-mode.patch
> 
> Regards,
> 
> metatech


thanks but somehow this is not working out?



```
patching file x86/include/asm/efi.h
Hunk #1 FAILED at 93.
1 out of 1 hunk FAILED -- saving rejects to file x86/include/asm/efi.h.rej
patching file x86/kernel/efi.c
Hunk #1 FAILED at 57.
Hunk #2 FAILED at 171.
Hunk #3 FAILED at 182.
Hunk #4 FAILED at 434.
Hunk #5 FAILED at 465.
Hunk #6 FAILED at 578.
6 out of 6 hunks FAILED -- saving rejects to file x86/kernel/efi.c.rej
patching file x86/kernel/efi_32.c
Hunk #1 FAILED at 110.
1 out of 1 hunk FAILED -- saving rejects to file x86/kernel/efi_32.c.rej
patching file x86/kernel/efi_64.c
Hunk #1 FAILED at 39.
Hunk #2 FAILED at 80.
Hunk #3 FAILED at 94.
Hunk #4 FAILED at 112.
4 out of 4 hunks FAILED -- saving rejects to file x86/kernel/efi_64.c.rej
patching file linux/efi.h
Hunk #1 FAILED at 290.
1 out of 1 hunk FAILED -- saving rejects to file linux/efi.h.rej
patching file linux/init.h
Hunk #1 FAILED at 142.
1 out of 1 hunk FAILED -- saving rejects to file linux/init.h.rej
patching file main.c
Hunk #1 FAILED at 200.
Hunk #2 FAILED at 676.
2 out of 2 hunks FAILED -- saving rejects to file main.c.rej
```

----------


## metatechbe

> thanks but somehow this is not working out?
> 
> 
> 
> ```
> patching file x86/include/asm/efi.h
> Hunk #1 FAILED at 93.
> 1 out of 1 hunk FAILED -- saving rejects to file x86/include/asm/efi.h.rej
> ```


Did you do a "sudo" ?
Maybe the "linux-2.6.xyz" directory name must be changed in the paths contained in the patch file to match yours.

metatech

----------


## tschuliaen

> Did you do a "sudo" ?
> Maybe the "linux-2.6.xyz" directory name must be changed in the paths contained in the patch file to match yours.
> 
> metatech


I did do it as root and I tried to change the path replacing it with just linux  :Sad:  I really don't know what I doing (wrong)^^

----------


## metatechbe

> I did do it as root and I tried to change the path replacing it with just linux  I really don't know what I doing (wrong)^^


Oups, sorry, that was
patch -p0 < v2-EFI-Run-EFI-in-physical-mode.patch

----------


## tschuliaen

> Oups, sorry, that was
> patch -p0 < v2-EFI-Run-EFI-in-physical-mode.patch


yap just figured that out myself  :Smile:

----------


## tschuliaen

> yap just figured that out myself


Well the patch did not change anything either. I think I'm giving up... It's probably best to wait some time until things mature  :Sad: 

In the meantime I guess I have to continue using refit and leave a partition for mac os x... or is there any way to single boot using bios/mbr start without having to go through refit?

Thanks again metatech for your patience!

----------


## metatechbe

> Well the patch did not change anything either. I think I'm giving up... It's probably best to wait some time until things mature


Indeed with EFI booting it's still unpredictable to tell whether it will work with a specific configuration or not
You could try as a last attempt with different video drivers (for instance "nv" or "nouveau").

Regards,

metatech

----------


## tschuliaen

> Indeed with EFI booting it's still unpredictable to tell whether it will work with a specific configuration or not
> You could try as a last attempt with different video drivers (for instance "nv" or "nouveau").
> 
> Regards,
> 
> metatech


Ok I didn't give up now and gave it another go  :Capital Razz: 
Fresh install of ubuntu 10.10, corrected the resolution in linux-source/drivers/video/efifb.c for my macbook 4,1 which is 1440x900 and compiled it. Then installed the nvidia drivers the easy-ubuntu way and they work of course using mbr boot!

trying again with grub-efi I get in the kern.log:


```
[   21.999903] Xorg:1098 conflicting memory types c0000000-c0546000 write-combining<->uncached-minus
[   21.999906] reserve_memtype failed 0xc0000000-0xc0546000, track write-combining, req write-combining
```

would this mean something?

The Xorg.log gives me this:



```
[    26.038] (II) NVIDIA(0): NVIDIA GPU GeForce 8600M GT (G84) at PCI:1:0:0 (GPU-0)
[    26.038] (--) NVIDIA(0): Memory: 524288 kBytes
[    26.038] (--) NVIDIA(0): VideoBIOS: 60.84.49.03.00
[    26.038] (II) NVIDIA(0): Detected PCI Express Link width: 16X
[    26.038] (--) NVIDIA(0): Interlaced video modes are supported on this GPU
[    26.038] (--) NVIDIA(0): Connected display device(s) on GeForce 8600M GT at PCI:1:0:0:
[    26.038] (--) NVIDIA(0):     Apple (DFP-0)
[    26.038] (--) NVIDIA(0): Apple (DFP-0): 330.0 MHz maximum pixel clock
[    26.038] (--) NVIDIA(0): Apple (DFP-0): Internal Dual Link LVDS
[    26.046] (WW) NVIDIA(0): Unable to find any of the requested display device "DFP-1" in
[    26.046] (WW) NVIDIA(0):     the list of available display devices "DFP-0".
[    26.053] (II) NVIDIA(0): Assigned Display Device: DFP-0
[    26.053] (==) NVIDIA(0): 
[    26.053] (==) NVIDIA(0): No modes were requested; the default mode "nvidia-auto-select"
[    26.053] (==) NVIDIA(0):     will be used as the requested mode.
[    26.053] (==) NVIDIA(0): 
[    26.053] (II) NVIDIA(0): Validated modes:
[    26.053] (II) NVIDIA(0):     "nvidia-auto-select"
[    26.053] (II) NVIDIA(0): Virtual screen size determined to be 1440 x 900
[    26.062] (--) NVIDIA(0): DPI set to (110, 108); computed from "UseEdidDpi" X config
[    26.062] (--) NVIDIA(0):     option
[    26.062] (==) NVIDIA(0): Enabling 32-bit ARGB GLX visuals.
[    26.062] (--) Depth 24 pixmap format is 32 bpp
[    26.069] (II) NVIDIA(0): Initialized GPU GART.
[    26.073] (II) NVIDIA(0): ACPI display change hotkey events enabled: the X server is new
[    26.073] (II) NVIDIA(0):     enough to receive ACPI display change hotkey events.
[    26.081] (II) NVIDIA(0): Setting mode "nvidia-auto-select"
[    26.407] (EE) NVIDIA(0): Failed to allocate video memory
[    26.408] (EE) NVIDIA(0):  *** Aborting ***
```

thanks

----------


## tschuliaen

HURRRRRAAAAAA!
it works  :Smile: 
all I had to do was put a nopat at the end:



```
menuentry "Linux (with bios dump)" {
set debug=fb
insmod efi_uga
 root=(hd0,3)
  search --no-floppy --fs-uuid --set f8411c44-edb1-402c-a621-18ed0605d8b8
  loadbios /boot/vbios.bin /boot/int10.bin
  linux	/boot/vmlinuz-2.6.35.7.1 root=/dev/sda3 video=efifb nopat
  initrd	/boot/initrd.img-2.6.35.7.1
}
```

sadly two things aren't yet perfect:

after grub I get a "no argument specified" and "press key to continue"

and brightness keys don't work  :Sad:

----------


## tschuliaen

> HURRRRRAAAAAA!
> it works 
> all I had to do was put a nopat at the end:
> 
> 
> 
> ```
> menuentry "Linux (with bios dump)" {
> set debug=fb
> ...


Ok first I commented root=(hd0,3) so without this it works without "no argument specified" 

and second I added the mactel ppa (https://launchpad.net/~mactel-suppor.../ppa/+packages)
and installed mbp-nvidia-bl-dkms and nvidia-bl-dkms (dunno which one did it... (either nvidia-bl-dkms or both)

so now I have the nice brightness keys working with the steps like in mac (not like standart ubuntu or windows)!

Well I should probably write all the steps down which I've done with my macbookpro 4,1 in a wiki... where should I do that?

cheers tschuliaen

----------


## metatechbe

> all I had to do was put a nopat at the end:


tschuliaen, congratulations for your dedication on this problem...

I do not understand what you changed in your configuration between these 2 error messages :



```
Nov 20 18:33:39 joesmbp kernel: [ 37.878147] NVRM: RmInitAdapter failed! (0x30:0xffffffff:86
```



```
[   21.999903] Xorg:1098 conflicting memory types c0000000-c0546000 write-combining<->uncached-minus
[   21.999906] reserve_memtype failed 0xc0000000-0xc0546000, track write-combining, req write-combining
```

Were they both caused by the "Page Attribute Table" feature ?

Thanks,

metatech

----------


## m3tro

Hi, yesterday I got to install only Ubuntu on my Macbook. I booted the system "without BIOS dump" and always got an error saying:


```
error: no suitable mode found
booting however
```

And the system booted and worked perfectly. But today, I decided to try and boot it "with BIOS dump" just to see what happened. I got the message:


```
error: file not found
...press any key to continue...
error: no suitable mode found
booting however
```

But this time the screen stayed like that and didn't boot at all.
The problem is that now when I try to boot it "without BIOS dump" I get the same "no suitable mode, booting however" but it stays like that and doesn't boot either.

So now I have no way of booting my installation. How come I broke it by only trying "with BIOS dump"? How could I fix it? I really have no idea...

----------


## metatechbe

> How come I broke it by only trying "with BIOS dump"? How could I fix it? I really have no idea...


Is it really the only configuration you changed ?
Did you keep the exact same kernel version/parameters, or file system it was installed on ?
Also, did you do a "really" cold reboot afterwards ? (power off, wait at least 15 seconds, then power on again)

metatech

----------


## m3tro

I didn't change nothing, really. Just tried that option, and it didn't boot ever again. But I guess I didn't try a cold reboot (I didn't know it existed) because I probably turned it on again before 15 seconds.

But nevermind, I booted again from a live usb key, changed to a completely new grub.cfg ant it works again. It gives me some new errors and the "booting however" but works without any trouble.

----------


## tschuliaen

> Hi, yesterday I got to install only Ubuntu on my Macbook. I booted the system "without BIOS dump" and always got an error saying:
> 
> 
> ```
> error: no suitable mode found
> booting however
> ```
> 
> And the system booted and worked perfectly. But today, I decided to try and boot it "with BIOS dump" just to see what happened. I got the message:
> ...


Stupid question, but did you create the two boot images?

----------


## tschuliaen

> tschuliaen, congratulations for your dedication on this problem...
> 
> I do not understand what you changed in your configuration between these 2 error messages :
> 
> 
> 
> ```
> Nov 20 18:33:39 joesmbp kernel: [ 37.878147] NVRM: RmInitAdapter failed! (0x30:0xffffffff:86
> ```
> ...


Sorry for the long delay!

Welle both errors are gone... so I assume Yes!?

----------


## dracks

please can you share your kernel build with initramfs?

because I did all the things except build the kernel with the modification of efifb.c and don't work, and when i try to build the kernel, i obtain som errors. At this moment i haven't time to lost in this. 

Thanks.

Dracks.

----------


## tschuliaen

> please can you share your kernel build with initramfs?
> 
> because I did all the things except build the kernel with the modification of efifb.c and don't work, and when i try to build the kernel, i obtain som errors. At this moment i haven't time to lost in this. 
> 
> Thanks.
> 
> Dracks.


Actually I now found out that I do not need a modified kernel. Even though the resolution in the efifb.c is wrong it works nevertheless.

Here is the entry I use in my grub.cfg:



```
menuentry "Ubuntu Linux (with bios dump)" {
 insmod efi_uga
 root=(hd0,3)
  loadbios /boot/vbios.bin /boot/int10.bin
  linux	/vmlinuz root=/dev/sda3 video=efifb nopat
  initrd /initrd.img
}
```

in my case I had to add "nopat" to overcome a Page Attribute Table problem!?

furthmore the nvidia proprietary drivers (version 173) are installed the ubuntu way and bios dumps are made when started in bios mode like (from here) this:



```
dd if=/dev/mem of=/boot/vbios.bin bs=65536 skip=12 count=1
dd if=/dev/mem of=/boot/int10.bin bs=4 skip=16 count=1
```

cheers

----------


## dracks

Thank you, i need to add in the grub config the insmod efi_uga


thank you very much!!!!


Dracks.

----------


## tschuliaen

Ok unfortunately I managed to break my working configuration by upgrading the nvdia drivers from 173 to 185  :Sad: 
How is that possible?

I'm getting the following:


```
[    14.959] (EE) NVIDIA: Failed to load the NVIDIA kernel module. Please check your
[    14.959] (EE) NVIDIA:     system's kernel log for additional error messages.
[    14.959] (II) UnloadModule: "nvidia"
[    14.959] (II) Unloading /usr/lib/xorg/extra-modules/nvidia_drv.so
[    14.959] (EE) Failed to load module "nvidia" (module-specific error, 0)
[    14.959] (EE) No drivers available.
```

and



```
Jan  3 11:08:11 joes-mbp kernel: [   14.306644] NVRM: failed to copy vbios to system memory.
Jan  3 11:08:11 joes-mbp kernel: [   14.306754] NVRM: RmInitAdapter failed! (0x30:0xffffffff:820)
Jan  3 11:08:11 joes-mbp kernel: [   14.306759] NVRM: rm_init_adapter(0) failed
Jan  3 11:08:12 joes-mbp kernel: [   14.655923] NVRM: failed to copy vbios to system memory.
Jan  3 11:08:12 joes-mbp kernel: [   14.656034] NVRM: RmInitAdapter failed! (0x30:0xffffffff:820)
Jan  3 11:08:12 joes-mbp kernel: [   14.656038] NVRM: rm_init_adapter(0) failed
Jan  3 11:08:12 joes-mbp kernel: [   14.964079] NVRM: failed to copy vbios to system memory.
Jan  3 11:08:12 joes-mbp kernel: [   14.964190] NVRM: RmInitAdapter failed! (0x30:0xffffffff:820)
Jan  3 11:08:12 joes-mbp kernel: [   14.964194] NVRM: rm_init_adapter(0) failed
Jan  3 11:08:12 joes-mbp kernel: [   15.238098] NVRM: failed to copy vbios to system memory.
Jan  3 11:08:12 joes-mbp kernel: [   15.238210] NVRM: RmInitAdapter failed! (0x30:0xffffffff:820)
Jan  3 11:08:12 joes-mbp kernel: [   15.238214] NVRM: rm_init_adapter(0) failed
Jan  3 11:08:12 joes-mbp kernel: [   15.514053] NVRM: failed to copy vbios to system memory.
Jan  3 11:08:12 joes-mbp kernel: [   15.514164] NVRM: RmInitAdapter failed! (0x30:0xffffffff:820)
Jan  3 11:08:12 joes-mbp kernel: [   15.514169] NVRM: rm_init_adapter(0) failed
```

thanks in advance!

EDIT: I also tried the 260 driver...no change  :Sad:

----------


## tschuliaen

How would I apply this patch: https://help.ubuntu.com/community/Ma...get=e820.patch

I always get a HUNK rejected  :Sad: 

Thx

----------


## Mac117

Hey guys. I followed this instructions:
http://ubuntuforums.org/archive/inde...t-1376277.html

And I ended with a external bootable ubuntu 10.10. The problem, is that at the end of the boot it just crashes:



```
RAMDISK: Couldn't find valid RAM disk starting at 0.
VFS: Cannot open root device "sbd5" or unknown-block(0,0)
Please append a correct "root=" boot option; here are the available partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on unkwnown-block(0,0)
Pid: 1, comm: swapper Not tainted 2.6.35-22-generic #33-Ubuntu
Call Trace:
[<ffffffff815863e0>] panic+0x90/0x111
[<ffffffff81aee2ba>] mount_block_root+0x1ea/0x29e
[<ffffffff81aee3c4>] mount_root+0x56/0x5a
[<ffffffff81aee538>] prepare_namespace+0x170/0x1a9
[<ffffffff81aee538>] kernel_init+0x1ad/0x1bd
[<ffffffff81aee538>] kernel_thread_helper+0x4/0x10
[<ffffffff81aee538>] ? kernel_init+0x0/0x1bd
[<ffffffff81aee538>] ? kernel_thread_helper+0x4/0x10
```

FYI: The root device is right (sdb5).

I am using a MBP 5,5 and the grub.conf file is:



```
# grub.cfg for MBP USB Install F11

# Timeout for menu
timeout=20
default=0

menuentry "Ubuntu, Linux 2.6.35-22-generic" {
fakebios
set root=(hd1,5)
insmod ext2
linux /boot/vmlinuz-2.6.35-22-generic root=/dev/sdb5 acpi=off pci=nosort raid=noautodetect
initrd /boot/initrd.img-2.6.35-22-generic
}
```

Can someone help me please?

----------


## metatechbe

> ```
> RAMDISK: Couldn't find valid RAM disk starting at 0.
> VFS: Cannot open root device "sbd5" or unknown-block(0,0)
> Please append a correct "root=" boot option; here are the available partitions:
> Kernel panic - not syncing: VFS: Unable to mount root fs on unkwnown-block(0,0)
> Pid: 1, comm: swapper Not tainted 2.6.35-22-generic #33-Ubuntu
> ```


This looks like the error with grub 1.98, without the "newreloc" feature, that corrupts the initial ram disk image.
Please use grub 1.99rc1.

metatech

----------


## paulcz

> ...
> VFS: Cannot open root device "sbd5" or unknown-block(0,0)
> ...
> FYI: The root device is right (sdb5).


i doubt the root device is right ... it says sbd5 ... not sdb5

----------


## Mac117

> This looks like the error with grub 1.98, without the "newreloc" feature, that corrupts the initial ram disk image.
> Please use grub 1.99rc1.
> 
> metatech


I saw this, but I am having trouble to "build" the grub 1.99rc1. When I do it, it does not find my configuration file. I ajusted what is written here: http://grub.enbug.org/TestingOnMacbook and here http://www.rodsbooks.com/ubuntu-efi/index.html

To this:


```
../grub-mkimage -O x86_64-efi -d . -o grub.efi -p "hd(1,5)/efi/boot/" part_gpt \
hfsplus fat ext2 normal chain boot reboot configfile linux multiboot xnu \
xnu_uuid jpeg png tga search loadenv font
```

Am I missing something?






> i doubt the root device is right ... it says sbd5 ... not sdb5


Thanks...

----------


## metatechbe

> ```
> ../grub-mkimage -O x86_64-efi -d . -o grub.efi -p "hd(1,5)/efi/boot/" part_gpt \
> hfsplus fat ext2 normal chain boot reboot configfile linux multiboot xnu \
> xnu_uuid jpeg png tga search loadenv font
> ```


Which error do you get ?
Beware that with grub 1.99, the naming scheme of the partition has changed : it is now 


```
(hd1,gpt5)
```

instead of 


```
(hd1,5)
```

The safest is to use -p "" for the prefix, and store the "grub.cfg" in the same directory as the executable.

----------


## srs5694

The "(hd1,5)" type nomenclature still works; the specification of the partition table type is optional. Specifying the prefix (with -p) enables the GRUB update scripts to continue to work; without that option, it becomes necessary to manually copy the changed grub.cfg file from /boot/grub to the EFI partition (or wherever the GRUB .efi file resides) after every change.

----------


## Mac117

Can someone post a working grub 1.99 file?

----------


## buscher

Hello,
this thread really helped me, but now I am stuck on my MacBook7.1

grub-1.99-rc1 grub.cfg


```
menuentry "fake bios" {
        insmod efi_gop
        set root='(hd0,1)'
        fakebios
        linux   /EFI/vmlinuz-2.6.38.1 root=/dev/sda4 ro noefi reboot=pci
}
```

and my system boots fine, but nvidia fails, or xorg with



```
[    18.377] (EE) NVIDIA(0): Failed to initialize the display subsystem for the NVIDIA
[    18.377] (EE) NVIDIA(0):     graphics device!
[    18.378] (EE) NVIDIA(0): Failed to determine chip display capabilities
[    18.378] (EE) NVIDIA(GPU-0): Failed to get supported display device(s)
[    18.378] (EE) NVIDIA(0): Failed to initialize dac HAL
```

using nvidia-drivers 270.30

I tried various kernel parameters like noapic agp=off and acpi=off + force, but they didn't help.

As I am out of ideas I am writing here, someone got an idea? :)

----------


## D4T

> Try this one. It's compiled with burg, the configure file should be named burg.cfg.


Don't suppose you can remember if there was something special about this version? When I compile the latest for my MacBookPro5,1 it just hangs but this one works for some reason?  :Smile:

----------


## metatechbe

> Hello,
> 
> 
> ```
> [    18.377] (EE) NVIDIA(0): Failed to initialize the display subsystem for the NVIDIA
> [    18.377] (EE) NVIDIA(0):     graphics device!
> ```
> 
> using nvidia-drivers 270.30


Are there any other error messages in 
/var/log/kern.log.[0-n] ?
Did you try the "nopat" parameter ?

metatech

----------


## toinebnom

Hi, 

I've a Macbook 2.1 with a broken cdrom reader and debian Squeeze installed on the internal harddrive, but I can't manage to get DMI to work. 

 I manage to install Debian squeeze on it after the following procedure : 

- I installed a new blank harddrive in my mac, and after booting on the former hardrive (with Mac OS X) from a USB caddy, I created a small (50 Mb) HFS+ partition under OS X, and install refit 0.14 on it. 

- I found somewhere in this thread a couple of grub.efi (both 32 and 64 bit version), that I copied on my small HFS+ partition. 

- I installed Debian Squeeze AMD 64 on another computer (by connecting my fresh disk in my USB caddy) and I put back the fresh disk, loaded with Squeeze AMD64 in the laptop. 

I'm able to boot the laptop with the following grub command line :
fakebios
search --set /vmlinuz
linux /vmlinuz noefi acpi=force video=efifb root=/dev/sda3
initrd /initrd.img

I read somewhere that I need to boot in BIOS compatibility mode to dump my bios, but I can't install Bootcamp on my fresh hardrive, OSX refuses to format it...

Thanks in advance for any input.

----------


## DarkTide

I don't know about specifics for macbook 3,1, but basicalls I'd say if  you want grub to run linux, just install it with pc-grub (so that it  runs in bios emulation moder) until grub has better EFI support, and  especially better EFI support for macs, cause Apple sometimes  implemented stuff in a non-standard way

----------


## kmand

I have an Intel Mac Mini (2007 2.1) and run Ubuntu off an external USB drive. I have been using grub legacy which doesn't see the USB drive. So what I have been doing is booting off a grub legacy CD with /boot on an internal drive, and root= on the USB.

I want to convert to grub2 and am looking for a better solution.

I tried both the grub2 (pc/bios) and grub2 (efi) recovery disks.

The (pc/bios) doesn't see the usb disk just like the legacy.

The efi recovery disk doesn't work at all. It boots into a black screen with a blinking cursor, no grub prompt, no keyboard response.

Is there anything else I can do?

----------


## metatechbe

Hi,

On Mac models from 2010 and higher, 
Matthew Garrett found a better fix than the "Run EFI in physical mode".
See his patch "Retain boot service code until after switching to virtual mode"
https://patchwork.kernel.org/patch/798202/
which is explained here :
http://mjg59.dreamwidth.org/2929.html#comments

Regards,

metatech

----------


## Gnomjkl

I'm trying to get a working Ubuntu install on an external drive for my iMac. I've been on it for a few hours now and I'm not making any progress. I'm at a point where I get grub loading vmlinuz and initrd into memory, and then... nothing! I mostly used this page as documentation. So, here goes a brief on my situation :

Config
-iMac11,2 running OS X 10.6.8
-internal HDD with 2 partitions (GPT) : EFI partition and OS X partition
-external HDD plugged via USB with 5 partitions (GPT) : EFI (fat, 200 MB), refit (HFS, 100 MB), Linux swap (4 GB), Ubuntu partition (ext4, 16 GB), big partition for data (HFS, 480 GB)

Ubuntu install
I used my netbook to install Ubuntu 11.10 on my Ubuntu partition. This is probably not the best option but unfortunately I can't use a liveCD because my optical drive won't work, and the whole point of this is to get Ubuntu booting from USB. This setup is functional on my netbook.

How GRUB2 is loaded
As you can see, I made a refit partition, but I ended up not using it. I put the bootx64.efi file I compiled using my netbook, along with all the .mod and .lst files in the /efi/boot folder of the efi partition of my external HDD. The EFI file has then been "blessed"  :Pray:  using the OS X command.

Contents of grub.cfg


```
insmod efi_gop
insmod efi_uga
insmod font

if loadfont ${prefix}/unicode.pf2
then
    insmod gfxterm
    set gfxmode=auto
    set gfxpayload=keep
    terminal_output gfxterm
fi

menuentry "Linux" {
  search --file --no-floppy --set=root /vmlinuz
  linux /boot/vmlinuz-3.0.0-12-generic root=/dev/sda4 video=efifb
  initrd /boot/initrd.img-3.0.0-12-generic
  acpi=off rootwait
}
```

I also tried some variations that I'll describe in the next section.

What happens when I boot, what I tried to make it work
After loading GRUB and choosing the "Linux" option, it seems to successfully load vmlinuz and initrd, at which points my HDD completely stops spinning. I end up with this :


```
Gave up waiting for root device. Common problems:
 - Boot args (cat /prog/cmdline)
  - Check rootdelay= (did the system wait long enough?)
  - Check root= (did the system wait for the right device?)
 - Missing modules (cat /proc/modules; ls /dev)
ALERT! /dev/sda4 does not exist. Dropping to a shell!

BusyBox v1.18.4 (Ubuntu 1:1.18.4-2ubuntu2) built-in shell (ash)
Enter 'help' for a list of built-in commands.

(initramfs) _
```

It is stated that /dev/sda4 does not exist, which is logical since the HDD isn't working. That's why I added the "acpi=off" and "rootwait" args, in hope that it would allow it to work, but it didn't. I then thought that on the first part of the boot procedure the HDD was solely handled by the EFI, and after the kernel and ramdisk became active they had to rely on themselves, so I added "insmod usb" and "insmod usbms" at the top of grub.cfg.

I also runned ls -l from GRUB's console to be sure my disk was correctly configured, it returned this :


```
grub> ls -l
Device hd0: Not a known filesystem - Total size 0 sectors
Device hd1: Not a known filesystem - Total size 976773167 sectors
	Partition hd1,gpt5: Filesystem type hfsplus - Last modification time 2012-04-07 19:25:40 Saturday, UUID e3f6e0cc31def9f8 - Partition start at 39665664 - Total size 936845320 sectors
	Partition hd1,gpt4: Filesystem type ext2 - Last modification time 2012-04-07 14:24:51 Saturday, UUID eb9e3f10-955e-4a60-9b1f-844907c554ec - Partition start at 8417280 - Total size 31248384 sectors
	Partition hd1,gpt3: Not a known filesystem - Partition start at 606208 - Total size 7811072 sectors
	Partition hd1,gpt2: Filesystem type hfsplus - Last modification tim 2012-04-07 19:25:40 Saturday, UUID 094d1a15b7d2c5d2 - Partition start at 409640 - Total size 195312 sectors
	Partition hd1,gpt1: Filesystem type fat, UUID 70d6-1701 - Partition start at 40 - Total size 409600 sectors
Device hd2: Not a known filesystem - Total size 976773167 sectors
	Partition hd2,gpt2: Filesystem type hfsplus - Last modification time 2012-04-07 19:25:41 Saturday, UUID db61df390ef6f2be - Partition start at 409640 - Total size 976101344 sectors
	Partition hd2,gpt1: Filesystem type fat, UUID 70d6-1701 - Partition start at 40 - Total size 409600 sectors
Device cd0: Not a known filesystem - Total size 0 sectors
```

Conclusion
It seems my disk stops working after the kernel and ramdisk become active. I have no further ideas to fix that. I must admit this is the first time I've messed with GRUB that much, I'm not really familiar with it. So if you have ideas or at least general directions I could explore, that would be great  :Smile:

----------


## Gnomjkl

I continued my researches today, and tried to catch the first part of the process boot, which goes so fast on my screen I can't read it. I filmed it and looked at the video frame by frame, which allowed me to see a series of message going like this :


```
[   0.xxxxxx] pcieport 0000:00:01.0: device (8086:xxxx) has invalid IRQ: check vendor BIOS
```

and a bit later a series of :


```
[   0.xxxxxx] ehci_hcd 0000:00:1x.x: can't find IRQ for PCI INT B : please try using pci=biosirq 
[   0.xxxxxx] ehci_hcd 0000:00:1x.x: Found HC with no IRQ Check BIOS/PCI 0000:00:1x.7 setup!
[   0.xxxxxx] ehci_hcd 0000:00:1x.x: init 0000:00:1x.x fail, -19
```

From what I gather this has to do with the loading of stuff plugged using PCI lines, including my USB ports. That means they are never initialized after the EFI has stopped providing this service, which indeed would be a good reason for my hard drive not to work. Could this be because I installed Ubuntu on a netbook that didn't include the same hardware as my iMac? I thought this was standard and wouldn't give me an issue, especially since liveUSBs can boot from lots of different machines, but if it's not, then I'm pretty much screwed, because as I said earlier I can't install Ubuntu from my mac. Anyway, still looking for answers, so if you have an idea please be my guest!

----------


## Gnomjkl

OK, managed to get my optical drive to work again, so I made a clean install from my iMac to the correct HDD. After yet some other fiddling about, I got Ubuntu to start at last... sort of. Now I'm stuck with a black screen. The system seems to be functioning otherwise, cause I hear the djembe kind of sound at the end of the startup and I can shut it down using CTRL+SysRq+S and CTRL+SysRq+O ! So, the answer is probably close by now  :Smile: 

OK, I can confirm my system starts, since it is detected in my network under the name I gave it when I installed. Now to fix the black screen issue. Probably some X.org config.

----------


## Gnomjkl

Fixed, it was a X.org config issue indeed. So I now have a working Ubuntu setup on my external HDD, thanks to you (even though I didn't get answers, some leads discussed in this topic proved helpful)!

----------


## entangled

I'd be interested to hear what you did to Xorg.conf to get round the black screen.
I also have an iMac 11,2, now running 10.7.4.

I'm trying out efi stub booting (not using Grub) of the 3.4 kernel in 12.10, and am almost there. I can boot a text kernel but when I let the video take over (startx) I lose the screen (goes black). No vt available. I can log in blind.
The session log says no suitable modes found.
I have tried vesa but that returns no screens.

The same kernel will boot, with normal video, if I boot it using a Super Grub 2 boot disk. I think Super Grub 2 must be setting some video parameter that I can't see.

I have also run grub-install on this kernel from 12.10, placing the efi file onto OSX main disk. Efi detects this and boots, but I get a black screen again.

----------


## Gnomjkl

Sorry, this is I think the only step I didn't carefully noted down for later use, but if memory serves I just added the nomodeset option to my grub.cfg. Here is the grub.cfg entry for my iMac, it may work as-is on your setup :



```
menuentry "Linux (iMac Selles)" {
  fakebios
  search --file --no-floppy --set=root /vmlinuz
  echo (${root})
  linux /vmlinuz root=/dev/sdc4 video=efifb rootdelay=60 noefi acpi=force nomodeset
  initrd /initrd.img
  sleep 2
}
```

----------


## entangled

Just to complete my input to this discussion -
I got the video to behave by specifying the Device to be "fbdev", instead of "fglrx", in Xorg.conf. So now I can boot from the 12.10 kernel using Grub2 on the pure gpt disk.
I still can't get the video working directly when I do an efi stub boot on the same kernel. I can boot it to text, with auto root login, and then 'startx' to get the unity desktop, but if I login my non-root account then 'startx' shows no permission to run X. Bit more to do.

----------


## Andyka

I use a Macbook Pro 8.3 and thanks to you folks (especially thanks to Gnomjkl) I was able to get Ubuntu 12.04 TLS up and running on an external hard drive.

My grub entry (the same as already posted):


```
menuentry "Linux" {
 fakebios
 search --file --no-floppy --set=root /vmlinuz
 echo (${root})
 linux /vmlinuz root=/dev/sdb4 video=efifb rootdelay=60 noefi acpi=force nomode set
 initrd /initrd.img
 sleep 2
}
```

To get X up and running I created the following /etc/X11/xorg.conf:


```
 
Section "Device"
 Identifier "Configured Video Device"
 Driver  "fbdev"
 BusID  "PCI:0:2:0"
EndSection
```

To make Wifi work, I followed this link:
http://homepage.uibk.ac.at/~c705283/..._81/index.html

To support the Function keys F1/F2 to change the screen brightness:
http://wiki.ubuntu.com/Kernel/AppleGmuxBacklight

----------


## Gnomjkl

It's me again! This time I'm trying to make a kind of a universal liveUSB, one that would work on EFI and BIOS based computers and would allow simple upgrade. I'm doing it this way : I prepared a USB stick with both BIOS and EFI grub, which are configured to boot from an ISO file stored on the key. This was the easy part. It works perfectly on a BIOS-based computer, and it boots Linux on my iMac. But of course, since I'm using a Ubuntu ISO (and I don't want to modify it since it needs to be easily replaced), I can't configure X.org properly, which leads me to the previous black-screen issue. I was wondering if you had any idea to make it work only invoking grub arguments?

----------


## jonas2012

Argh wrong thread, sry.

----------


## entangled

For anyone who might be interested:
ubuntu 12.10 (quantal) can be booted from my iMac internal drive without using grub. This is pure efi stub booting using only the kernel and one config file, driven by refind boot manager (not boot loader). You do need to install refind on OSX (http://www.rodsbooks.com/refind/).

The kernel, and it's initrd image, sits on my disk0s1 (EFI) MSDOS partition under folder /EFI/ubuntu. Also there is a file called refind_linux.conf where I put the menu items for this kernel. Each item needs the disk root UUID, but I can include other options like nosplash or nomodeset.

The general refind.conf file is on the main HPFS partition under /efi/refind, where refind was installed. This file tells refind what scope to use when scanning for kernels and what should be the default selected boot icon.

If I do a ubuntu update including a new kernel then this new kernel, and the initrd image, need to be copied over to /EFI/ubuntu to replace the existing ones. You can do this easily from ubuntu by mounting /dev/sda1 and copying these files.

EFI stub boot also works from the main mac partition (disk0s2) but it is MacOSX Extended with journalling, and not so easy to update from linux. 

The main problem I have had is the video. For a while I used Device "fbdev" in xorg.conf to get X to work. However, when kernel 3.4 was replaced by kernel 3.5 this stopped working and I was getting black screen on boot. I have cured this by specifying 'nomodeset' in the refind_linux.conf file. This is probably because kernel 3.5 is loading its radeon driver automatically, doing KMS, and that selects the wrong video connector.

----------


## palmik

Nice! I installed to early Mac mini. Using refind I get "Failed to open initrd file" but using UEFI shell the system loads and works just fine. Did you have this problem? And which options did you change in /EFI/refind/refind.conf and what do you have in /EFI/ubuntu/refind_linux.conf?

----------


## phillat5dock

I am in awe of the work people on this forum have done to solve problems and make things easier for everyone.
Here is my problem and I am hoping someone might have some suggestions.

I have an 27in iMac 11,3 with an Intel Core i5 dual core running at 3.6  GHz. It has 16GB ram and a 2TB internal hard drive, The hard drive is partitioned with Mac OS X 10.8.2 and Windows 7 in Boot Camp.

I have been endeavouring to put Ubuntu 12.10 on a USB external drive. I have previously had Ubuntu 11.10 on a "third" partition on the internal HDD with triple booting, but that setup eventually proved unstable and I abandoned it.

The external USB drive is a Western Digital 320 GB one. I have managed, using a Live CD, to install Ubuntu on it, and have installed (by copying from a flash drive I set up) grub efi.
I have placed bootx64.efi and grubx64.efi in a folder on the ESP.
ESP .../efi/efi/ubuntu/

I am using rEFInd to pick the boot loader.
When I select the Ubuntu EFI boot icon Ubuntu starts to boot. I am guessing it has loaded the linux inited.img. Then eventually it drops into a grub command line.
ls at the command line produces a list of partitions. The one I want is listed as (hd2,gpt2).
ls (hd2,gpt2)/boot/grub reveals the two efi files mentioned above.

Now if I type 

configfile (hd2,gpt2)/boot/grub/grub.cfg

Ubuntu loads the grub menu and I can select Ubuntu and it then continues to boot.

So what should I do next.

Should I copy the *.mod files and the grub.cfg and the various *.img files over to the ESP? I tried putting a symlink to grub.cfg but that wasn't allowed. I also copied the grub.cfg file to the ESP but that made no difference.

Of course now that I have come this far I am very happy to have a working installation of Ubuntu on an external USB drive!!!

----------


## pindar

> The external USB drive is a Western Digital 320 GB one. I have managed, using a Live CD, to install Ubuntu on it, and have installed (by copying from a flash drive I set up) grub efi.
> I have placed bootx64.efi and grubx64.efi in a folder on the ESP.
> ESP .../efi/efi/ubuntu/
> 
> I am using rEFInd to pick the boot loader.
> When I select the Ubuntu EFI boot icon Ubuntu starts to boot. I am guessing it has loaded the linux inited.img. Then eventually it drops into a grub command line.
> ls at the command line produces a list of partitions. The one I want is listed as (hd2,gpt2).
> ls (hd2,gpt2)/boot/grub reveals the two efi files mentioned above.
> 
> ...


I also boot linux from an external (firewire) drive, but most of this is still a mystery to me. That being said: I think both the apple bootloader and grub expect their files in a certain directory structure. What I have is (EFI partition)/EFI/grub/ , and both my boot.efi file and the grub.cfg live in this directory. You could try recreating this and see if it allows grub to find its config file automatically.

Good luck!

----------


## phillat5dock

> I also boot linux from an external (firewire) drive, but most of this is still a mystery to me. That being said: I think both the apple bootloader and grub expect their files in a certain directory structure. What I have is (EFI partition)/EFI/grub/ , and both my boot.efi file and the grub.cfg live in this directory. You could try recreating this and see if it allows grub to find its config file automatically.
> 
> Good luck!


Thanks. I read your post AFTER I finally solved this mystery.
What I did was create a grub folder in the ESP and then copied grub.cfg into it. I also copied the x86_64-efi directory there too, after I had fixed the permissions.

Now, when I connect the USB drive, rEFInd spots it and I can boot straight into Ubuntu.
Having it on a USB HDD is so much more convenient than using a LIVE-CD on a flash drive, or boot Ubuntu into a VMWare virtual Machine.

I wish it was possible to boot Windows 7 this way.

----------


## aldarko

hello ..
i have not good experience with linux   :Wink: 
i have MacBook Pro 8.1 13-inch, Early 2011  
( Processor  2.3 GHz Intel Core i5  Memory  4 GB 1333 MHz DDR3  Graphics  Intel HD Graphics 3000 384 MB )
i have 4 native operating systems on it 
1- mac osx 10.8
2- windows 8
3-ubuntu-12.10-desktop-amd64+mac
4-backtrack 5 r3 64 bit gnome
i installed all the operating systems with no problem at all and i use refit boot loader to boot to each system
the ubuntu-12.10 installed all the drivers automaticaly i didn't install any extra drivers the Intel HD Graphics is working with the same native resolution on os x operating system 1280x800
the problem is 
on backtrack no drivers are installed so Intel HD Graphics is not giving me the native resolution 1280x800 it has to resolutions there 1024x768 & 800x600 the sound is not working to , the network allso not working i think the problem is that the backtrack has not efi booting but the new 12.10 ubuntu has it 
i thing i maybe able to merge files from ubuntu.iso with backtrack.iso to solve the problem
the problem is the ubuntu iso files are very complicated it has the following files
..................
boot > grub > loopback.cfg

isolinux > grub > grub.cfg
isolinux > grub > efi.img
isolinux > grub > x86_64-efi > grub.cfg
and many other files
syslinux > grub > grub.cfg    
syslinux > grub > efi.img
and many other files
syslinux > grub > x86_64-efi > grub.cfg
.................
so how can i merge ubunto files with backtrack files without problems and which grub.cfg to edit 
i tried google and backtrack forums but nothing helped
so could any body help here

----------

