LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions
User Name
Password
Linux - Distributions This forum is for Distribution specific questions.
Red Hat, Slackware, Debian, Novell, LFS, Mandriva, Ubuntu, Fedora - the list goes on and on... Note: An (*) indicates there is no official participation from that distribution here at LQ.

Notices


Reply
  Search this Thread
Old 11-03-2010, 12:58 PM   #1
leiphasw
LQ Newbie
 
Registered: Oct 2010
Location: Morgantown, Pennsylvania, USA
Distribution: Angstrom
Posts: 16

Rep: Reputation: 0
How to make a simple kernel patch with OE Bitbake / Recipe System


I am able to build an Angstrom distribution based on OpenEmbedded using the supplied Recipe files and Bitbake. When I move the built image to an SD card, it boots my BeagleBoard uImage file and I see my version information displayed on the TTY monitor as it boots and everything works fine.

However, I want to make a new build, specifically removing a patch to alignment.c that displays Kernel Alignment trap messages on the TTY mainly to prove to myself I can do it. My patch is simply to change the text of the trap message and rebuild. However, I have done that, but the rebuild never recompiles alignment.c. I have removed the associated alignment.o and rerun bitbake multiple times. The uImage is recreated each time, but I don't know where it is finding the code to link in. The Recipe files and work folders, cache, folders, etc. are so voluminous, that I spend hours grep'ing for files containing scraps of what may be a clue.

The Bitbake docs say it works based on makefiles. I have looked at the many makefiles and can't find a clue about how the uImage file is built. I would assume that a correct make file would notice the fact that I edited a source file and rebuild everything downstream.

I even edited the patch that was applied to create the trap message I ultimately want to remove, and that is ignored too.

Does anyone have an idea of how this system works? I just want to know how this works so I can make 'real' patches in the future for a project I am working on.

Thanks,
Steve.

Last edited by leiphasw; 11-03-2010 at 01:00 PM.
 
Old 11-07-2010, 03:25 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,244

Rep: Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321
Here's how the system works. Presume you're root, and in the directory holding the sources.

diff -Naur source-vanilla source-modified > some.patch #makes a patch. original & modified source needed
To apply a patch, you leave it in the directory holding the sources, and cd into the topdir (e.g. linux-2.6.36.1)

patch -Nnp1 ../some.patch
The patch made in the paragraph above will have filenames line linux-2.6.36.1-modified/somedir/somefile. What the p1 option does is strip off everything left of the first /. So now it will simply be looking for somedir/somefile.

Read man patch. Patch -r reverses a patch. To make a patch, you need the vanilla source. To remove a patch, you need the patch and the patched source. That gives you the vanilla source. I would
1. remove the patch entirely
2. copy alignment.c in it's directory, and name the copy alignment.c-vanilla
3. Patch the vanilla source
4. delete alignment.c and replace it with alignment.c-vanilla
Clumsy, but sure.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How Do You Make A Simple Linux Operating System Jamie Kugelmann Linux - Newbie 19 10-05-2008 08:38 PM
LXer: Linux From Scratch: a recipe for system LXer Syndicated Linux News 0 05-14-2008 03:50 AM
Kernel - extra crispy or original recipe dgtldaydrmr Slackware 5 10-03-2007 07:31 AM
Kernel 2.6.9 make error (after bootsplash patch) jai_joy Linux - Newbie 7 12-06-2004 02:19 PM
debian-patch-debianlogo w/2.6.5 kernel-patch-lpp Outabux Debian 11 05-20-2004 01:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions

All times are GMT -5. The time now is 10:05 AM.

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