Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Is there a guide for applying a patch to kernel?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
pd1986
Guru
Guru


Joined: 19 Feb 2012
Posts: 381
Location: Paris

PostPosted: Tue Sep 22, 2015 1:25 am    Post subject: Is there a guide for applying a patch to kernel? Reply with quote

I've been looking for the guide for a while. But I didn't find it. I would like to know if there is a guide or some special operation to apply a patch to kernel. Thanks
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2613

PostPosted: Tue Sep 22, 2015 6:04 am    Post subject: Reply with quote

Not sure if https://wiki.gentoo.org/wiki//etc/portage/patches also applies to kernel ebuilds.
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3686
Location: Hamburg

PostPosted: Tue Sep 22, 2015 9:44 am    Post subject: Reply with quote

charles17 wrote:
Not sure if https://wiki.gentoo.org/wiki//etc/portage/patches also applies to kernel ebuilds.
IIRC it does.
Back to top
View user's profile Send private message
pd1986
Guru
Guru


Joined: 19 Feb 2012
Posts: 381
Location: Paris

PostPosted: Tue Sep 22, 2015 10:02 am    Post subject: Reply with quote

Thank you all. I will try.
Back to top
View user's profile Send private message
Nicias
Guru
Guru


Joined: 06 Dec 2005
Posts: 444

PostPosted: Tue Sep 22, 2015 1:56 pm    Post subject: Reply with quote

I've used /etc/portage/patches for kernels, it works.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2613

PostPosted: Tue Sep 22, 2015 2:32 pm    Post subject: Reply with quote

Nicias wrote:
I've used /etc/portage/patches for kernels, it works.

Did you have to add the /etc/portage/bashrc stuff or does the kernel (which?) support epatch_user?
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Tue Sep 22, 2015 3:01 pm    Post subject: Reply with quote

charles17 wrote:
Nicias wrote:
I've used /etc/portage/patches for kernels, it works.

Did you have to add the /etc/portage/bashrc stuff or does the kernel (which?) support epatch_user?

charles ... if the package in question is using the kernel-2.eclass (as gentoo-sources does) then it supports epatch_user:

Code:
# awk '!/(^#|^$)/&&/epatch_user/' ~portdir/eclass/kernel-2.eclass
   debug-print "Doing epatch_user"
   epatch_user

@pd1986 ... if this is a oneoff patch then you can simply use 'patch' rather than epatch_user ...

Code:
# patch -p1 --dry-run -d /usr/src/linux <mypatch.patch

... remove '--dry-run' for the patch to be applied, and note that '-p1' may need to be altered dependent on the patch. I do this with the tuxonice patch as it tracks KVERSION and its easier to apply the patch subsequent to merging than using epatch_user.

HTH & best ... khay
Back to top
View user's profile Send private message
pd1986
Guru
Guru


Joined: 19 Feb 2012
Posts: 381
Location: Paris

PostPosted: Wed Sep 23, 2015 9:57 am    Post subject: Reply with quote

khayyam wrote:
charles17 wrote:
Nicias wrote:
I've used /etc/portage/patches for kernels, it works.

Did you have to add the /etc/portage/bashrc stuff or does the kernel (which?) support epatch_user?

charles ... if the package in question is using the kernel-2.eclass (as gentoo-sources does) then it supports epatch_user:

Code:
# awk '!/(^#|^$)/&&/epatch_user/' ~portdir/eclass/kernel-2.eclass
   debug-print "Doing epatch_user"
   epatch_user

@pd1986 ... if this is a oneoff patch then you can simply use 'patch' rather than epatch_user ...

Code:
# patch -p1 --dry-run -d /usr/src/linux <mypatch.patch

... remove '--dry-run' for the patch to be applied, and note that '-p1' may need to be altered dependent on the patch. I do this with the tuxonice patch as it tracks KVERSION and its easier to apply the patch subsequent to merging than using epatch_user.

HTH & best ... khay


Hi Khayyam, you are right. I use the command "patch". and it works. I think it much easier. Just need to be careful about the directory level in the patch, it will be OK. Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum