Subject: Patching 2.0.35 kernel sources

From: Chris Sawer <[email-masked]>
Date: Fri, 06 Nov 1998 09:56:39 +0000

I've just got round to downloading the latest (2.0.35) kernel sources and the
ArmLinux patch, but installing the patch was a /major/ headache. The problems
stem from the pathnames in the patch file - this is the first line:

diff -urN /mnt/src/v2.0/linux/CREDITS linux/CREDITS

Therein lies the problem - I didn't install it in /mnt/src/v2.0, which
wouldn't have been a problem if both input and output path names had been
like this:

diff -urN /mnt/src/v2.0/linux/CREDITS /mnt/src/v2.0/linux/CREDITS

In which case a simple -p4 would have stripped both pathnames down to
linux/CREDITS which would have worked. However, as only one has this long
path, doing a -p4 messed up the output file and they all ended up in strange
places. In the end, I managed to patch the kernel by removing all occurrences
of /mnt/src/v2.0/ from the patch file, but this isn't really satisfactory.

The reason I am asking this is that my webpage has a section on compiling
your own kernel and if you're a first time user, you're really not going to
want to edit patch files. Is there an option on patch I missed (I looked
through the man page) or is the patch broken?

Chris

-- 
         Chris Sawer - Worthing, Sussex, England    ICQ: 15010147
    E-Mail: [email-masked]    PGP public key available on request
http://members.xoom.com/chrissawer/  <-- ArmLinux Binaries, Hints and Tips
unsubscribe: body of `unsubscribe linux-arm' to [email-masked]

---

From: Russell King - ARM Linux Admin <[email-masked]>
Date: Fri, 6 Nov 1998 21:13:42 +0000 (GMT)

> diff -urN /mnt/src/v2.0/linux/CREDITS linux/CREDITS

Patch uses the second filename only.

> diff -urN /mnt/src/v2.0/linux/CREDITS /mnt/src/v2.0/linux/CREDITS

The two filenames are not input and output, but are original and updated source,
refering to the filesystem where the patches were created.  Only the updated
source is used when deciding where to put the patch.

> of /mnt/src/v2.0/ from the patch file, but this isn't really satisfactory.

You want to cd to the kernel directory (eg, cd /usr/src/linux), and then:
zcat <patchfile> | patch -p1

> through the man page) or is the patch broken?

There is no need to edit the patch files...
   _____
  |_____| ------------------------------------------------- ---+---+-
  |   |        Russell King       [email-masked]      --- ---
  | | | |  http://www.arm.linux.org.uk/~rmk/armlinux.html    /  /  |
  | +-+-+                                                     --- -+-
  /   |               THE developer of ARM Linux              |+| /|\
 /  | | |                                                     ---  |
    +-+-+ -------------------------------------------------  /\\\  |
unsubscribe: body of `unsubscribe linux-arm' to [email-masked]

---

From: Philip Blundell <[email-masked]>
Date: Fri, 06 Nov 1998 22:27:32 +0100

>through the man page) or is the patch broken?

Neither.  It sounds like you either have an old version of patch or you just
used the wrong options.  Ignore the "old" filename in the patch file, it's 
only the "new" one that matters and you should use -p as appropriate to that.
Assuming your sources are in `linux' you should use -p0.

p.

---

From: Russell King - ARM Linux Admin <[email-masked]>
Date: Sat, 7 Nov 1998 09:26:38 +0000 (GMT)

> Assuming your sources are in `linux' you should use -p0.

Apparantly not - patch 2.5 and on which are POSIX compliant appear to use
both of them.

My recomendation is to keep an old copy of patch around (since the old patches
are going to be there for a long time), and I'm sure over time people will
create patches to accomodate the new POSIX compliant patch.

I will not be regenerating any of the patches on the FTP site, due to what I
see as an incompatable change in patch.  However, any new patches will be
patch-2.5 friendly.

I personally think that this is extremely stupid, since it effectively prevents
patches that are already out there from being applied with a new patch.  Why
didn't they do a Microsoft and change the patch style as well?  If it's one
thing that patch really /needs/ it's consistency.
   _____
  |_____| ------------------------------------------------- ---+---+-
  |   |        Russell King       [email-masked]      --- ---
  | | | |  http://www.arm.linux.org.uk/~rmk/armlinux.html    /  /  |
  | +-+-+                                                     --- -+-
  /   |               THE developer of ARM Linux              |+| /|\
 /  | | |                                                     ---  |
    +-+-+ -------------------------------------------------  /\\\  |
unsubscribe: body of `unsubscribe linux-arm' to [email-masked]

---

From: Philip Blundell <[email-masked]>
Date: Sun, 08 Nov 1998 12:01:22 +0100

>Apparantly not - patch 2.5 and on which are POSIX compliant appear to use

I use patch 2.5 and I've never had any problems.  But I don't set 
POSIXLY_CORRECT in my environment.

p.

---

From: Chris Sawer <[email-masked]>
Date: Sun, 08 Nov 1998 12:20:09 +0000

In message <[email-masked]>
          Russell King - ARM Linux Admin <[email-masked]> wrote:

> The two filenames are not input and output, but are original and updated
> source, refering to the filesystem where the patches were created.  Only
> the updated source is used when deciding where to put the patch.

Thanks - it was me getting confused then.

(Feeling very silly) Chris