View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 14 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Fri Mar 24, 2006 5:06 am 
Offline
Joined: Tue Feb 21, 2006 7:24 am
Posts: 396
Location: Dushanbe, Tajikistan
I hope that this will help those wishing to recompile their kernel. In my case it was
to turn off SMP as it seems cause to video freezes during playback. (ff - then play
unfreezes it) on my machine and sometimes recordings get stuck.. I have dual
PIII machine, but losing the second processor is small price pay for better running system
and I can always boot to SMP kernel, if I do need the power..

=== Your mileage may vary with these instructions ===
If you find mistakes in this, post a follow up and I will edit this with the corrections

After this process you will have second kernel to boot to and the orginal kernel will still be
bootable as a failsafe, in case something goes wrong and your new kernel does not work --
To boot your orginal kernel: Hold down the left shift key after post.

============= Geared for turning off SMP on R5B7 ==========

The default R5B7 install will have everything you need build a kernel.
You will need to rebuild the modules for lircd and ivtv for them to load with your
new kernel.

In /usr/src/ you should find:

* Kernel source
* Lircd source
* ivtv-0.4.3 source

********* Building your kernel
[code]
cd /usr/src/linux
[/code]

Edit the Makefile, so you don't overwrite orginal kernel modules when you install
[code]
pico Makefile
[/code]
Change line 4 from:
[code]
EXTRAVERSION = -chw-2
[/code]
to
[code]
EXTRAVERSION = -chw-nosmp
[/code]

Now configure your kernel (in this case to turn off SMP)
[code]
make menuconfig
[/code]
In "Processor type and features " section. Turn off SMP by hitting the space bar on
that option. Exit "make menuconfig" by hitting the Esc key twice. You will be ask
to save your configuration. Answer yes.

Next make your kernel with command:
[code]
make
[/code]

Depending on the speed of your machine, your new kernel should be compiled in about
two hours.

After your kernel is made, install the new kernel modules. To be on the safe side
I always back up module directory anyway. If everything does well, you can delete
your backup.
[code]
mkdir /lib/modules/2.6.15-chw-2.backup
cp -av /lib/modules/2.6.15-chw-2 /lib/modules/2.6.15-chw-2.backup
[/code]
IF YOU DIDN'T MODIFY YOUR MAKEFILE AS DESCRIBED ABOVE, YOU WILL
OVERWRITE EXISTING KERNEL MODULES AND LEAVE YOUSELF WITHOUT
AN EASY OUT IF YOUR NEW KERNEL DOES NOT WORK!

[code]
make modules_install
[/code]

On R5B7 this command will install your new kernel modules in
/lib/modules/2.6.15-chw-nosmp

Install your new kernel and configure lilo:
[code]
cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz-2.6.15-chw-nosmp
cp /boot/initrd.gz /boot/initrd-nosmp.gz
[/code]

For those of you. Scraching your heads and asking "why the hell is he just
copying the initrd from the old kernel..." well. I gunzipped mine and mounted
it via loopback to change out the modules... and what did I see - The modules
directory was empty! My guess is that those using xfs, jfs etc. are going to have
add the correct modules to their initrd, before they will be able to boot.

So, if your using anything other ext3 for your root filesystem. Do these steps.
(you might want to do them anyway)

[code]
gunzip initrd-nosmp.gz
mount -o loop /boot/initrd-nosmp /mnt
ls /mnt/modules
[/code]

If the modules directory is empty. Just
[code]
umount /mnt
gzip /boot/initrd-nosmp
[/code]
and move on to editing your lilo.conf - If it is not empty -- make note of modules and
replace them with ones with the same name from the /lib/modules/2.6.15-chw-nosmp/
ie..
[code]
find /lib/modules/2.6.15-chw-nosmp/ -name "somemodule.ko" -exec cp "{}" /mnt/modules/ ";"
[/code]
After your done replacing the modules.
[code]
umount /mnt
gzip /boot/initrd-nosmp
[/code]
Edit your /etc/lilo.conf
[code]
pico /etc/lilo.conf
[/code]
In your lilo.conf, go down to section that looks like this:
[code]
# Boot up Linux by default.
#
default=Linux

image=/boot/vmlinuz-2.6.15-chw-2
label=Linux
initrd=/boot/initrd.gz
read-only
# restricted
# alias=1

image=/vmlinuz.old
label=LinuxOLD
read-only
optional
# restricted
# alias=2
[/code]

