Aug 9, 2013

GENTOO ON MAC BOOK PRO 8.1 - BCM4331 and ELSE

Previous STORY and GRUB2 EFI did not give me much problem, but BCM4331 was

Facing a struggle to Install Gentoo on Mac Book Pro 8.1, available home internet access is Just via WIFI, since I stay for long holiday in my sweet home at Banda Aceh, about 1824 km away from Bekasi where I live daily for working. In bekasi I have FastNet Premium Package and my home in Banda Aceh serv by Speedy Hotspot package. Mac Book Pro 8.1 equipped by BCM4331 wifi Adaptor and SysrescueCD 3.7.1 did Not pick up this chipset. I have no option rather then using a help from USB Wifi Adaptor, and luckily I have TP-LINKS TL-WN722N Powered by Atheros 9271 chipset , where Sysrescue CD 3.7.1 picked up nicely

Mac Book Pro 8.1 lspci out put :
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port (rev 09)
00:01.1 PCI bridge: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port (rev 09)
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Universal Host Controller #5 (rev 05)
00:1a.7 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 05)
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 05)
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b5)
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b5)
00:1c.2 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 3 (rev b5)
00:1d.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Universal Host Controller #1 (rev 05)
00:1d.7 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 05)
00:1f.0 ISA bridge: Intel Corporation HM65 Express Chipset Family LPC Controller (rev 05)
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 05)
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 05)
02:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM57765 Gigabit Ethernet PCIe (rev 10)
02:00.1 SD Host controller: Broadcom Corporation NetXtreme BCM57765 Memory Card Reader (rev 10)
03:00.0 Network controller: Broadcom Corporation BCM4331 802.11a/b/g/n (rev 02)
04:00.0 FireWire (IEEE 1394): LSI Corporation FW643 [TrueFire] PCIe 1394b Controller (rev 08)

Mac Book Pro 8.1 lsusb out put :
Bus 001 Device 002: ID 0424:2513 Standard Microsystems Corp. 2.0 Hub
Bus 001 Device 003: ID 05ac:8509 Apple, Inc. FaceTime HD Camera
Bus 002 Device 002: ID 0424:2513 Standard Microsystems Corp. 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 004: ID 0a5c:4500 Broadcom Corp. BCM2046B1 USB 2.0 Hub (part of BCM2046 Bluetooth)
Bus 001 Device 005: ID 05ac:0245 Apple, Inc. Internal Keyboard/Trackpad (ANSI)
Bus 002 Device 003: ID 05ac:8242 Apple, Inc. Built-in IR Receiver
Bus 001 Device 008: ID 05ac:821a Apple, Inc. Bluetooth Host Controller


I face big struggle in making BCM4331 working on gentoo Linux with Gentoo Sources 3.8.13 kernel. Various configuration tested and No lukcs, finally I deciced to borrow SysrescueCD 3.7.1 with version configuration kernel-3.9.10-alt371-amd64.conf compiled with TONS of Mdoules :-) and picked up BCM4331 nicely. After everything working well, we can gradually reduced un-necessary modules by recompiling the kernel. It was (I thing) easiest way and safe times to compile kernel in Mack Book Pro 8.1

To make BCM4331 wifi adaptor powered by Broadcom Chipset, we need to merge b43-firmware-5.100.138 and b43-fwcutter, at the point of time this pos wrote, the firmware Marked as unstable , emerging b43 firmware :
># echo "=sys-firmware/b43-firmware-5.100.138 ~amd64" >> /etc/portage/package.accept_keywords
># echo "net-wireless/b43-fwcutter ~amd64" >> /etc/portage/package.accept_keywords
># emerge sys-firmware/b43-firmware net-wireless/b43-fwcutter
THAT IT IS ... and Gentoo running on Mac Book Pro 8.1 nicely

Touch Pad
Touch Pad inlcuding right click and THREE FINGERS FUNCTIONALITY worked out of the box with configurations on /etc/portage/make.conf : INPUT_DEVICES="keyboard mouse sysnaptics evdev" and merge mtrack

Keyboard
Worked Out of The Box : Back Lights (in Kernel config), Volume, Brightness, Caps lock buttons ... I did not test other functions, since that's all what I need.

Build in Card Reader
Worked out of the box with Kernel Configurations :-) ... at the time of slimming kernel by recompiling, ensure card reader support keep enable

FB Splash : optional
Some persons prefer to know what happening during machine booting by seeing kernel decompression process. Someone who do like little eye candy by having boot splash linux users can use many of application like PLYMOUTH, USPLASH, XSPLASH and FB SPLASH (formerly Gensplash). I choose FB Splash since easier to be configured in Gentoo Linux
Merge splashutils with fbcondecor use flag (Just in case), configure kernel with fbcondecor support. Rebuild : libjpeg-turbo, libpng, libmng, zlib, lcms, freetype, bzip2 and jpeg packages with static-libs use flag for splash theme, I choose livedvd-12.0
/etc/portage/package.use
media-gfx/splashutils fbcondecor
=media-libs/libjpeg-turbo-1.3.0 static-libs
=media-libs/libpng-1.5.15 static-libs
>=media-libs/libmng-1.0.10-r1 static-libs
=sys-libs/zlib-1.2.7 static-libs
=media-libs/lcms-1.19 static-libs
=media-libs/freetype-2.4.11 static-libs
=app-arch/bzip2-1.0.6-r3 static-libs
=virtual/jpeg-0 static-libs
generate initramfs with theme you like mine is :splash_geninitramfs --verbose --res 1280x800 --generate /boot/initramfs-ldvd livedvd-12.0
EFI System will only boot with initramfs build in the kernel, thus rebuild your kernel, by appointing initramfs source uncompressed cpio
># cd /boot
># file initramfs-ldvd initramfs-ldvd: gzip compressed data, from Unix, last modified: Fri Aug 9 18:41:45 2013, max compression
(file is compressed in gzip mode, we need to uncompress)
># zcat initramfs-ldvd > initramfs-ldvd.cpio
Recompile kernel by appointing initramfs source file and changed kernel compression to Gzip, since most external initramfs compression today is in Gzip mode

Finalizing kernel compilation, copying kernel into /boot partition and install built module as usual :-)
Modify gurb2 configuration in /etc/default/grub
# Append parameters to the linux kernel command line for non-recovery entries
GRUB_CMDLINE_LINUX_DEFAULT="splash=silent,fadein,theme:livedvd-12.0 CONSOLE=/dev/tty1 quiet"
update grub -> mine to execute ># grub2-efiupdate (I create this scripts to make life easier)

Bingo ... !!!!!


Real Multilib Userland on Linux

Read multilib requirement on Android rom building and other stuff. About two years absent from getting rid with android rom. I have time to...