Hi,

recently, I have a technical discussion with Waldemar about handling
source code patches in the source tree. Although all FreeWRT developers
prefers to stay as close as possible on the specific official source,
often it is not possible to integrate a specific package without
patching, especially the kernel itself (sigh!). FreeWRT is working with
pristine sources and have a patch file with a necessary patches. In the
build process all patches are applied in normal file order.

Until now, all patches are organized in a logical order. Let's look into
the most important package: busybox. There are many patches for this
package, i.e. 150-udhcp-release.patch. The name implies the function:
udhcp should release it's IP on exit.

The current system have some problem: each patch (could) depends on the
preceding patches. If 2 patches patches the same file at a similar
position, upgrading to a new version leads nearly every time to a "patch
fixing process". The advantage of this patch management is a logical
order of patches: you see which patch has which function since their
names are meaningful.

Waldemar and Thorsten have implemented a patch supporting system into
the build enviroment (idea taken from OpenBSD). With this, you can
generate all patches with "make update-patches". The build system will
diff the pristine source against the current source and generate patches
based on a file basis. This is indeed very easy to managed, new version
can be applied faster. All patches, which are applied for the Makefile
are now in one big patch. One patch per file.

But, you will loose the advantage of connected patches, each patch is
splitted into small patches. If you look into the busybox patch
150-udhcp-release.patch, you will get 3 files:

grep diff 150-udhcp-release.patch
diff -Nur busybox-1.2.1.orig/include/usage.h busybox-1.2.1/include/usage.h
diff -Nur busybox-1.2.1.orig/networking/udhcp/dhcpc.c 
busybox-1.2.1/networking/udhcp/dhcpc.c
diff -Nur busybox-1.2.1.orig/networking/udhcp/dhcpc.h 
busybox-1.2.1/networking/udhcp/dhcpc.h


You got the idea?

And that's my problem: even for smaller packages you will loose
everything: no patch documentation, no linkage between patch lines (over
more than 1 file). I cannot remove a patch without the danger to break
everything, which is (normally) not the case with the current system.

Take a look into the busybox-patch directory: trunk is still the
old style, branch_1_0 is ported to the new style (one patch per
file). Try to find the patch which releases the IP on udhcp exit. Make
your own opinion.

My assumption is that the new style will be mostly unmaintainable, the
technical advantage of migrating to new versions is nothing against
loosing any logical linkage in patches. I never see such a patch
management in more complex systems, including the Linux kernel itself
(i.e. mm series).

Any other opinions?

Dirk
_______________________________________________
freewrt-developers mailing list
[email protected]
https://www.freewrt.org/lists/listinfo/freewrt-developers

Reply via email to