Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Mac OS X && Gentoo
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
ChinaUA
n00b
n00b


Joined: 30 Oct 2013
Posts: 7

PostPosted: Fri Nov 08, 2013 11:26 pm    Post subject: Mac OS X && Gentoo Reply with quote

Hi!

I have an idea to install a Gentoo parallel to my Mac OS. Want to know if it possible. So I have now two OS on my MacBook Pro - Mac OS X and Windows 7 (booting throught Boot Camp). My question is how to install a Gentoo? Should I use a grub boot loader or can I use a Boot Camp to boot a gentoo? Or perhaps somebody has some experience in this question?
Back to top
View user's profile Send private message
xineg
Tux's lil' helper
Tux's lil' helper


Joined: 14 Mar 2006
Posts: 115
Location: Australia.

PostPosted: Sat Nov 09, 2013 1:23 am    Post subject: Reply with quote

This is a very quick guide:

Ok, there are lots of ways to do this, my favourite way, and a good way to test differing setups is to get a grub2 boot disk.
First in OSX use diskutil to create a partition or partitions for linux, I have some 9 partitions sda1-sda9, so you can boot as many operating systems as you want this way. Now burn a copy of the grub2 boot disk and a livcd of your choice, system rescue cd, arch linux etc, for installation.
Now the copy of the live cd of your choice, To do this put live cd in macbook cd rom drive and turn off, then turn on and hold the 'c' key untill the live cd boots.
INTERNET
For internet ill assume your using wifi? if so make use of wpa_supplicant, when the livecd has booted create a config file called say file.conf in /[/quote]etc
Code:

nano /etc/file.conf

in it put this
Code:

ctrl_interface=/var/run/wpa_supplicant

fast_reauth=1


network={
        ssid="Your SSID that is name of your wifi router"

        psk="put your psk password in here"
        priority=5
}

now to start your wifi use
Code:

wpa_supplicant -Dwext -i wifi_card_devic_name -c /etc/file.conf -B

then run dhcp to get an ip address from your router using
Code:

dhcpcd wifi_card_device_name_here

Now you should have internet, linux booted, and a partition ready to install gentoo
the partition will show up as
Code:

/dev/sdaX

Just install gentoo as normal onto partition, except when you get to install a bootloader, just ignore that entire section. When your done installing just shutdown -h now. To boot gentoo, grab that grub2 boot disk that you burned earlier put it into the cdrom drive of the macbook , turn on holding the 'c' key and you will get the grub2 boot prompt that looks like this
Code:

grub2>

to boot gentoo type the following
Code:

linux (hd0,gptX)/boot/kernel_name root=/dev/sdaX ro <enter>

Where X is the number of your disk, if it was sda5 then X = 5. All grub2 commands will work, you can even setup a grub2 config on your partition to load if you wanted to keep using the cdrom as a bootloader.
They are most of the gotchas, this way to setup is the same for most situations however except for the bootloader, refit etc, if you have any questions dont hesitate to ask. However with internet working a cdrom bootloader and a partition you will probably find you can work most things out yourself anyway.
Back to top
View user's profile Send private message
c00l.wave
Apprentice
Apprentice


Joined: 24 Aug 2003
Posts: 264

PostPosted: Sun Nov 10, 2013 2:19 pm    Post subject: Reply with quote

Triple boot stopped working for me with updating OS X from 10.6 to 10.9. Big fat warning: DO NOT UPGRADE FROM 10.6!

Previously, only sda1-3 were used by OS X and Windows/Bootcamp and I could easily use sda4 for Gentoo. rEFIt was used to get a multi-boot screen on EFI. Additionally, I was using a hybrid MBR to still use GRUB "Legacy" since I was unable to get GRUB2 running on any system I tried so far (rEFIt cannot boot Linux directly). The only trick required in that setup was that sda4 had to be the same in both GPT and MBR or rEFIt would fail starting GRUB (and instead load Windows from sda3). Windows unfortunately needs a MBR partition because GPT support is only available when booting in EFI mode (no idea what they were thinking...). But as I only needed 4 MBR partitions to boot, I was fine.