Change:
[code]
default=Linux
[/code]
to
[code]
default=Linux-nosmp
[/code]
And add this section:
[code]
image=/boot/vmlinuz-2.6.15-chw-nosmp
label=Linux-nosmp
initrd=/boot/initrd-nosmp.gz
read-only
[/code]

So that now that part of your lilo.conf looks like this:


[code]
# Boot up Linux by default.
#
default=Linux-nosmp

image=/boot/vmlinuz-2.6.15-chw-2
label=Linux
initrd=/boot/initrd.gz
read-only
# restricted
# alias=1

image=/boot/vmlinuz-2.6.15-chw-nosmp
label=Linux-nosmp
initrd=/boot/initrd-nosmp.gz
read-only

image=/vmlinuz.old
label=LinuxOLD
read-only
optional
# restricted
# alias=2
[/code]

Now run the lilo command so that your new kernel will boot:
[code]
lilo
[/code]
You should see this output:
[code]
Added Linux
Added Linux-nosmp *
Skipping /vmlinuz.old
[/code]

Next you will build and install the IVTV modules for your new kernel.
[code]
cd /usr/src/
tar -zxvf ivtv-0.4.3.tar.gz
cd ivtv-0.4.3
make KVER=2.6.15-chw-nosmp
make KVER=2.6.15-chw-nosmp install
[/code]

I dug around and could not figure out how to build the LIRC modules against
a non-running kernel. -- So the next step involves booting the new kernel
and compiling LIRC. Remember that if your kernel build installed the
it's modules in /lib/modules/2.6.15-chw-nosmp you should not have any problems
booting your new kernel and having everything work (except for LIRC)

If for some reason, your new kernel does not boot. Restart your machine and
hold down your left SHIFT key after post. This will bring up the lilo boot menu
and you can choose "linux" which will be your orginal kernel.

Ready? Ok. reboot your box with:
[code]
shutdown -r now
[/code]

Booted up with your new kernel? Good ;)

Next you will build and install the LIRC modules for your new kernel.
[code]
tar -jxvf /usr/src/lirc-0.8.0pre4-pvr150.tar.bz2
cd /usr/src/lirc-0.8.0pre4-pvr150
./configure
make
make install
[/code]

start lircd with:
[code]
/etc/iniit.d/lirc restart
[/code]

Now restart your frontend you should be good to go! If lirc is still not working try a reboot..
If you still have have problems with LIRC grab the 0.8.0 kit from lirc.org and try it.

=== Edit ===
As Requested //
To adapt these instructions for upgrading your kernel to newer version use your head.
Hint -- search these instructions for "nosmp"

Make sure you have enough space:
[code]
df -h /
[/code]
You will need about 600 Megs after all is said and done. If you don't have it in /
make a directory under /myth and use it.
[code]
mkdir /myth/tmp/
[/code]
Download your new kernel source, go to www.kernel.org to see what you need.
[code]
cd /myth/tmp
wget http://www.kernel.org/pub/linux/kernel/ ... 13.tar.bz2
tar -jxvf linux-2.6.16.13.tar.bz2
rm /usr/src/linux
ln -s /myth/tmp/linux-2.6.16.13 /usr/src/linux
cp /boot/config-2.6.15-chw-2 /usr/src/linux/.config
cd /usr/src/linux
make menuconfig
-- Hit Esc to save your new config
--- Do this regardless of making changes to config!
[/code]
Now go to section above where you type "make" to make your new kernel and
work your way down!
=== End of Edit -- fixed lots of typos ===

Good Luck!


Last edited by mac on Wed Oct 18, 2006 5:31 am, edited 10 times in total.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 03, 2006 3:58 am 
Offline
Joined: Wed Oct 12, 2005 7:54 am
Posts: 88
Could you add instructions for downloading a new kernel (like 2.6.16) and replacing/upgrading the old (2.6.15) kernel?

Thanks for the instructions! I think they are best I have read. I have been a linux user for over two years now and have wanted to recompile a kernel but have never found a simple yet complete guide on how to do it. I think this might be it :lol:


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 03, 2006 5:12 am 
Offline
Joined: Tue Feb 21, 2006 7:24 am
Posts: 396
Location: Dushanbe, Tajikistan
thanks -- I hope it helps.

I added a bit at the end of instructions to help you adapt it for upgrading your kernel
instead of doing a strait recompile.


Top
 Profile  
 
PostPosted: Mon May 08, 2006 8:17 pm 
Offline
Joined: Thu Apr 27, 2006 9:28 am
Posts: 1
I upgraded the kernel to 2.6.16.14 and had problems building the lirc module.

I downloaded the cvs snapshot from http://www.blushingpenguin.com/mark/blog/

Look for the heading "LIRC PVR-150 IR blaster support, version 3".
I used the link "pre-patched lirc 0.8.1 CVS as of 2006-04-13" to get
a version that supports the PVR-150 and the new kernel.

Thank you for your great instructions!

Doug


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 02, 2006 1:48 pm 
Offline
Joined: Thu May 25, 2006 6:02 am
Posts: 4
After following the above instructions and rebooting, running uname -r gives me:

2.6.15-chw-2

Should this be the case or does this indicate that it is not booting the new kernel?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 02, 2006 9:05 pm 
Offline
Joined: Tue Feb 21, 2006 7:24 am
Posts: 396
Location: Dushanbe, Tajikistan
I don't think that you have booted the your new kernel.

what's the output of the "lilo" command?

and what does "ls -l /boot/vmlinuz*" show?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 03, 2006 2:21 pm 
Offline
Joined: Thu May 25, 2006 6:02 am
Posts: 4
lilo:
Added Linux
Added Linux-nosmp *
Skipping /vmlinuz.old
Added Poweroff

ls -l /boot/vmlinuz*:
-rw-r--r-- 1 root root 2308642 Jan 5 03:52 /boot/vmlinuz-2.6.15-chw-2
-rw-r--r-- 1 root root 2308642 Jun 2 13:05 /boot/vmlinuz-2.6.15-chw-nosmp

Edit:
Also "uname -a" returns:
Linux mythbox 2.6.15-chw-2 #1 SMP PREEMPT Thu Jan 5 08:10:40 UTC 2006 i686 GNU/Linux


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 04, 2006 5:51 am 
Offline
Joined: Tue Feb 21, 2006 7:24 am
Posts: 396
Location: Dushanbe, Tajikistan
Quote:
ls -l /boot/vmlinuz*:
-rw-r--r-- 1 root root 2308642 Jan 5 03:52 /boot/vmlinuz-2.6.15-chw-2
-rw-r--r-- 1 root root 2308642 Jun 2 13:05 /boot/vmlinuz-2.6.15-chw-nosmp


they are the same kernel.

redo these steps from the above instructions:

copy the kernel from the arch/i386/boot directory to /boot/vmlinuz-2.6.15-chw-nosmp
rerun lilo.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 10, 2007 8:29 pm 
Offline
Joined: Fri Nov 21, 2003 10:23 pm
Posts: 66
Nice how-to, :D


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 16, 2007 8:06 am 
Offline
Joined: Tue Dec 12, 2006 8:44 am
Posts: 23
I have gone through the how-to and having issues with my new kernel, (kernel panic, something not right probably with the modules, I need to relook at that) but my question is that I don't have the ivtv source in /usr/src directory. I am using RD51 as my base. Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 16, 2007 7:04 pm 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
Download it from the ivtv project repository. See the CompileIvtv page on the wiki for details.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 16, 2007 10:06 pm 
Offline
Joined: Tue Dec 12, 2006 8:44 am
Posts: 23
tjc wrote:
Download it from the ivtv project repository. See the CompileIvtv page on the wiki for details.


tjc, hope you or someone can help me out...I've manage to get things messed up and want to try to go back to square one. My new kernel would never boot correctly, it did one time but X wouldn't load I didn't touch the nvidia stuff but somehow it got messed up. Even when I boot the old kernel its not biooting like before like the rc startup scripts are goofed up. It eventually comes up but not like it did in the past....so how can I start over ya know without starting over...any suggestions welcome...


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 17, 2007 12:19 am 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
Sounds like you're basically at the point where we telll folks "make a good backup and auto upgrade to the same version."...


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 17, 2007 10:34 am 
Offline
Joined: Tue Dec 12, 2006 8:44 am
Posts: 23
tjc wrote:
Sounds like you're basically at the point where we telll folks "make a good backup and auto upgrade to the same version."...



Its not that bad but, what I can't figure out is its the startup scripts, I start having problems around where it says Checking the Nvidia driver installation, then somehow gdm trys to startup and it gets an error message saying it is still booting (it eventualy boots up just very different)....


My recompile looks good what I am having issue with is the initrd...I tried following the directions but keep getting a kernel panic when it tries to load it up, can't find root...what is another way to make the initrd? And will I need to re-install the nvidia drivers when I'm done. THanks.


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 20 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu