OpenWrt Forum Archive

Topic: Patches against CVS available for review

The content of this topic has been archived between 11 Apr 2018 and 19 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

strace ipkg + update to the latest version

tcp_wrappers (libwrap)

portmap

gmp v4.1.3 (libgmp)

net-snmp v5.1.1

will provide the following packages: · libsnmp
· snmp-agent
· snmp-utils

mawk v1.3.3

It works for me:

# tar jxf usr/src/linux-2.4.26.tar.bz2
# wget http://openwrt.org/forum/download.php?id=61" -O patch
--23:33:13--  http://openwrt.org:80/forum/download.php?id=61
           => `patch'
Connecting to openwrt.org:80... connected!
HTTP request sent, fetching headers... done.
Length: 3,145 [application/octet-stream]

    0K -> ...

23:33:14 (341.25 KB/s) - `patch' saved [3145/3145]

# cd linux-2.4.26/
# cat ../patch | patch -p1 -s
#

But I have also put the seperate patch files that are part of this patch at http://www.xtdnet.nl/paul/natt/

Let me know if these also do not work.

Paul

Paul,

i guess your patches should integrate more seemlessly in the build process to get accepted

try looking at other patches in ./sources/openwrt/kernel/patches
and make a diff

--
Nico

ncurses v5.2 (libncurses)

MySQL v4.0.20

will provide the following packages:
· libmysql, the mysql client library
· mysql-utils, some mysql client utilities (mysqladmin and mysqlshow)

Nico, thank you for your answer, but I am still confused.

The patches you point me to as an example are all patches to package an additional package (eg a binary or kernel module). My patch does not stand on its own like that, because it patches the linux kernel itself. It does not create its own new files, nor is it part of an ikpg. It needs to happen at a specific point. After the kernel downloaded and untarred, and before it is being built. This means adding the patch operation to the openwrt.mk file.

So this is not a patch you can put in as an external package 'patch'.

So, I *think* that what you guys want is a single patch that:
1a downloads this patch from somewhere and put it in  $(DL_DIR)    or
1b Will it be part of openwrt.tar.gz, such as the patch file being in sources? Or do you want it in sources/kernel-patches (a directory that contains nothing yet, so i am not sure if it is actually used)
2 patches openwrt.mk to run the patch command that actually patches the kernel.
This last step I am not sure about either, because the kernel-patches directory assumes if you put patches there, they will get applied at the right time, but openwrt.mk doesn't seem to do any kernel patching at all, hence my idea of adding the patchline in openwrt.mk.....

So, I am still rather confused.

If someone can tell me how I should give the kernel patch, or confirm one of the above methods is indeed what is needed, then I will create it and post it to the forum.

Paul

The patches you point me to as an example are all patches to package an additional package (eg a binary or kernel module). My patch does not stand on its own like that, because it patches the linux kernel itself. It does not create its own new files, nor is it part of an ikpg. It needs to happen at a specific point. After the kernel downloaded and untarred, and before it is being built. This means adding the patch operation to the openwrt.mk file.

This is exactly the purpose of the ./sources/openwrt/kernel/patches directory. All files in it are patches against the linux kernel sources and are applied successively (hence the number in their names) after the kernel has been unpacked but before it is configured (look at openwrt.mk for details).

You should provide a diff in unified format and verify that it can be applied without conflicts.

--
Nico

Nico,

The patch has been generated with diff -u. This can be seen in the "nattpatch" make target of openswan-2/Makefile, which uses openswan-2/packaging/utils/nattpatch

When I move the openswan patch into kernel/patches directory as you say,it works fine for me:

[...]
Applying /usr/local/openwrt/buildroot/sources/openwrt/kernel/patches/160-expr.patch using plaintext:
patching file Makefile

Applying /usr/local/openwrt/buildroot/sources/openwrt/kernel/patches/170-ip6tables-alignment.patch using plaintext:
patching file net/ipv6/netfilter/ip6_tables.c
Hunk #1 succeeded at 95 (offset -3 lines).
Hunk #2 succeeded at 1427 (offset 4 lines).

Applying /usr/local/openwrt/buildroot/sources/openwrt/kernel/patches/180-openswan-natt.patch using plaintext:
patching file include/net/sock.h
Hunk #1 succeeded at 249 (offset 4 lines).
Hunk #2 succeeded at 593 with fuzz 1 (offset 3 lines).
patching file net/Config.in
Hunk #1 succeeded at 106 (offset 18 lines).
patching file net/ipv4/udp.c

Applying /usr/local/openwrt/buildroot/sources/openwrt/kernel/patches/CVS using plaintext:
cat: /usr/local/openwrt/buildroot/sources/openwrt/kernel/patches/CVS: Is a directory
# use replacement diag module code
cp -f /usr/local/openwrt/buildroot/sources/openwrt/kernel/diag.c /usr/local/openwrt/buildroot/build_mipsel/WRT54GS/release/src/linux/linux/drivers/net/diag/diag_led.c
cp -f /usr/local/openwrt/buildroot/sources/openwrt/kernel/linux.config /usr/local/openwrt/buildroot/build_mipsel/WRT54GS/release/src/linux/linux/.config
(cd /usr/local/openwrt/buildroot/build_mipsel; ln -sf /usr/local/openwrt/buildroot/build_mipsel/WRT54GS/release/src/linux/linux linux)
(cd /usr/local/openwrt/buildroot/build_mipsel/WRT54GS/release/src/linux/linux/arch/mips/brcm-boards/bcm947xx/;
rm -rf compressed;
tar jxvf /usr/local/openwrt/buildroot/sources/openwrt/kernel/compressed-20040531.tar.bz2;
)
[...]

The only thing that also needs to happen is that NAT-T needs to be enabled in the .config file, so in this case, ./sources/openwrt/kernel/linux.config needs an extra line saying:

CONFIG_IPSEC_NAT_TRAVERSAL=y

Should I make a patch against linux.config? If so, it should be a seperate patch from the natt-patch. Or do you want a patch against openwrt that patches in both the new patch file and fixes that line in linux.config?

Also, what confused me was the existence of both
./sources/openwrt/kernel/patches

and

./sources/kernel-patches

I guess the latter is obsolete and should probably be removed.

Also, to avoid those errors above about trying to patch CVS, you might want to change:

$(SOURCE_DIR)/patch-kernel.sh $(LINUX_DIR) $(SOURCE_DIR)/openwrt/kernel/patches

to:

$(SOURCE_DIR)/patch-kernel.sh $(LINUX_DIR) $(SOURCE_DIR)/openwrt/kernel/patches/*patch

in source/make/openwrt.mk

Paul

The only thing that also needs to happen is that NAT-T needs to be enabled in the .config file, so in this case, ./sources/openwrt/kernel/linux.config needs an extra line saying:

CONFIG_IPSEC_NAT_TRAVERSAL=y

Should I make a patch against linux.config? If so, it should be a seperate patch from the natt-patch. Or do you want a patch against openwrt that patches in both the new patch file and fixes that line in linux.config?

I guess you should provide a patch against the latest CVS buildroot that will add the patch and fix the kernel config too...

Also, what confused me was the existence of both
./sources/openwrt/kernel/patches

and

./sources/kernel-patches

I guess the latter is obsolete and should probably be removed.

The later is empty and should be pruned when checking out

--
Nico

pmacct v0.7.2p1

will provide the following packages: · pmacctd: IP accounting daemon
· nfacctd: NetFlow accounting daemon

they were not tested at all, any feedback is welcome

--
Nico

Hi Nico,

thanks for your answer. A single new patch against openwrt cvs from today has been added to this post.
It adds NAT-traversal support, as needed for Openswan.
It adds the kernel patch file and the option to linux.config.

It does not change the busybox configuration, which is another thing that is needed for Openswan to function correctly, since that is a slightly different topic, and I was not sure if adding the 4 or 5 binaries from busybox would otherwise might this patch rejected.

I will post a new posting with the busybox information.

Regards,

Paul

Hi Nico,

thanks for your answer. A single new patch against openwrt cvs from today has been added to this post.
It adds NAT-traversal support, as needed for Openswan.
It adds the kernel patch file and the option to linux.config.

It does not change the busybox configuration, which is another thing that is needed for Openswan to function correctly, since that is a slightly different topic, and I was not sure if adding the 4 or 5 binaries from busybox would otherwise might this patch rejected.

I will post a new posting with the busybox information.

Regards,

Paul

Ah great! This patch add the one thing that was missing in IPsec, compatibility with setups where your IPsec endpoint is behind NAT.

I succesfully applied the patch on my last openwrt checkout and it works fine, hope to see this in the regular distribution soon smile

Stefan

bwm 1.1.0

netstat-nat v1.4.3

A tool for displaying NAT connections

Hi all,

back with the patches wink

theese ones will add Application Layer Packet Classifier support to Netfilter (kernel and iptables).

It received minimal testing: I was able to classify http traffic -- great

The iptables patch is not currently integrated in the build process, mainly because its extensions are embedded in the firware, so you'll have to wait for a modular iptables package or build your own...

--
Nico

Patch to build pciutils-2.1.11 under buildroot when "pciutils" is an optionally included build target in openwrt.mk.

This is my first patch submission. I hope I'm close to following the right process. Feedback appreciated.

What happens next, how do patches transition into CVS?

IMQ from http://www.linuximq.net/

It is modified from iptables-1.2.9-imq1.diff and linux-2.4.26-imq.diff.

Worked for me for more than a week. big_smile

Hi all,
This is little patch to activate failsafe mode with buffalo wbr-g54 hardware.

Genoa

The discussion might have continued from here.