Jump to content

Have problem with kernel patching


alexparser

Recommended Posts

Hi!

 

I try make a patch file, but after image building my patched code do not work.
What I do wrong?

SRC=$(pwd)
# source file
SOURCES=$SRC/sources/linux-sunxi/sunxi-3.4/sound/soc/sunxi/i2s/
# create user patch file
diff -u $SOURCES/sunxi-i2s.c $SRC/mod/sunxi-i2s.c > $SRC/userpatches/kernel/sun7i-default/9999-i2s-mod.patch
Link to comment
Share on other sites

for the patch to be created & applied properly you have to pay attention to the path

 

example:





--- a/arch/arm/boot/dts/sun4i-a10-cubieboard.dts
+++ b/arch/arm/boot/dts/sun4i-a10-cubieboard.dts

assuming you have 2 folders (a, b ) and you want to create a patch for the file arch/arm/boot/dts/sun4i-a10-cubieboard.dts

 

you have to "cd" on the higher directory then

 

diff a/arch/arm/boot/dts/sun4i-a10-cubieboard.dts b/arch/arm/boot/dts/sun4i-a10-cubieboard.dts > $HOME/my.patch

 

note: usually the patch command is used with the option "-p1" so ignoring folder a & b when patching

 

of course, you can trick the patch and

diff sun4i-a10-cubieboard.dts.old sun4i-a10-cubieboard.dts.new

then replace the header with

--- a/arch/arm/boot/dts/sun4i-a10-cubieboard.dts
+++ b/arch/arm/boot/dts/sun4i-a10-cubieboard.dts

--

you may need to read some more piece of info

https://duckduckgo.com/?q=creating+a+patch+with+diff

 

http://stackoverflow.com/questions/23390823/creating-patch-file-for-linux-kernel#23390933

http://linux.byexamples.com/archives/163/how-to-create-patch-file-using-patch-and-diff/

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines