31 July 2013

On Linux patches and diffs

So you're running your own customized Linux, and want to stay up-to-date a bit, right?

root@box:/usr/src/linux# patch -p1 --dry-run < ../patch-3.10.4
patching file Documentation/i2c/busses/i2c-piix4
Reversed (or previously applied) patch detected!  Assume -R? [n] ^C

So what's happening here is that 'patch-3.10.4' from kernel.org actually is a diff from 3.10 to 3.10.4, not from 3.10.3 to 3.10.4.
This'd be fine except that you've already applied patch-3.10.3 the day before yesterday and you don't want to keep track of which patches are already applied and stuff, you just want to see whether or not the new 3.10.4 patches apply without problems.
Plus you've got other patches applied as well so you really just want to have a patch with the changes form one minor release to the other, right?
So that's where interdiff comes into play:

interdiff patch-3.10.3 patch-3.10.4 > patch-3.10.3-to-3.10.4

Now we have a patch that only includes the changes from 3.10.3 to 3.10.4 and that can be applied directly and cleanly to our already patched-with-the-previous-version-and-other-stuff-as-well Linux tree.

On apache's mod_proxy

Another short one, a warning; a 'heads up' if you will.
Took me some time to figure out that Apache's mod_proxy actually requires the proxied service to be accessible when Apache itself starts.
It seems logical enough writing it down now, but when I was configuring mod_proxy to work with apt-cacher it sure wasn't clear looking at the log files.
So when you're playing around with mod_proxy and a random to-be-proxied service, make sure to reload/restart the service first (and verify everything working alright) and only then reload Apache to take the new mod_proxy settings into effect.