Use CentOS 7 desktop on Dell Alienware 17

来源:互联网 发布:哗啦啦餐饮软件好用吗 编辑:程序博客网 时间:2024/06/06 19:44
Keywords: RHEL, RHEL 7, Linux on Alienware, UEFI on Linux, Optimus on RHEL, UEFI dual boot

CentOS team recently announced the availability of release 7, based on RedHat Enterprise Linux 7 (which is itself based on Fedora 19). The new release introduces massive number of package upgrades, new kernel and desktop features.

I recently purchased Dell Alienware 17 gaming laptop, planning to use Windows 8 for gaming and Linux for work and all other activities. The laptop comes with gorgeous 17inches anti-glare screen, 1TB hard drive + 80GB SSD, 32 GB main memory, Intel i7 4GHZ CPU with integrated HD graphics 4600, and a GeForce GTX 860M dedicated graphics card with 2GB of memory. It supports Nvidia Optimus technology to optimize power consumption by switching between dedicated and integrated graphics adapter.

Let the CentOS 7 journey begin.

# Firmware settings

Turn on the laptop and hold F2 button immediately to enter firmware settings.
Alternatively, hold F12 button to enter boot option menu and then choose to enter firmware settings.

The laptop comes with a 1TB conventional hard disk drive and an 80GB SSD. In the default firmware settings, Intel Rapid Storage Technology comes into play and use the two disks in an RAID-like setup (Windows only). The firmware supports three disk controllers – ATA, AHCI and RAID (default).

I decide to use the 1TB hard disk to Windows installation, media files and games, and use the SSD entirely for Linux installation, therefore in firmware settings I change disk controller from RAID (default) to AHCI, then Windows 8 must be re-installed.

Both Windows 8 and CentOS 7 have excellent UEFI support. Because the SSD is dedicated to Linux installation, therefore it is much easier and safer to continue using UEFI, there is absolutely no need to enable legacy firmware (BIOS).

In addition, the Alienware firmware supports “Windows 8 fast boot” which improves Windows startup time by delaying hardware initialization, although the feature works OK for Windows, but it does not play nice with CentOS 7 and must be disabled. If you forget to disable “Windows 8 fast boot”, your CentOS 7 will end up having unreliable keyboard/trackpad/WiFi connections.

# Prepare CentOS 7 installation media and start installation process

Download CentOS 7 DVD installation image (do NOT download live-desktop image), then copy it onto USB (use `dd` to write the entire installation image onto USB storage device). Alternatively burn it onto a DVD disc.
The DVD installation image is bootable on UEFI-firmware, therefore your USB or DVD disc will be usable on this Alienware laptop.

Once installation media is ready, power on the laptop and immediately hold F12 key in order to enter boot option menu. Choose your installation media and enter.

The laptop has two graphics adapters and CentOS 7 kernel does not play nice with them during installation stage, you will end up with a blank screen unless you append “nomodeset” to kernel command line. This special parameter must remain until graphics drivers are properly installed (will be addressed later).

Follow the screen instructions to complete installation. At disk partitioning stage, choose the SSD disk and remember to create an EFI partition with a recommended size of 200MB. You must also choose to install a desktop environment along with compiler tools (development tools) in order to install WiFi driver later on.

Note on EFI: We now have two EFI partitions, one created by Windows installation on the hard drive, and the other is created by CentOS installation on the SSD. The two operating systems are not aware of each other and absolutely do not interfere with each other. This is the most robust and easiest setup to allow dual boot Windows 8 and CentOS 7. There are more complicated and less reliable setups which allow Linux boot loader to load Windows, but that method will not be discussed here.

# Enter CentOS 7

Once installation is complete, reboot the laptop and hold F12 key to enter firmware boot menu – this is how we will switch to boot Linux or Windows. Choose CentOS and enter.

We have most hardwares working straight away – camera, trackpad, microphone and speaker.

After completing the last remaining setup steps, you are now in CentOS desktop! There are issues to resolve though:
- WiFi driver is missing
- Kernel “nomodeset” parameter prevents accelerated desktop graphics
- Backlight brightness is stuck on highest and cannot be adjusted

# Install WiFi driver

lspci command out identifies the WiFi adapter as:
Broadcom Corporation BCM4352 802.11ac Wireless Network Adapter
The chip is not yet supported by Linux 3.10 as shipped in CentOS and therefore the driver must be compiled and installed manually – and that is why you must install compiler tools at installation stage, if your Internet connection is WiFi only!

Actually I noticed that OpenSUSE already has packaged BCM4352 driver, but the RPM package cannot be used on CentOS.

So, on another computer, search for “Broadcom 802.11 Linux STA driver” and visit the official Broadcom download page(http://www.broadcom.com/support/802.11/linux_sta.php) to download 64-bit driver. The driver is a binary blob with a wrapper Linux kernel model written in C. As of July 2014, the kernel module source code is not compatible on Linux 3.10, and must be patched in order to work on CentOS 7.

Download the source code patch from Arch Linux AUR package “broadcom-wl” (https://aur.archlinux.org/packages/broadcom-wl/) and apply the patch files to the Broadcom driver, then run `make` and `make install`.

The Broadcom driver module depends on cfg80211 and lib80211 kernel modules, which must be enabled before enabling the Broadcom driver. To automatically enable Broadcom driver along with dependencies, append the following lines to /etc/rc.local

modprobe cfg80211
modprobe lib80211
insmod /lib/modules/<your_current_kernel_version>/kernel/drivers/net/wireless/wl.ko

Reboot and you will have WiFi!

Note that you do not need to re-compile the driver every time there is a kernel upgrade.

# Fix backlight brightness and graphics acceleration

There is a community supported repository ELRepo.org which packages additional (proprietary) graphics drivers and Bumblebee (Nvidia Optimus support). Visit ELRepo.org and follow the instructions to install the repository. Afterwards, run `yum install bumblebee` to install Intel, Nvidia drivers and Bumblebee for Optimus support.

Once it is done, edit /etc/defaults/grub to remove “nomodeset” from Linux command line, and append “acpi_backlight=vendor” to the command line. “nomodeset” prevents graphics acceleration from working. “acpi_backlight” settings is absolutely needed – without it you will get blank screen on next boot, and it is also needed to restore screen brightness control.

After saving edits to /etc/default.grub, run grub2-mkconfig to make it effective:
grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg

Then reboot.

# Verify graphics acceleration status

After a reboot, you should immediately notice a huge improvement on desktop graphics performance. To verify that acceleration is working on Intel HD graphics 4600, visit Gnome Settings “Details” and if you read “Graphics Intel Haswell Mobile”, then congratulations.

To selectively run programs using Nvidia high performance graphics, enter Terminal and type:
optirun <program name> <program arguments>

For example: optirun firefox

# What’s left

Now the desktop is already very functional and reliable, I have been running it for a while and have not run into any problems. It boots super fast thanks to the powerful CPU and SSD, runs as smooth as butter.

I have not figured out how to drive Bluetooth – but I do not use it much anyways.
0 0