Intro
OK, so the guys on these forums have provided amazing and helpful info with the Ubuntu Desktop Installation Guide for F@H , SR-2 Optimization Thread and lately the I hate Linux thread
I've been folding for a while now and have mainly been a windows folder, dabbling in VMWare images for bigadv, but my SR-2 has been jealous watching the linux folders get all the points so I tried a few times to get it working, but as the machine doubles as my VM Server for domain/web/mail duties I needed it to work in Linux as well.
But I couldn't get all the tweaks such as BFS to work AND have Virtual machines as well, because there was an incompatability between the method in the guide of getting the BFS kernel and the required "bits" that let VMware or VirtualBox run.
I had another problem with Linux 10.10 gave me huge numbers of pciehp (hotplug) errors in the Linux log files, a couple every second, which a) filled up the log files alarmingly, b) kept hitting the hard disk (not what you want when folding bigadv) and c) was hitting the cpu enough for me to notice a folding hit.
So the only way to get all the things I wanted was to compile my own kernel, which I had never done before.
Compiling a custom kernel with BFS (-ck)
So I looked all over for info on compiling kernels and there are loads of tutorials out there, most of which work, but after trial and error these steps seemed to work best, and after a few test runs making just plain cfs kernels without the pciehp stuff I worked out how to add the bfs stuff in.
Bear in mind this is for 11.04 Ubuntu desktop I haven't tried it any other version.
Compiling the kernel
Updated for 2.6.39.x kernel which improves performance over 2.6.38.x
1. Install these packages:
2. Run this command
3. Create your source directory
4. Download the Kernel source
Note above is the best way but if you can't get the source this way (I couldn't) then follow the steps below:
4a. Download Kernel (alternative method)
4b. Unzip Kernel
5. Download the BFS patch
6. Patch the source
You need to know where you downloaded the patch file above, for me it was in /home/username/src
7. Configure your Kernel
It's a good idea to use the configuration of your current working kernel as a basis for your new kernel. Therefore we copy the existing configuration
Which brings up the kernel configuration menu. Go to:
Load an Alternate Configuration File
and choose .config (which contains the configuration of your current working kernel) as the configuration file
OK here is where you can disable the pciehp drivers to prevent the error filling up your log files if you have it, if not you can skip this bit. But its a text mode setup screen and the drivers are in:
Bus options (PCI etc.) --->
<*> PCI Express Hotplug driver
You want to exclude that feature by scrolling down to it and pressing <N> the star should then dissapear from between the anglebrackets. Then exit out and save any changes.
You can if you feel brave, remove any unnecessary drivers or modules, but BEWARE you can break your kernel removing the wrong thing.
8. Speed up the build
To make compiling faster you can tell it to use more cores, general rule, concurrency level = number of processor cores + 1 so for the SR-2 its 2 x 6 + 1 = 13 any other cpu you make the call
(note I use 13 and can compile the kernel in under 10 minutes) 
9. Clean up temp files from a previous compile attempt (skip if necessary)
10. Compile your Kernel
You can change -sr2 to anything you wish I use -sr2 for obvious reasons
9. Install your Kernel
Again change -sr2 to whatever you chose
10. Rebooting and choosing kernels
Ok now your kernel is set to be default when you next reboot, hopefully if all went well you won't have any problems and you can check after you reboot with:
to see if your using the new kernel.
However there may be a time when you want to change back for some reason. You can do this two ways, you can hold down left shift while booting up to get to the GRUB boot menu, and choose a different kernel or you can install a nice GUI util called "Startup manager" which is available in Synaptic Package Manager if you search for "startupmanager" this lets you set the default kernel when booting.
So last thing is reboot and see how you go!
Hope this helps some people, it was a steep learning curve for me hopefully less painful for you now.
OK, so the guys on these forums have provided amazing and helpful info with the Ubuntu Desktop Installation Guide for F@H , SR-2 Optimization Thread and lately the I hate Linux thread
I've been folding for a while now and have mainly been a windows folder, dabbling in VMWare images for bigadv, but my SR-2 has been jealous watching the linux folders get all the points so I tried a few times to get it working, but as the machine doubles as my VM Server for domain/web/mail duties I needed it to work in Linux as well.
But I couldn't get all the tweaks such as BFS to work AND have Virtual machines as well, because there was an incompatability between the method in the guide of getting the BFS kernel and the required "bits" that let VMware or VirtualBox run.
I had another problem with Linux 10.10 gave me huge numbers of pciehp (hotplug) errors in the Linux log files, a couple every second, which a) filled up the log files alarmingly, b) kept hitting the hard disk (not what you want when folding bigadv) and c) was hitting the cpu enough for me to notice a folding hit.
So the only way to get all the things I wanted was to compile my own kernel, which I had never done before.
Compiling a custom kernel with BFS (-ck)
So I looked all over for info on compiling kernels and there are loads of tutorials out there, most of which work, but after trial and error these steps seemed to work best, and after a few test runs making just plain cfs kernels without the pciehp stuff I worked out how to add the bfs stuff in.
Bear in mind this is for 11.04 Ubuntu desktop I haven't tried it any other version.
Compiling the kernel
Updated for 2.6.39.x kernel which improves performance over 2.6.38.x
1. Install these packages:
Code:
sudo apt-get install kernel-wedge kernel-package libncurses5-dev
2. Run this command
Code:
sudo apt-get build-dep --no-install-recommends linux-image-$(uname -r)
3. Create your source directory
Code:
mkdir ~/src
cd ~/src
4. Download the Kernel source
Code:
apt-get source linux-image-$(uname -r)
4a. Download Kernel (alternative method)
Code:
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.39.1.tar.bz2
4b. Unzip Kernel
Code:
tar -xpjf linux-2.6.39.1.tar.bz2
5. Download the BFS patch
Code:
wget http://www.kernel.org/pub/linux/kernel/people/ck/patches/2.6/2.6.39/2.6.39-ck2/patch-2.6.39-ck2.bz2
6. Patch the source
You need to know where you downloaded the patch file above, for me it was in /home/username/src
Code:
cd linux-2.6.39.1
bzip2 -cd [I]/path/to_where_you_downloaded[/I]/patch-2.6.39-ck2.bz2 | patch -p1
7. Configure your Kernel
It's a good idea to use the configuration of your current working kernel as a basis for your new kernel. Therefore we copy the existing configuration
Code:
cp /boot/config-`uname -r` ./.config
Code:
make menuconfig
Which brings up the kernel configuration menu. Go to:
Load an Alternate Configuration File
and choose .config (which contains the configuration of your current working kernel) as the configuration file
OK here is where you can disable the pciehp drivers to prevent the error filling up your log files if you have it, if not you can skip this bit. But its a text mode setup screen and the drivers are in:
Bus options (PCI etc.) --->
<*> PCI Express Hotplug driver
You want to exclude that feature by scrolling down to it and pressing <N> the star should then dissapear from between the anglebrackets. Then exit out and save any changes.
You can if you feel brave, remove any unnecessary drivers or modules, but BEWARE you can break your kernel removing the wrong thing.
8. Speed up the build
To make compiling faster you can tell it to use more cores, general rule, concurrency level = number of processor cores + 1 so for the SR-2 its 2 x 6 + 1 = 13 any other cpu you make the call
Code:
export CONCURRENCY_LEVEL=13
9. Clean up temp files from a previous compile attempt (skip if necessary)
Code:
make-kpkg clean
10. Compile your Kernel
You can change -sr2 to anything you wish I use -sr2 for obvious reasons
Code:
time fakeroot make-kpkg --initrd --append-to-version=[B][COLOR="Cyan"]-sr2[/COLOR][/B] kernel-image kernel-headers
9. Install your Kernel
Again change -sr2 to whatever you chose
Code:
cd ~/src
sudo dpkg -i linux-headers-2.6.39.1-ck2[B][COLOR="Cyan"]-sr2[/COLOR][/B]_2.6.39.1-ck2[COLOR="Cyan"]-sr2[/COLOR]-10.00.Custom_amd64.deb
sudo dpkg -i linux-image-2.6.39.1-ck2[B][COLOR="Cyan"]-sr2[/COLOR][/B]_2.6.39.1-ck2[COLOR="Cyan"]-sr2[/COLOR]-10.00.Custom_amd64.deb
10. Rebooting and choosing kernels
Ok now your kernel is set to be default when you next reboot, hopefully if all went well you won't have any problems and you can check after you reboot with:
Code:
uname -a
However there may be a time when you want to change back for some reason. You can do this two ways, you can hold down left shift while booting up to get to the GRUB boot menu, and choose a different kernel or you can install a nice GUI util called "Startup manager" which is available in Synaptic Package Manager if you search for "startupmanager" this lets you set the default kernel when booting.
So last thing is reboot and see how you go!
Hope this helps some people, it was a steep learning curve for me hopefully less painful for you now.
Last edited: