Tuesday, July 12, 2011

Centos 6 on Lenovo U165

Continuing my last blog post on how the heck you install Centos 6 I'm going to detail in this one the experience and magic that one needs to do in order to tame the beast on ones laptop. First thing first, we need one or more points of reference and that would be why is this laptop so special and what I expect to work and to do with it.

So making it special are amd cpu (and all that comes with it) but mainly the wireless adapter that has the BCM4313 chipset, and the ATI HD 4200 video card.
For the more curios types below is a lspci:

00:00.0 Host bridge: Advanced Micro Devices [AMD] RS780 Host Bridge Alternate
00:01.0 PCI bridge: Lenovo Device 9602
00:04.0 PCI bridge: Advanced Micro Devices [AMD] RS780 PCI to PCI bridge (PCIE port 0)
00:05.0 PCI bridge: Advanced Micro Devices [AMD] RS780 PCI to PCI bridge (PCIE port 1)
00:11.0 SATA controller: ATI Technologies Inc SB700/SB800 SATA Controller [AHCI mode]
00:12.0 USB Controller: ATI Technologies Inc SB700/SB800 USB OHCI0 Controller
00:12.2 USB Controller: ATI Technologies Inc SB700/SB800 USB EHCI Controller
00:13.0 USB Controller: ATI Technologies Inc SB700/SB800 USB OHCI0 Controller
00:13.2 USB Controller: ATI Technologies Inc SB700/SB800 USB EHCI Controller
00:14.0 SMBus: ATI Technologies Inc SBx00 SMBus Controller (rev 41)
00:14.2 Audio device: ATI Technologies Inc SBx00 Azalia (Intel HDA) (rev 40)
00:14.3 ISA bridge: ATI Technologies Inc SB700/SB800 LPC host controller (rev 40)
00:14.4 PCI bridge: ATI Technologies Inc SBx00 PCI to PCI Bridge (rev 40)
00:18.0 Host bridge: Advanced Micro Devices [AMD] Family 10h Processor HyperTransport Configuration
00:18.1 Host bridge: Advanced Micro Devices [AMD] Family 10h Processor Address Map
00:18.2 Host bridge: Advanced Micro Devices [AMD] Family 10h Processor DRAM Controller
00:18.3 Host bridge: Advanced Micro Devices [AMD] Family 10h Processor Miscellaneous Control
00:18.4 Host bridge: Advanced Micro Devices [AMD] Family 10h Processor Link Control
01:05.0 VGA compatible controller: ATI Technologies Inc M880G [Mobility Radeon HD 4200]
01:05.1 Audio device: ATI Technologies Inc RS880 Audio Device [Radeon HD 4200]
02:00.0 Ethernet controller: Atheros Communications AR8131 Gigabit Ethernet (rev c0)
03:00.0 Network controller: Broadcom Corporation BCM4313 802.11b/g LP-PHY (rev 01)

Great so what I would expect to work/do with this laptop. Basic things like:

- sound which i'll like to mention works out of the box;
- wireless adaptor which does not work out of the box;
- ati video card which partially works - meaning no hw acceleration;
- flash player with Mozilla FF (I know this is not supplied by default - legal issues);
- reading external hard drives with ntfs filesystems, this one was a surprise not to work out of the box as I was spoiled with it for such a long time by Fedora;
- and ofc watching videos;

Ok since that is out of the way, the magic to get everything working :

1. Wireless Broadcom Corporation BCM4313 802.11b/g LP-PHY (rev 01)
Normally this would of been a quick fix if rpmfusion had the packages in place for Centos 6, installing with yum either the akmod or kmod packages is trivial and gets detailed very well here.

But crap this was not the case (even thou C6 was half a year late) that one shocked me - to see rpmfusion empty. Don't worry about the rivals like rpmforge as they don't fair brilliantly either.

Manual compilation it is http://wiki.centos.org/HowTos/Laptops/Wireless/Broadcom , following the link here i did this steps:

mkdir -p /usr/local/src/hybrid-wl
cd /usr/local/src/hybrid-wl
tar -xzvf hybrid-portsrc_x86_64-v5_100_82_38.tar.gz (latest driver from here)
chown -R someuser.somegroup /usr/local/src/hybrid-wl
cd /usr/local/src/hybrid-wl
make -C /lib/modules/`uname -r`/build/ M=`pwd`


strip --strip-debug wl.k

For some reason for me it didin't work any of the steps to insert the module without a restart so i used modprobe.conf because it felt right :).

[root@host hybrid-wl]# cp -vi /usr/local/src/hybrid-wl/wl.ko /lib/modules/`uname -r`/extra/

Edit the /etc/modprobe.d/blacklist file adding the lines: blacklist bcm43xx
blacklist ndiswrapper
blacklist b43
blacklist b43legacy

Now, edit the /etc/modprobe.d/modprobe.conf.dist file and add the following lines to it (in some cases, the following may not be necessary):
alias ieee80211_crypt_tkip ieee80211_crypt_tkip
alias eth1 wl
And again because it felt the right way to do (don't know if does anything) I created  a modprobe.conf file inside of the directory /etc/modprobe.d with only this line inside: alias eth1 wl

Rebooted the system, disconnected the cable and I needed to add the home AP by hand.



The next one I fixed was the ntfs e-sata HDD. Why the heck ntfs is not present by default is beyond me. And YES servers need to read/write ntfs to, as you often are presented with the situation that you send a data center engineer to stick some usb drive inside just to find out it is the wrong filesystem and you need to format the poor fellows data :).

2. NTFS-3G and Centos 6
just : yum install ntfs-3g -y and this will get the package found in epel. (What you don't have epel installed, fix it here)

3. AMD Catalyst™ 11.6 Proprietary Linux x86 Display Driver on Centos 6
Because I did not mentioned this at the wireless card instalation I installed the following :

yum install kernel-headers kernel-devel gcc

The next thing I did I downloaded the latest proprietary drivers from here , and then just as an normal user executed the script. It asked me for the root password did his automatic thing and expressed himself as successful installation - yes very strange. Rebooted the system one more time just to see that the nice plymouth boot circles were replaced by the blue boot bar (success - so painless ?).



Regarding the above picture - yes I'm lame :). As I will find later on, running proprietary drivers has a price, so I will detail this step as a partial victory.

4. Flash Player 10 on Centos 64 bit Firefox 3.6.9 some pointers here, so:
cd /tmp
wget http://download.macromedia.com/pub/labs/flashplayer10/flashplayer10_2_p3_64bit_linux_111710.tar.gz
tar -xzvf flashplayer10_2_p3_64bit_linux_111710.tar.gz
mv /tmp/libflashplayer.so /usr/lib64/mozilla/plugins/


5. Moving on to the codes, they are not available in rpmfusion :( so no joy here.

Two last things I want to rant about are the fact that there is no transmission nor deluge just ctorrent for your p2p jobs, and the price of running ATI proprietary drivers is not been able to resume after suspend.

5 comments:

  1. Hi.

    Keep in mind that CentOS is just a free copy of the distro intended for Servers, not desktops and Laptops. There is possibility of some kind of official desktop spin-off that you have third party repos already installed, but for now it is just that, a possibility.

    ATI: ElRepo repository has ATI drivers already compiled: http://elrepo.org/tiki/kmod-fglrx, beside numerous other drivers.

    Broadcom: ElRepo also has source rpm for building drivers in form of rpm, but you must compile it by your self since Broadcom has strict license. They do however have detailed instructions how to compile them.

    Flash: Adobe also has repository with rpm's which you can install (repository) from this page: http://get.adobe.com/flashplayer/completion/?installer=Flash_Player_10.3_for_other_Linux_%28YUM%29, no need to compile them your self.

    ReplyDelete
  2. @Adrian: i think ntfs has also legal/patent problems, this is why is not included in "enterprise" distros, and also due to legal problems your run it in user space, not kernel space.

    @Ljubomir: RHEL is sold in both "server" and "workstation" flavours.

    ReplyDelete
  3. @nicu: Yes, but "Workstation" still implies work environment, not Home PC's. You do not need NTFS if you use only RHEL's in your company and admins are only ones allowed to change anything. And since Red Hat is responsible for problems (if you use RHEL and pay for support), so their job is to controll environment your system is in, and that excludes even mentioning third party repositories.

    ReplyDelete
  4. ahem... http://www.redhat.com/rhel/desktop/ and don't get me started on the GNOME Shell, that is developed by Red Hat people. probably the default in RHEL 7 and screaming "entry level desktop!"
    ...so if you do desktop, it should be done right, starting with drivers, not with useless GUIs.

    ReplyDelete
  5. @Ljubomir I know that C6 is not a desktop oriented distro, but been built after F13/14 my guess is that it's going to do a good job. Thank you for the tip about ElRepo i was banking everything on rpmfusion.

    ReplyDelete