You are not logged in.

#1 2007-12-25 23:55:19

tntcoda
Member
Registered: 2007-07-24
Posts: 115

Applying a patch file to source code

Hi,

In reference to this post: http://forum.eeeuser.com/viewtopic.php?pid=30515#p30515

Please could someone explain to me how to apply the patch to the source code?

I tried: cat patch_file | patch -p0 where patch_file contained the patch code,

[jack@tmain L2-linux-driver_new]$ cat patch_file | patch -p0
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Only in l2.fixed: Module.symvers
|diff -u l2/at_ethtool.c l2.fixed/at_ethtool.c
|--- l2/at_ethtool.c    2007-04-20 09:34:48.000000000 +0200
|+++ l2.fixed/at_ethtool.c    2007-11-25 01:58:24.000000000 +0100
--------------------------

My directory structure is as follows:

[jack@tmain L2-linux-driver_new]$ ls -R
.:
COPYING  atl2.spec     patch_file  release_note.txt
atl2.7   ldistrib.txt  readme      src

./src:
Makefile  at_ethtool.c  at_hw.h    at_osdep.h  kcompat.c  kcompat_ethtool.c
at.h      at_hw.c       at_main.c  at_param.c  kcompat.h

I tried renaming src to l2, but that gave me further errors.

Any ideas?

Thanks alot,

Jack

Last edited by tntcoda (2007-12-25 23:55:43)

Offline

#2 2007-12-26 00:05:13

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,405
Website

Re: Applying a patch file to source code

The comment "Perhaps you used the wrong -p or --strip option?" is you clue here. Try "patch -Np1 -i <patch file>".

Offline

#3 2007-12-26 00:08:38

tntcoda
Member
Registered: 2007-07-24
Posts: 115

Re: Applying a patch file to source code

Thanks, that gave me:

[jack@tmain l2]$ patch -Np1 -i patch_file
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Only in l2.fixed: Module.symvers
|diff -u l2/at_ethtool.c l2.fixed/at_ethtool.c
|--- l2/at_ethtool.c    2007-04-20 09:34:48.000000000 +0200
|+++ l2.fixed/at_ethtool.c

Thats the same even if i rename src to l2, so that l2/at_ethtool.c exists.

Offline

#4 2007-12-26 00:21:46

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,405
Website

Re: Applying a patch file to source code

tntcoda wrote:
[jack@tmain l2]$ patch -Np1 -i patch_file

Do this one directory down (i.e. cd .. from that directory).  If that does not work, just adjust the number after p to 0 or 2 and try it.

Offline

#5 2007-12-26 00:38:47

tntcoda
Member
Registered: 2007-07-24
Posts: 115

Re: Applying a patch file to source code

Thanks again, afraid that still results in the same errors, even with increasing the number of strips sad

Offline

#6 2007-12-26 07:12:01

kumico
Member
Registered: 2007-09-28
Posts: 224
Website

Re: Applying a patch file to source code

try

[jack@tmain L2-linux-driver_new]$ patch -p0 -i patch_file src/at_ethtool.c

Offline

#7 2007-12-26 12:08:20

tntcoda
Member
Registered: 2007-07-24
Posts: 115

Re: Applying a patch file to source code

Thanks, that results in:

patching file src/at_ethtool.c
patch: **** malformed patch at line 7: #endif

Any ideas?

Offline

Board footer

Powered by FluxBB