LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 06-29-2011, 01:00 PM   #1
Dezfor
Member
 
Registered: Jul 2010
Distribution: Ubuntu
Posts: 46

Rep: Reputation: 1
Don't know how to apply Ubuntu patch on Vanilla kernel


I downloaded linux-source-2.6.38.deb, installed it. But I don't know hot to apply Ubuntu/Debian-specific patch to vanilla-kernel.
After installation of Deb in /usr/src/ I see:
Code:
$ ls -l /usr/src/
drwxr-xr-x 4 root root 4096 2011-06-27 01:20 linux-source-2.6.38
lrwxrwxrwx 1 root root   47 2011-06-27 01:20 linux-source-2.6.38.tar.bz2 -> linux-source-2.6.38/linux-source-2.6.38.tar.bz2
Code:
$ ls -l /usr/src/linux-source-2.6.38
drwxr-xr-x 10 root root     4096 2011-06-27 01:20 debian
drwxr-xr-x  8 root root     4096 2011-06-27 01:20 debian.master
-rw-r--r--  1 root root 75789876 2011-04-11 12:10 linux-source-2.6.38.tar.bz2
What should I do for applying patch?
I know how to work only with diff patches for kernel ;(
 
Old 06-29-2011, 02:00 PM   #2
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
That is the patched ubuntu kernel.
 
Old 06-29-2011, 02:03 PM   #3
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Hi,

Okay, so, it is source code, and it has to be compiled.

Try this
- download the stuff in the user account (not the root)
- make & copy to a folder and unpack
- enter the folder
- enter "make config"
- enter "make"
- become root (sudo or something)
- do "make install" after making it back into the folder (becomming root makes you end up in the root's folder...)

Just my misty thoughts...

Luck

Thor
 
Old 06-29-2011, 02:55 PM   #4
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
Quote:
Originally Posted by Thor_2.0 View Post
Hi,

Okay, so, it is source code, and it has to be compiled.

Try this
- download the stuff in the user account (not the root)
- make & copy to a folder and unpack
- enter the folder
- enter "make config"
- enter "make"
- become root (sudo or something)
- do "make install" after making it back into the folder (becomming root makes you end up in the root's folder...)

Just my misty thoughts...

Luck

Thor
Or you could use make-kpkg to build a .deb

For example, instead of make install use fakeroot and make-kpkg

Code:
make oldconfig
make menuconfig
fakeroot make-kpkg -j7 --initrd --revision=1 kernel_image kernel_headers 	
make-kpkg clean
 
Old 06-29-2011, 03:20 PM   #5
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Quote:
Or you could use make-kpkg to build a .deb
Hmm, that, of course, would be the far better option. It means using what the distro provides in terms of tools, instead of goiing hazrd-core...of course, my first Linux XP involved compiling the kernel...the hard way

Indeed.
 
Old 06-29-2011, 05:36 PM   #6
Tungsten Tide
LQ Newbie
 
Registered: Jun 2011
Location: Dublin, Ireland
Distribution: Linux Mint 11
Posts: 4

Rep: Reputation: 10
Quote:
Originally Posted by Thor_2.0 View Post
Hmm, that, of course, would be the far better option. It means using what the distro provides in terms of tools, instead of goiing hazrd-core...of course, my first Linux XP involved compiling the kernel...the hard way

Indeed.
No It isn't.
Quote:
make help - Gives commands to build + configure kernel
deb-pkg - Build the kernel as an deb package
so you type: make deb-pkg
 
0 members found this post helpful.
Old 06-29-2011, 09:53 PM   #7
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Quote:
make help - Gives commands to build + configure kernel
deb-pkg - Build the kernel as an deb package
so you type: make deb-pkg
Man, did'nt know that! My way forced me (back then) to "become a friend of google"...
 
Old 06-30-2011, 07:31 AM   #8
Dezfor
Member
 
Registered: Jul 2010
Distribution: Ubuntu
Posts: 46

Original Poster
Rep: Reputation: 1
You misunderstood me, or I told you something wrong. I know hot to compile Linux kernel. I downloaded source from kernel.org and used following lines to build modules, kernel and install it:
Quote:
copied generic kernel 2.6.38-8 config from Ubuntu 11.04
make -j5 bzImage
make -j5 modules

make -j5 modules_install
make -j5 install

mkinitramfs -o /boot/initrd-2.6.38.8 2.6.38.8
update-grub
After booting Ubuntu 10.04 with new kernel faced troubles with network and display hardware. Search in Google gave answer that this happened due to some ubuntu specific patches were not applied (distros apply patches to vanilla kernel from kernel.org). I found that i can download kernel-source from Ubuntu packages (package contains vanilla kernel + Ubuntu patch). I've downloaded it and don't know hot to apply patch.
 
Old 06-30-2011, 08:13 AM   #9
Dezfor
Member
 
Registered: Jul 2010
Distribution: Ubuntu
Posts: 46

Original Poster
Rep: Reputation: 1
found following docs related to my issue:
https://help.ubuntu.com/community/Kernel/Compile
http://blog.avirtualhome.com/2010/05...-lucid-kernel/

hope it will help
 
Old 06-30-2011, 01:57 PM   #10
Tungsten Tide
LQ Newbie
 
Registered: Jun 2011
Location: Dublin, Ireland
Distribution: Linux Mint 11
Posts: 4

Rep: Reputation: 10
Quote:
Originally Posted by Dezfor View Post
Is This your first time?
Them links explain everythin arse ways IMHO.
Quote:
Simple way is to download the mainline kernel from Linus's tree at kernel.org via Git - use the link found via GitWeb.
Make .config for ur devices - use "make localmodconfig" with every device attached to the system i.e plug it into the computer.
Custom the .config - "make xconfig".
Build the kernel - "make" or "make -j[num] where num is the amount of cores on the system i.e my laptop has 2 cores so "make -j2".
BUT i package it as well so i run "make -j2 deb-pkg".
 
Old 06-30-2011, 02:12 PM   #11
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
Quote:
Originally Posted by Tungsten Tide View Post
Build the kernel - "make" or "make -j[num] where num is the amount of cores on the system i.e my laptop has 2 cores so "make -j2".
BUT i package it as well so i run "make -j2 deb-pkg".
If you have 2 cores, you can safely run "make -j3"
 
Old 06-30-2011, 04:04 PM   #12
Dezfor
Member
 
Registered: Jul 2010
Distribution: Ubuntu
Posts: 46

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by Tungsten Tide View Post
Is This your first time?
Them links explain everythin arse ways IMHO.
Yes it's my first time of building kernel in such way. Yes, links helped me. Currently I have no network, so can't download needed package asciidoc
Quote:
Originally Posted by andrewthomas View Post
If you have 2 cores, you can safely run "make -j3"
I have 4 cores that is why i run -j5
 
Old 06-30-2011, 04:30 PM   #13
Tungsten Tide
LQ Newbie
 
Registered: Jun 2011
Location: Dublin, Ireland
Distribution: Linux Mint 11
Posts: 4

Rep: Reputation: 10
Quote:
Originally Posted by Dezfor View Post
Yes it's my first time of building kernel in such way. Yes, links helped me. Currently I have no network, so can't download needed package asciidoc

I have 4 cores that is why i run -j5
Can u rollback to the generic kernel via grub - bootloader?
 
Old 07-01-2011, 02:50 AM   #14
Dezfor
Member
 
Registered: Jul 2010
Distribution: Ubuntu
Posts: 46

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by Tungsten Tide View Post
Can u rollback to the generic kernel via grub - bootloader?
Yes

Issue is solved. Successfully applied Ubuntu patch on vanilla kernel and build it.
Thanks to Ubuntu Help

Last edited by Dezfor; 07-01-2011 at 01:08 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How does one apply a kernel patch? Equinn Linux - Newbie 20 04-14-2011 01:54 PM
canīt apply kernel-patch syntax85 Linux - Newbie 4 08-27-2009 08:03 AM
Apply a kernel patch android6011 Ubuntu 2 12-05-2007 05:57 PM
Kernel Patch will not Apply. mudelf Linux - General 10 10-08-2003 05:22 AM
How To Apply Patch To Kernel WILLIAMATHOMAS Linux - Software 2 02-12-2003 12:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 10:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration