lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] Desiderata for 2.2.0: better support for Debian packagi


From: Renzo Davoli
Subject: Re: [lwip-devel] Desiderata for 2.2.0: better support for Debian packaging and VirtualSquare
Date: Thu, 5 Jan 2023 13:51:14 +0100

Dear Simon, Joan,

first of all thank you Simon for the thoroughful analysis of my proposals.

On Wed, Jan 04, 2023 at 09:36:50PM +0100, goldsimon@gmx.de wrote:
> > 1- The code generated by contrib/ports/unix/lib has unresolved symbols:
> > $ nm liblwip.so | grep ' U ' | grep -v @
> >                   U sio_read
> >                   U sio_tryread
> > slirpif requires sio_read and sio_tryread.
> > The patch named 1-libnoslip.patch excludes slip.c from the library
> 
> That's probably ok since I'm not sure who would use slipif on unix.
> I see that liplwip.so is shipped with the debian package. Does that mean
> everyone linking to that library has to provide sio_read/sio_tryread
> even if not using slipif right now? Or do we have lazy binding and this
> is only a "cleanup" thing?
In the Debian patch named "cmake" (debian/patch/cmake) Joan modifies
the src/Filelists.cmake excluding slipif (exactly as my proposed patch does).
--- a/src/Filelists.cmake
+++ b/src/Filelists.cmake
@@ -93,7 +93,6 @@
     ${LWIP_DIR}/src/netif/ethernet.c
     ${LWIP_DIR}/src/netif/bridgeif.c
     ${LWIP_DIR}/src/netif/bridgeif_fdb.c
-    ${LWIP_DIR}/src/netif/slipif.c
 )

> 
> > 
> > 2- CMakeLists.txt in contrib/ports/unix/lib lacks support for install and
> > uninstall and the compatibility with linux sockaddr.
> > The patch named 2-linuxlib.patch adds a new dir contrib/ports/unix/linuxlib
> > to generate a more linux-consistent library.
> 
> I'm not sure what's the use here: we have liblwip.so. Where is linuxlib
> used?
This patch adds:
- a CMakeLists.cmake file providing install/uninstall support
- Linux consistent external headers sockets.h/inet.h
- a specific lwipopts.h

* it is used to create the Debian package, lwipopts and include/* files are
those currently added using Debian packaging patches (debian/patches/patch9350,
debian/patches/port).
* moving the Linux specific code from Debian packaging patches to the core 
source would
help maintainers for other distros to create similar (and compatible) packages.

> Also, lwIP is BSP*ish, unless there are strong external requirements, we
> cannot just accept GPL code.
You mean BSD*ish?

In my patch I have kept Joan's original license for lwipopts.h and
include/{inet.h,sockets.h}.
I think Joan can modify the license to BSD if he wish.

I can envision four options (IMHO in descreasing sorting of desirability):
* Joan agrees to provide the code also under BSD
* Simon and lwIP community accepts a GPL library for Linux, considering the
unified support for Linux distros as a "strong external requirement".
(lwip already has LGPL code: contrib/apps/LwipMibCompiler/SharpSnmpLib)
* We create a fork of lwip, say linuxlwip including the three GPL files:
(the fork would simply add the contrib/port/unix/linuxlib dir)
* The contrib/port/unix/linuxlib dir is added as a Debian packaging patch.
Interested users and maintainers of other distros have to apply the change
by hand.
> 
> > 
> > 3- Add VDE support (see 
> > https://wiki.virtualsquare.org/#!tutorials/vdebasics.md)
> > The patch named 3-vdeif.patch adds an interface driver for vde.
> > (It requires libvdeplug).
> 
> I'm not opposed to adding such a netif, but the formatting of this file
> is *very* awkward (spaces/tabs mixed, "-------" lines, etc).

You are right for what concerns space/tab mix. I have updated the patch 
3-vdeif.patch (it is here attached).
The new files vdeif.c and vdeif.h are simple modifications of tapif.c and 
tapif.h,
respectively. see:
$ diff contrib/ports/unix/port/netif/vdeif.c 
contrib/ports/unix/port/netif/tapif.c
$ diff contrib/ports/unix/port/include/netif/vdeif.h 
contrib/ports/unix/port/include/netif/tapif.h

The 'ackward' /*--- ...---*/ lines are already in tapif.c file.

Given that I am the author of vdeif.[ch], in the new patch I have also deleted 
the GPL header, so
this code is now released under the same license as tapif.[ch].
> 
> > Applying all these patches to lwip 2.2.0 should make the Debian packaging
> > project almost as simple as adding:
> > %:
> >    dh $@ --sourcedirectory=contrib/ports/unix/linuxlib
> > to the 'debian/rules' file.
> Joan, can I take you in here? What do you think would be required to
> make packaging lwIP into debian easier? This is kind of the last thing
> before releasing 2.2.0 I'm waiting for...

If it can be useful I send here attached an experimental debian dir for 
packaging:
lwip.debian.tgz

Given a git clone of lwip with my three patches applied as the dir 'lwip',
and lwip.debian.tgz saved in /tmp,
the following command sequence should build the Debian packages:

  cd lwip
  git checkout -b upstream
  git tag upstream/2.2.0
  git checkout -b debian/sid
  tar xf /tmp/lwip.debian.tgz
  git add debian
  git commit -m "debian packaging"
  gbp buildpackage -b -us -uc

(libvdeplug-dev package is a required dependency)
no Debian packaging patches are needed.

thank you, ciao,

        renzo

PS: I will be at FOSDEM, Feb 4/5. I would like to meet you in person if you are 
in Brussels, too.

Attachment: 3-vdeif.patch
Description: Text Data

Attachment: lwip.debian.tgz
Description: application/gtar-compressed


reply via email to

[Prev in Thread] Current Thread [Next in Thread]