# No keyboard support in kernel? (Macbook Pro)

## emil.s

Hello!

I am trying to install Gentoo (And WIndows)  on my Macbook Pro. (With Core 2 Duo). But when Gentoo have started and the login screen comes up the keyboard is not work, so I can't login...  :Sad: 

But i can ping the ethernet, so it's not frozen.

I have folowed this tutorials:

http://wiki.onmac.net/index.php/Triple_Boot_via_BootCamp

http://gentoo-wiki.com/Macbook

http://gentoo-wiki.com/Gentoo_MacOSX_MacBook_Pro_Dual_boot

Here is how i compiled the kernel:

In chrooted gentoo:

```
livecd / # cd /usr/src/

livecd src # tar -xf /root/linux-2.6.18.tar.bz2

livecd src # ln -s linux-2.6.18/ linux

livecd src # cd /root/mactel-patches-2.6.18/

livecd mactel-patches-2.6.18 # ./apply /usr/src/linux

/root/mactel-patches-2.6.18/usbhid.patch would not apply cleanly              <--- !?

livecd mactel-patches-2.6.18 # cd /usr/src/linux

livecd linux # wget -O config-macbook-blscreen http://omnibus.uni-freiburg.de/~s8rasand/config

--15:04:43--  http://omnibus.uni-freiburg.de/~s8rasand/config

           => `config-macbook-blscreen'

Resolving omnibus.uni-freiburg.de... 132.230.1.183

Connecting to omnibus.uni-freiburg.de|132.230.1.183|:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 39,666 (39K) [text/plain]

100%[=======================================================>] 39,666        54.02K/s

15:04:44 (53.88 KB/s) - `config-macbook-blscreen' saved [39666/39666]

livecd linux # cp config-macbook-blscreen .config

livecd linux # make oldconfig

...

...

...

= No problems or errors. :)

livecd linux # make && make modules_install

...

...

...

No problems or errors....

livecd linux # make install

sh /usr/src/linux-2.6.18/arch/i386/boot/install.sh 2.6.18 arch/i386/boot/bzImage System.map "/boot"

In order to use the new kernel image you have just installed, you

will need to reboot the machine.  First, however, you will need to

either make a bootable floppy diskette, re-run LILO, or have GRUB

installed.

Checking for ELILO...No

which: no grub in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/i386-pc-linux-gnu/gcc-bin/4.1.1:/sbin:/usr/sbin)

Checking for LILO...Yes, on /dev/sda3

Should I run /sbin/lilo? (y/N) y

Added Linux *

*Edited lilo.conf*

livecd linux # cat /etc/lilo.conf

# Lilo config file.

#

boot=/dev/sda3

timeout=10

default=Linux

#

# Kernel specific LILO settings

#

image=/boot/vmlinuz-2.6.18

#

# Uncomment the next line if your MacBook locks up

# during boot with an APIC-related error message

# or if you see strange keyboard problems (double-chars).

#

#append="noapic acpi=force irqpoll"

label= Linux

read-only

root=/dev/sda3

livecd linux # exit

livecd ~ # reboot

```

I don't know, but can this be the problem?:

```
/root/mactel-patches-2.6.18/usbhid.patch would not apply cleanly 
```

And how did i solve it if it is that?

Thanks /Emil.   :Smile: 

----------

## emil.s

Now i found this tread:

https://forums.gentoo.org/viewtopic-t-512802-highlight-macbook+pro.html

But it's still the same problem...

A picture:

http://img96.imageshack.us/img96/5387/macbooken002nm0.jpg

A video:

http://video.google.com/videoplay?docid=-310934017446435717

Someone who know?

----------

## justwantstohelp

Did you add usbhid & appletouch to /etc/modules.autoload.d/kernel-2.6 (in that order)? Or did you compile those into the kernel?

----------

## emil.s

 *justwantstohelp wrote:*   

> Did you add usbhid & appletouch to /etc/modules.autoload.d/kernel-2.6 (in that order)? Or did you compile those into the kernel?

 

Yes I have.

But if you look at my first post:

```
/root/mactel-patches-2.6.18/usbhid.patch would not apply cleanly
```

And here is what's happening:

http://img146.imageshack.us/img146/1283/macbookensh9.jpg

How can i solve it?

But how could the live CD kernel work? I don't think it's patched for macbook...

----------

## m4rs

Hello Emil,

I tryed these patch for 2.6.18 and I had to : 

rename usbhid.patch to usbhid.bak

./apply ../linux-2.6.18

patch myself hid-core.c & hid.h

compile kernel

reboot

and it worked !

Cyrille

----------

## emil.s

 *m4rs wrote:*   

> Hello Emil,
> 
> I tryed these patch for 2.6.18 and I had to : 
> 
> rename usbhid.patch to usbhid.bak
> ...

 

Thanks!  :Smile: 

But about the patch... "patch myself hid-core.c & hid.h"

Just "patch -p1 /somewere/usbhid.patch /usr/src/linux"? Or "patch -p1 usbhid.patch /path/to/hid-core.c"?[/bug]

----------

## m4rs

for the patch what I did was : 

cd /usr/src/linux

patch -p1 < ../mactel-patches-2.6.18/usbhid.bak

it says he fails to patch two files : hid.h and hid-core.c

I emerged vim  :Wink:  opened hid.h and hid.h.rej, saw where it failed, made the changes, and did the same for hid-core.c (it's easyer than it seems), reboot and voila

----------

## emil.s

Now i have downloaded the 2.6.18.3 linux kernel. And "./apply" works!  :Smile: 

No errors.  :Smile: 

Byt the keyboard is sill out function...

----------