Unfortunately, some OS X version between 10.7 and 10.9 introduced a new partition sda4 called "Recovery HD" in GPT which shows up as sda4 "Darwin boot" on fdisk (hybrid MBR). Since hybrid MBRs can only use primary partitions and I need to install the bootloader to a MBR partition that corresponds to GPT numbering I'm unable to boot via GRUB now as Windows needs its own bootloader and so I'm not able to setup dual-boot Windows/Gentoo via GRUB from the now sda4 called partition (former sda3). :( (screen shows "No bootable device -- insert boot disk and press any key")

I'm currently trying to fix my triple boot setup but without success. The idea is to try installing GRUB 2 on sda5 (my Gentoo rootfs partition, former sda4), hoping that rEFIt will pick it up and be able to boot from it (not sure if that even works or rEFIt expects a MBR partition). The problem is, grub2-install --force /dev/sda5 does not install because - although I used --force - it does not want to use blocklists to install (which is required for booting from a partition). So I'm stuck without a boot loader at the moment (as always when trying GRUB2).

Any recommendations on how to fix that? Maybe some other bootloader? (syslinux may or may not work with GPT, LILO is uncertain as well? Any other bootloaders that I missed?)

Edit: I may have misread the warning messages of grub2-install, it actually pretends being done with installation ("installation finished") but I'm still stuck on "No bootable device -- insert boot disk and press any key" (which doesn't do anything, I always have to power-cycle the notebook).
_________________
nohup nice -n -20 cp /dev/urandom /dev/null &
Back to top
View user's profile Send private message
srs5694
Guru
Guru


Joined: 08 Mar 2004
Posts: 434
Location: Woonsocket, RI

PostPosted: Sun Nov 10, 2013 3:10 pm    Post subject: Reply with quote

First, every new OS you add to a multi-boot setup complicates matters. This is especially true on a Mac when using BIOS/legacy-mode booting because of hybrid MBR issues. Thus, you might want to consider using a virtual machine to run one or more of your OSes. Personally, I'd put Windows in the VM, if at all possible, because that will enable you to skip the hybrid MBR and BIOS/legacy-mode boot complications entirely.

Second, the problems to which c00l.wave referred can be avoided by setting up your hybrid MBR in a sensible way rather than relying on the extremely limited method used by Boot Camp and rEFIt's gptsync program. In particular, you can use gdisk to set up a hybrid MBR that contains only the Windows partitions, skipping the OS X and (if present) Linux partitions. That said, Windows can be pretty finicky, so changing the hybrid MBR if it already works might cause Windows to stop booting. Windows tools should be able to fix it, but I'm not an expert on Windows installation or boot repair.

Finally, IMHO using GRUB 2 as a boot loader on a Mac is setting yourself up for trouble. GRUB 2 is overly complex to begin with, and the added complexity of a hybrid MBR and a triple-boot setup is just too much. Instead, look into booting Linux in EFI mode and using an EFI boot loader other than GRUB 2. I find that the EFI stub loader (included in 3.3.0 and later kernels) works well, but it requires a flexible boot manager to be practical. My rEFInd boot manager, which is a fork of the now-abandoned rEFIt, can launch the kernel with EFI stub loader directly, and it can also switch to BIOS/legacy mode for booting Windows. (The simpler gummiboot might be an acceptable option if you don't need to boot any BIOS/legacy OSes.) Thus, using rEFInd and ensuring that you've compiled EFI stub support into your kernel should do the trick. See the rEFInd documentation, and particularly its page on booting Linux, for details. I've also written a page on installing Ubuntu in EFI mode on Macs. It's not 100% applicable to Gentoo, of course, and even for Ubuntu it's a bit out of date, but it might be worth reading nonetheless.
Back to top
View user's profile Send private message
c00l.wave
Apprentice
Apprentice


Joined: 24 Aug 2003
Posts: 264

PostPosted: Sun Nov 10, 2013 5:31 pm    Post subject: Reply with quote

Thanks, srs5694! It almost works with rEFInd but graphics freeze after "Using load options [...]". I don't see early kernel messages, I don't see later kernel messages (after graphics mode is usually set up), I don't see init and I don't get any graphics after X.org tried to start (using proprietary Nvidia modules, failing to initialize). Removing the uvesafb kernel option doesn't help either. Same problem in 3.10.7 and 3.12.0 (with that new generic FB mapping option and simplefb both enabled). Backlight controls via pommed don't work either, keyboard light does (so I don't appear to have any issue with pommed or the keyboard). SSH works, the rest of the system appears to be up but I see a strange stack trace from applesmc in kernel log (although I'm almost sure it was there before when everything else worked fine). Nvidia module logs: "failed to copy vbios to system memory". Nvidia modules are at latest version (331.20).

Judging from what I can find via a quick Google search (I'm slowly loosing my patience, 5 hours into that booting issue), it looks like I need to use GRUB 2 which implements some workaround for a missing video BIOS setup. So I'm back where I started... I'm stopping now for today before it gets even worse.

Why, oh why, did manufacturers ever turn to that buggy, unnecessary mess that is EFI?!...
_________________
nohup nice -n -20 cp /dev/urandom /dev/null &
Back to top
View user's profile Send private message
srs5694
Guru
Guru


Joined: 08 Mar 2004
Posts: 434
Location: Woonsocket, RI

PostPosted: Sun Nov 10, 2013 10:09 pm    Post subject: Reply with quote

c00l.wave wrote:
Thanks, srs5694! It almost works with rEFInd but graphics freeze after "Using load options [...]"... SSH works, the rest of the system appears to be up


There are a number of video issues with EFI-mode booting and graphics. Sometimes adding a kernel option fixes the problem. The "nomodeset" option is the one that's most likely to work. Others tend to be specific to particular chipsets, computers, and even video drivers, and I'm afraid I haven't been keeping tabs on what these specific solutions are. Perhaps a Web search that includes "nomodeset" will turn up some of these options, though, since many of the discussions I see bring up this option at some point.

c00l.wave wrote:
Judging from what I can find via a quick Google search (I'm slowly loosing my patience, 5 hours into that booting issue), it looks like I need to use GRUB 2 which implements some workaround for a missing video BIOS setup.


It is possible to chainload either the BIOS or the EFI version of GRUB 2 from rEFInd, much as you can do the same from rEFIt. This adds complexity, of course, so if at all possible I recommend booting a kernel via the EFI stub loader instead; but if GRUB 2 can work around your video problems, that may be the way to go.

Quote:
Why, oh why, did manufacturers ever turn to that buggy, unnecessary mess that is EFI?!...


Because EFI is necessary. BIOS is 30 years old and is burdened by a design that's hobbling future hardware development. Also, Microsoft refuses to support booting from GPT disks in BIOS mode, which makes continued use of BIOS with large disks impractical. (Of course, you can argue that Microsoft should support BIOS-mode booting from GPT, but Microsoft can be more stubborn than a 4-year-old presented with broccoli.) EFI reduces boot times and makes the boot process much saner. The main problem, IMHO, is that it's been pushed out too quickly, which has created problems with bugs, both in EFI implementations themselves and in other (especially open source) software. I expect things will settle down a lot in a few months.
Back to top
View user's profile Send private message
c00l.wave
Apprentice
Apprentice


Joined: 24 Aug 2003
Posts: 264

PostPosted: Mon Nov 11, 2013 10:52 pm    Post subject: Reply with quote

Finally managed to somehow get at least the text console on screen. X.org still won't run though.

I had to compile GRUB 2 into an image file that I stored as /boot/grub.efi on my rootfs (wanted to put it on the EFI partition but mounting it from Linux, it appears to contain only 3 Apple files from 2008-2010?!). rEFInd automagically picked GRUB up. Unfortunately, I don't seem to be able to add any menu config (and, despite the lack of any documentation about configuring it manually, Gentoo also doesn't appear to automagically configure it to list my kernels by running grub2-mkconfig). So I'm currently re-typing GRUB commands each time I try to boot but hey, at least I can boot now.

As nice as a text console is but I really need full graphics support. The workaround I thought I had found was to add the fakebios command in GRUB 2 before booting. I'm not sure if it even does anything but printing "ROM image is present." (after all, there's no such module available for inclusion, I just added "loadbios" module because it was the only thing remotely similar to "fakebios"). It doesn't seem to make any difference if I run it or don't. Nvidia kernel log entries still look the same as before, no change. "fakebios" is not necessary to get a text console.

Running non-EFI kernels from GRUB 2 doesn't seem to work (completely black screen and no keyboard).
_________________
nohup nice -n -20 cp /dev/urandom /dev/null &
Back to top
View user's profile Send private message
c00l.wave
Apprentice
Apprentice


Joined: 24 Aug 2003
Posts: 264

PostPosted: Sat Nov 16, 2013 3:59 pm    Post subject: Reply with quote

I think I got it working now. It appears that nvidia-drivers are incompatible with MacBook Pros booted in EFI mode. Nouveau works, but only if compiled into the kernel (if compiled as module, udev hangs indefinitely on boot). I'm not sure if EFI Framebuffer had anything to do with it as well, I enabled it when I found it. In case nvidia-drivers was used before, do not forget to eselect opengl and, even better, uninstall nvidia-drivers and -settings. Else, KDE will run rampage and try to load nvidia DRM stuff in a loop it cannot break, slowing down the whole system with high load. Booting now also works directly from rEFInd (although the early messages do not show up on screen and the Tux CPU icons are messed up), so no need for GRUB 2 (which I still didn't manage to install correctly). Backlight controls work, WiFi (via broadcom-sta) works, sound works. So it appears everything is fine - just don't expect 3D or video to perform at top speeds, though I haven't tested real 3D applications yet. It's fine for desktop use, however.
_________________
nohup nice -n -20 cp /dev/urandom /dev/null &
Back to top
View user's profile Send private message
srs5694
Guru
Guru


Joined: 08 Mar 2004
Posts: 434
Location: Woonsocket, RI

PostPosted: Tue Nov 19, 2013 5:07 am    Post subject: Reply with quote

I'm glad to hear you've gotten it working. FWIW, I'm not a fan of the proprietary Nvidia or AMD/ATI drivers -- both of them tend to cause more problems than their open source counterparts, in my experience. That said, I know that they're useful, and perhaps even necessary, for some applications, but not for anything I do. (I'm typing this on a computer that uses the open source AMD/ATI drivers, FWIW.)
Back to top
View user's profile Send private message
c00l.wave
Apprentice
Apprentice


Joined: 24 Aug 2003
Posts: 264

PostPosted: Tue Nov 19, 2013 1:23 pm    Post subject: Reply with quote

I've had a little setback: The system works fine at first but after a few hours of work, nouveau starts logging a lot of errors concerning failed function calls, page faults and failed texture access. Graphics become totally corrupted (dotted lines everywhere, black areas on screen) and freeze. USB input devices lock up as well. Switching to console works partly but is increadibly slow and corrupted as well. I can still connect via SSH; everything still works, except graphics.

Since I had the same errors yesterday, I decided to delete the "Recovery HD" partition from GPT and MBR and boot via GRUB Legacy in BIOS mode again, using the proprietary drivers. If the system works stable from now on, either GeForce 8600M GT isn't officially supported by nouveau or Apple did break something again. If the system is still unstable, there may be some other error, maybe even a hardware problem (I easily get suspicious if I read about crashes caused by page faults where none should be; seen too many bad RAM modules so far).

I never had stability problems using the official, proprietary Nvidia drivers (GF4Ti, 8800 GT); not sure what problems are often being referred to when it comes to nouveau vs. Nvidia modules.
_________________
nohup nice -n -20 cp /dev/urandom /dev/null &
Back to top
View user's profile Send private message
c00l.wave
Apprentice
Apprentice


Joined: 24 Aug 2003
Posts: 264

PostPosted: Tue Nov 19, 2013 6:45 pm    Post subject: Reply with quote

It got worse today. Graphics now corrupt at random in Linux, OS X, even in rEFInd. BIOS mode won't boot any more. OS X likes to fall into a boot loop due to early kernel panics but eventually manages to launch after numerous retries. Same for Linux, what I can read when booting in EFI mode says "dri [...] panic". On last crash before complete corruption, nvidia modules logged failed memory as well, together with "GPU dropped off the bus" or similar. Tried resetting everything I can, no change. That notebook seems unusable now, not sure what bricked it (Linux in EFI mode, nouveau or maybe just a random hardware failure).
_________________
nohup nice -n -20 cp /dev/urandom /dev/null &
Back to top
View user's profile Send private message
srs5694
Guru
Guru


Joined: 08 Mar 2004
Posts: 434
Location: Woonsocket, RI

PostPosted: Wed Nov 20, 2013 7:57 pm    Post subject: Reply with quote

Your latest symptoms sound like a hardware fault to me. I recommend you run a memory tester, and maybe test other hardware components, too. Memtest86+ is a popular tester. There's even an experimental EFI beta version, and if you install it under the correct name, rEFInd will recognize it and give it a second-row icon.
Back to top
View user's profile Send private message
c00l.wave
Apprentice
Apprentice


Joined: 24 Aug 2003
Posts: 264

PostPosted: Thu Nov 21, 2013 10:44 pm    Post subject: Reply with quote

I'm almost sure I have the known Nvidia manufacturing problem, that model (A1260, early 2008) sometimes had. It also looks to me like defective video RAM but from what I could find, the manufacturing error looks exactly the same.

I'm not sure why I got it only now but I suspect it could have to do with heat: Each time I compiled something in Linux I made sure that I put the fans to 6000RPM manually. However, since newer kernels finally seem to have managed to perform fan control on their own (which appears not to be implemented in hardware on Apple computers, unfortunately), I didn't do that the last times. The notebook was incredibly hot when I turned it off (even more than usual), so I guess I could have caused some already flaky soldering to fail under excessive heat. Fans were running mid-high (I guess about 5000 RPM), though. Strangely, the notebook ran fine again yesterday but then refused to boot today. Now it decided to boot again but immediately shows scrambled graphics. I let MemTest86 run but it didn't find anything. I was surprised to see it clear the corrupted graphics on boot, however. Unfortunately, screen scrambled again midway through the tests with no errors reported by MemTest.

I'd like to think it's pure coincidence that this happened while running Linux, maybe it helped the error to develop by having slightly more heat than usual. I haven't heard about someone breaking a MBP using nouveau before. It surely would be known if such a problem exists, so it's more likely I just had bad luck with a logic board again (already had a lot of "fun" with my old iBook G4 before I got the MBP).
_________________
nohup nice -n -20 cp /dev/urandom /dev/null &
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum