Tuesday, 25 January 2011

How to compile a kernel from kernel.org in Fedora 14

This quick guide will show you how to compile and install a kernel from kernel.org in Fedora 14.

Start


Open a terminal and work through the below list of commands. Modify where appropriate.


Install the following packages

su -c 'yum install rpmdevtools yum-utils gcc make ncurses-devel'

Setup your build environment

rpmdev-setuptree

Download and extract your Kernel source

cd ~/rpmbuild/SOURCES

wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.37.tar.gz

tar -xf linux-2.6.37.tar.gz

Configure and Compile it

cd linux-2.6.37

make menuconfig

export CONCURRENCY_LEVEL=3

time make rpm

General rule for concurrency level = number of processor cores + 1


Install it

cd ~/rpmbuild/RPMS/x86_64

su -c 'rpm -ivh --force kernel-2.6.37-1.x86_64.rpm'

cd /boot

su -c 'mkinitrd initramfs-2.6.37.img 2.6.37'

su -c 'vi grub/grub.conf'

Fedora 32-bit users replace x86_64 with i386

Edit your grub.conf file and add an entry for your new kernel. Just copy your first kernel entry and modify it.

Note: Please do not copy this grub.conf, it is for illustrative purposes only.

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You do not have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /, eg.
#          root (hd0,0)
#          kernel /boot/vmlinuz-version ro root=/dev/sda1
#          initrd /boot/initrd-[generic-]version.img
#boot=/dev/sda1
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu

title Fedora (2.6.37)
        root (hd0,0)
        kernel /boot/vmlinuz-2.6.37 ro root=UUID=162b11c2-d9a1-4487-86d5-6ade5c5ee055 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=uk rhgb quiet
        initrd /boot/initramfs-2.6.37.img

title Fedora (2.6.35.10-74.fc14.x86_64)
        root (hd0,0)
        kernel /boot/vmlinuz-2.6.35.10-74.fc14.x86_64 ro root=UUID=162b11c2-d9a1-4487-86d5-6ade5c5ee055 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=uk rhgb quiet
        initrd /boot/initramfs-2.6.35.10-74.fc14.x86_64.img

title Fedora (2.6.35.6-45.fc14.x86_64)
        root (hd0,0)
        kernel /boot/vmlinuz-2.6.35.6-45.fc14.x86_64 ro root=UUID=162b11c2-d9a1-4487-86d5-6ade5c5ee055 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=uk rhgb quiet
        initrd /boot/initramfs-2.6.35.6-45.fc14.x86_64.img

title Other
        rootnoverify (hd0,4)
        chainloader +1

Boot from your new kernel


Restart your system and enjoy your new kernel.

Sunday, 23 January 2011

Ubuntu 10.x Firefox font rendering fix for Gnome

As a Ubuntu user you may notice Firefox does not obey the Gnome Appearance Setting with respect to the font rendering.

To make Firefox match your Gnome font rendering setting, simply erase the following file links in the /etc/fonts/conf.d folder

10-antialias.conf
10-hinting.conf
10-hinting-slight.conf

In a terminal type,

cd /etc/fonts/conf.d

sudo rm 10-*.conf


Restart Firefox for the changes to take effect.

How to restore the symbolic links

sudo ln -s /etc/fonts/conf.avail/10-antialias.conf /etc/fonts/conf.d/
sudo ln -s /etc/fonts/conf.avail/10-hinting.conf /etc/fonts/conf.d/
sudo ln -s /etc/fonts/conf.avail/10-hinting-slight.conf /etc/fonts/conf.d/

Friday, 21 January 2011

How to prepare your Windows disk for a Ubuntu installation

By default Ubuntu will install itself alongside your Windows partition and create a dual boot system, giving the ability to boot into Ubuntu or Windows. A dual boot setup is ideal for first time Ubuntu users.

In order to achieve this the Ubuntu installer will shrink your Windows partition and make space for its own partitions.

To help make this process run as smooth as possible it is recommended that you do the following steps,

1. Clean up your Windows installation
2. Defrag your hard disk

Below you will find guidance on how to perform these steps. *Based on Windows 7, Vista and XP may vary

Optional

If you are a Windows 7 or Vista user, you have the ability to shrink your Windows partition in Windows rather than relying on the Ubuntu installer. If you wish to do this instead please refer to the last section titled 'Shrinking your Windows partition' at the end.

Clean up your Windows installation (Windows 7 / Vista and XP users)

Click on Start > Computer





Right click on your (C:) drive and select properties.





Click on Disk Clean up





Click on Clean up system files





Click on the 'More Options' tab





If you have any programs you no longer use click on the 'Clean up' button in the 'Programs and Features' box. Also click on the 'Clean up' button in the 'System Restore and Shadow Copies' box to remove old and outdated restore points.

Now go back to the 'Disk Cleanup' tab





Tick all / the appropriate files to delete and click on the 'ok' button.

Defrag your hard disk (Windows 7 / Vista / XP users)

Start > Programs > Accessories > System Tools > Disk Defragmenter





Select your (C:) drive and click on the 'Defragment disk' button

The time it takes to complete the defrag depends on the speed of your system and amount of disk space in use.

Shrinking your Windows partition (Windows 7 and Vista users only)

If you are using Windows 7 or Vista, you have the ability to shrink your Windows partition in Windows rather than relying on the Ubuntu installer.

In either case, I recommend creating a backup disk image of your Windows system before shrinking your Windows partition since this is more or less a permanent change.

Redo Backup and Recovery is a great free disk cloning program, see How to use Redo Backup and Recovery to clone your Windows disk for more details.

In the Windows start menu search for 'Computer Management'





Click on the 'Computer Management' program




Navigate to Storage > Disk Management in the left hand side plane

Right click your mouse button on the (C:) drive partition





This will bring up a context menu, select the 'Shrink Volume...' option





A dialogue resembling the above will appear, enter the amount of disk space you wish to shrink your (C:) drive partition by. As you can see I have entered 30000 MB (in other words 30GB).

If you are interested in the minimum amount you can use for a default Ubuntu install I would recommend not lower than 15GB. More space is obviously better as you can then install more programs and create / download more files.

When you have entered your amount click on the 'Shrink' button.





After a while, Windows will return to the main Computer Management interface and you should see a partition described as 'Unallocated' with the size you specified, in my case about 30GB.

You have now successfully created space for your Ubuntu installation. Please do not format this 'Unallocated' space, leave it as it is in its unformatted state.

Now proceed with your Ubuntu install.

Speed up Ubuntu 10.04 LTS by removing Mono?

If you don't know what Mono is, it is the open source equivalent of Microsoft's .NET development framework.

Some argue its a technology that will allow Microsoft to infect Linux with proprietary code and if Mono as a development platform becomes widespread and successful Microsoft will start demanding those who incorporate Mono to pay for its use via patent royalty fees.

Those who have strong feelings for free and open source software (FOSS) therefore hate the idea of Mono.

I think the point they put forward is very reasonable but forgetting that for now lets talk about Ubuntu 10.04 LTS.

Mono is included in Ubuntu 10.04 LTS because it has three Mono applications, F-Spot, Tomboy and gbrainy, as explained by The Open Sourcerer.

http://www.theopensourcerer.com/2010/04/29/how-to-remove-mono-from-ubuntu-10-04-lucid-lynx/

I decided to remove Mono as described in the above link and upon rebooting Ubuntu I feel the desktop is now a little bit more nippy.

Or is it?

I will have to try this on another system to confirm this finding but if you feel like giving it a go let me know what you think.

Saturday, 15 January 2011

How to use Redo Backup and Recovery to clone your Windows disk

Redo Backup and Recovery is a Linux based disk imaging program similar to CloneZilla but with a big difference, it has a very nice easy to use graphical user interface.

It also has a number of useful features, http://redobackup.org/features.php

This post will show you how to use Redo Backup and Recovery to clone your Windows disk to an external USB storage device.

Step by Step: How to use Redo Backup and Recovery

Requirements:

USB External Storage Device / Hard Drive
Redo Backup and Recovery CD - http://redobackup.org

Creating the Backup Image

Boot your system from your Redo Backup and Recovery CD. You may have to alter your system BIOS boot order and set the first bootable device to CD/DVD.




Select 'Enhanced Video Mode' and press 'enter'

If your system has difficulties loading Redo, try a different video mode.




This is the Redo main menu interface. Connect your USB external storage device to your system and then click on the 'Backup or Restore' option.




Click on the 'Backup' button.




The source drive is the drive you wish to backup, the drive containing Windows XP / Vista or 7.

Select the drive you wish to backup and click on next.




Leave all parts selected and click on next.




The destination drive is your external USB storage device. Select your USB storage device and click on next.




Click on the 'Browse...' button.




Create a new folder by clicking on the 'Create folder' button.




Then type a suitable name for your new folder, for example here I am typing 'Windows XP backup'

After typing the folder name, press the 'Enter' button on your keyboard.




This should take you into your new folder. If not, double click on your folder.

Now press on the 'Save Here' button.




We have now returned to Step 4. Note the destination folder, it should match what you typed above.

Click 'Next' to continue.




I decided to leave the date as suggested by Redo. Click on 'Next' to continue.




Redo will now start to backup your Windows disk, saving the disk image to your chosen external USB storage device.




When the operating is complete, click on the 'OK' button.





Now click on the Home button, top left of the screen. This will return you to the Redo main menu screen.




You can now either reboot or shut down your system. To do so click on the 'Power off' option.




Click on the 'Restart' or 'Turn Off' button.

Remember to keep your external USB storage device safe and do not erase the disk image.

Restoring the Backup Image

Restoring your disk image will erase all data present on the disk you are restoring the image to. Therefore make sure you save any important files before proceeding.

Boot your system from your Redo Backup and Restore CD.




Connect the USB external storage device containing your saved disk image to your system and then click on the 'Backup or Restore' option.




Click on the 'Restore' button




Since recovery is the opposite of backup, the source drive is the drive containing the disk image. This will be your external USB storage device.




Select the USB storage device and click on next.




Open the folder containing the disk image, eg Windows XP backup.




Select the disk image to restore, eg 20110109.backup and click on the 'Open' button.




We have returned to the Step 2 main screen, notice the disk image name is present. Click on 'Next' to continue.




Select the drive you wish to restore the disk image to. This will be your Windows drive. Click 'Next' to continue.




Click on 'Yes' to proceed with the recovery.




The recovery process should now be under way.




When the process has completed, click on the 'OK' button.

Return to the main menu by clicking on the 'Home' button, then reboot or power off your system by clicking on the 'Power Off' option.

Your system should now be fully restored.

Saturday, 8 January 2011

Rolling release is the way forward, join the openSUSE roller coaster

Linux in general is under constant development, always improving and moving forward with pace.This is great overall for the world of Linux but for its users there is a slight problem.

To benefit from newer packages you typically have to wait until your distribution vendor releases an entirely new distribution that incorporates newer packages.

However what often occurs is the latest release of a distribution includes a KDE desktop that is already outdated and it will remain stuck at this version until the distribution vendor in question releases their next release.

Or a Linux kernel that is several version behind the latest stable release.

If you were to install openSUSE 11.3 this very moment you would get KDE 4.4.4 and Linux kernel 2.6.34

The latest stable KDE is 4.5.5 and Linux kernel is 2.6.37

But here is another problem, to benefit from newer software packages you typically have to install your distribution again using the latest release.

So if you wish to benefit from newer packages, as a Ubuntu / Fedora user you have to perform a distribution install every 6 months. 8 months for openSUSE users.

Given the choice most of us would rather not have to bother but as a Linux user this is the Linux way.

Or was the way?

Distributions like Gentoo and Arch have an advantage in that they are already rolling release distributions.

This means to benefit from newer packages you do not need to reinstall the system from scratch but just perform a simple online update which will download newer packages.

The convenience a rolling release distribution can provide is simply something that all distribution vendors should seriously consider. I believe it is a major step in the right direction for Linux if all distributions were rolling release distributions.

There has already been talk from the Ubuntu crowd about a rolling release but that is all.

openSUSE however has made a big leap forward and taken the initiative to get the roller coaster rolling.

The goal of the Tumbleweed project is to create a ‘rolling release’ version of openSUSE. A rolling release distribution (like Arch Linux or Gentoo) always offers the latest stable versions of a package as updates so that when a new release of any upstream software surfaces, users actually don’t have to do a distribution upgrade. The packages will simply be part of the usual updates.

http://news.opensuse.org/2011/01/03/opensuse-finished-2010-big/

The openSUSE tumbleweed project is the first steps towards making openSUSE a rolling release distribution.

But was it the first steps?

Interesting question and in my view no. openSUSE already took the first steps towards moving to a rolling release months ago when they announced the KDE 4.5 stable repository for openSUSE 11.3.

With KDE development moving so quickly between distribution releases, users don’t want to be stuck with the distro release version of KDE. The much requested 4.5.* stable repo has now been provided for openSUSE 11.3 users.

http://news.opensuse.org/2010/09/12/forum-users-benefit-from-opensuse-kde-repository/

The KDE 4.5 repository has by far been the most welcoming move for openSUSE KDE 4.x users, bringing many bug fixes and performance enhancements.

The announcement of the Tumbleweed project could not come at a better time for openSUSE. I had my doubts about the future of openSUSE since the Attachmate deal but developments like this demonstrate openSUSE is a very active project with huge potential.

Monday, 3 January 2011

Windows 7 fails to power down idle disks, Fedora 14 works

My PC has two Samsung SpinPoint F3 500GB drives. The first disk contains Fedora 14 and the second disk has Windows 7.

When in Windows 7 I have no need for the Fedora 14 disk to be powered. Likewise, when in Fedora 14 I have no need for the Windows 7 disk to be powered.

So why not take advantage of power management and set idle disks to power off / spin down?

Great idea!

But this is where Windows 7 fails.

After a while Windows 7 will power down my idle (Fedora 14) disk but then it will randomly power the disk back up. This process would then repeat, an endless cycle of power down, power up, power down, power up....

Why does Windows 7 feel the need to poll my idle disk and wake it up?

Not only is this behaviour irritating but it undermines the idea of spinning down idle disks to save power.

Fedora 14 on the other hand spins down my idle (Windows 7) disk perfectly and does not randomly power the drive back up again unless I intentionally access the drive.

This therefore means with Linux I can have a greener PC and play an active part in saving the planet.

As measured with a mains power meter,  spinning down my idle disk reduced my PC's power consumption by an incredible 5 Watts.

Lower your carbon footprint and use Linux - the environmentally friendly operating system

Sunday, 2 January 2011

Fedora 14 - How to make Samsung Fn Brightness buttons work

If you own a Samsung R510 the most important feature that does not work in Fedora 14 are the brightness buttons. Ubuntu users are fortunate to have a repository that enables Fn functionality, please see https://launchpad.net/~voria/+archive/ppa

I will be using files provided by this repository to enable brightness control in Fedora 14 on my Samsung R510.

Please make sure your Fedora system is fully up to date before proceeding. If you are not sure open a terminal and run the following command,

su -c 'yum -y update'

If advised to reboot, please do.

Are you ready?

Open a terminal and type the following,

su -c 'yum install kernel-devel gcc'

This will download some required tools. Next, edit the 95-keyboard-force-release.rules file.

su -c 'nano /lib/udev/rules.d/95-keyboard-force-release.rules'

Look for the following line

ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*E252*|*N120*|*N128*|*N130*|*N140*|*N148/N208*|*N150*|*N150/N210/N220*|*N220*|*N308*|*N310*|*N510*|*NB30*|*NC10/N110*|*ND10*|*Q210/P210*|*R410P*|*R425/R525*|*R428/P428*|*R460*|*R463*|*R468/R418*|*R480/R431/R481*|*R509*|*R518*|*R519/R719*|*R520/R522/R620*|*R528/R728*|*R530/R730*|*R530/R730/P590*|*R560*|*R580*|*R580/R590*|*R59/R60/R61*|*R59P/R60P/R61P*|*R710*|*R720*|*R780/R778*|*SR58P*|*SR700*|*SR70S/SR71S*|*SX22S*|*X118*|*X120*|*X460*", RUN+="keyboard-force-release.sh $devpath samsung-other"

Add R510/P510 as highlighted

ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*R510/P510*|*E252*|*N120*|*N128*|*N130*|*N140*|*N148/N208*|*N150*|*N150/N210/N220*|*N220*|*N308*|*N310*|*N510*|*NB30*|*NC10/N110*|*ND10*|*Q210/P210*|*R410P*|*R425/R525*|*R428/P428*|*R460*|*R463*|*R468/R418*|*R480/R431/R481*|*R509*|*R518*|*R519/R719*|*R520/R522/R620*|*R528/R728*|*R530/R730*|*R530/R730/P590*|*R560*|*R580*|*R580/R590*|*R59/R60/R61*|*R59P/R60P/R61P*|*R710*|*R720*|*R780/R778*|*SR58P*|*SR700*|*SR70S/SR71S*|*SX22S*|*X118*|*X120*|*X460*", RUN+="keyboard-force-release.sh $devpath samsung-other"

Press 'Ctrl-X' to exit nano, followed by ''Y' to save the file.

Edit your kernel grub entry,

su -c 'nano /boot/grub/grub.conf'

and add the following, acpi_backlight=vendor as illustrated below.

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,0)
# kernel /boot/vmlinuz-version ro root=/dev/sda1
# initrd /boot/initrd-[generic-]version.img
#boot=/dev/sda1
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.35.10-74.fc14.x86_64)
root (hd0,0)
kernel /boot/vmlinuz-2.6.35.10-74.fc14.x86_64 acpi_backlight=vendor ro root=UUID=........... rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=uk rhgb quiet
initrd /boot/initramfs-2.6.35.10-74.fc14.x86_64.img
title Fedora (2.6.35.6-45.fc14.x86_64)
root (hd0,0)
kernel /boot/vmlinuz-2.6.35.6-45.fc14.x86_64 ro root=UUID=............ rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=uk rhgb quiet
initrd /boot/initramfs-2.6.35.6-45.fc14.x86_64.img
title Other
rootnoverify (hd1,0)
chainloader +1

Press 'Ctrl-X' to exit nano, followed by ''Y' to save the file.

Now we are going to download and compile the kernel module responsible for making the brightness buttons work.

mkdir samsung

cd samsung

wget http://dl.dropbox.com/u/16953763/samsung-backlight.c

wget http://dl.dropbox.com/u/16953763/Makefile

make

This will compile the samsung-backlight kernel module. The next step is to copy the module to your kernel.

su -c 'cp samsung-backlight.ko /lib/modules/$(uname -r)/kernel/'

su -c 'depmod -a'

su -c 'modprobe samsung-backlight'

Reboot your laptop and try out the FN brightness buttons.

Note:  You will have to rebuild / insert the samsung-backlight kernel module every time your kernel is updated.