Re: embarrassing patch question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





Hello


Maybe I need to be clear on my question so I won't be given simple answers
like read the man page. I'm asking because the man page is unclear
as to how to use diff and patch together to get a good patch file
and patch application method.  Also, I want to get the "Standard" method,
since the man page doesn't say this is the way to do it in Linux. For
instance,
I've gotten patches in the past which I couldn't apply for the
life of me and I've had some patch files in the past which were as
easy to use as falling off a log.  I want my patch file to be the
latter.  I also want it to be easily recognized by a seasoned linux
developer as a quality patch and not some weird hack job that barely works.
We spent a long time doing the work and I don't want someone to dis
our work because I did a poor job on the patch file.  Maybe I'm being
anal, but I saw the bit about unified patch file method and I don't have
a clude as to what that is or if I should be doing that way or not.


So one more time with feeling (and more details). I've got two directory
kernels in the current directory:
linux-2.4.2_hhl20 (The modified kernel directory) and
linux-2.4.2_hhl20.orig (The original kernel).

So, from the directory I issue the following command:
diff -Naur linxu-2.4.2_hhl20.orig linux-2.4.2_hhl20 > k2.patch

When the command finishes, I do the following commands to test the patch:
cp -rf linux-2.4.2_hhl20.orig linux-kernel-to-be-patched
(I'm giving it this weird name so I can be assured the name of the
directory doesn't matter.)

Then without changing the directory, I attempt to patch the directory like
so:
patch -d linux-to-be-patched -p1 < k2.patch
(Notice I'm doing the -p1 to ignore the leading dir name, and I'm using
the -d linux-to-be-patched option so it will use my new funky kernel
directory
name.)

The patch command runs like gangbusters, until the following occurs:
<leading output is snipped.>
patching file include/asm/posix_types.h
patching file include/asm/siginfo.h
patching file include/asm/unistd.h
patching file include/asm-ppc/posix_types.h
Reversed (or previously applied ) patch detected! Assume -R? [n]

And here is why that error occurs:
include/asm is a link to include/asm-ppc. So, when it applies
the patch to include/asm/posix_types.h it will fail when it does
include/asm-ppc/posix_types.h since its already been patched.

For what it matters, all three directories have the include/asm link to
include/asm-ppc
as they should.

Lastly, I wasn't trying to make a career out of diff/patch, I just wanted
to know how to do it quickly and correctly.  I figured it was a 5 minute
problem and it only needed a 5 minute question of someone who knew how to
do it to answer.

J (what the hell is a man page?) D


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux