Modify

Opened 6 years ago

Closed 6 years ago

Last modified 4 years ago

#10164 closed enhancement (fixed)

build openl2tp with config file instead of l2tpconfig

Reported by: hoveringnowings@… Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: packages Version: Trunk
Keywords: openl2tp Cc:

Description

In order to get rid of dependencies: libncurses, libreadline and their dependencies. And l2tpconfig itself is about 100KB.
Basically, we can use everything in config file instead of l2tpconfig.

Attachments (3)

001-makefile.patch (2.7 KB) - added by mastabog@… 6 years ago.
new makefile patch the fixes compilation errors of .c files
002-no-libfl.patch (161 bytes) - added by mastabog@… 6 years ago.
new patch file that removes libfl dependency from l2tp_config_token.c
001-makefile.2.patch (2.9 KB) - added by mastabog@… 6 years ago.
new makefile patch the fixes compilation errors of .c files and removes RPC management

Download all attachments as: .zip

Change History (23)

comment:1 follow-up: Changed 6 years ago by Pilot6 <hanipouspilot@…>

Similar ticket already has been created. If you want to save 100kB, you can build without RPC. But RPC is a default feature of openl2tp and it is needed in many cases. I recommend to wontfix.

comment:2 Changed 6 years ago by Pilot6 <hanipouspilot@…>

As a compromise it is possible to make an option in menuconfig to build with or without RPC. A small change in Makefile needed.

comment:3 in reply to: ↑ 1 Changed 6 years ago by hoveringnowings@…

Replying to Pilot6 <hanipouspilot@…>:

Similar ticket already has been created. If you want to save 100kB, you can build without RPC. But RPC is a default feature of openl2tp and it is needed in many cases. I recommend to wontfix.

That is much more than 100KB. For some 4MB devices, after flash there is about 1.1MB free so that it cannot afford libncurses, libreadline, portmap, libwrap, librpc and terminfo which have a total of around 500KB.
However, openl2tp is the only way to provide l2tp kernel support. I really like xl2tpd but it makes my CPU full load.

So please help people with l2tp connection to internet.

comment:4 Changed 6 years ago by Eric Liu <hoveringnowings@…>

openl2tpd.conf is the default configuration file of openl2tpd and usually resides in /etc. Most users use interactive l2tpconfig commands to configure OpenL2TP, and then save the configuration to openl2tpd.conf.

Here is the definition in openl2tp's web page, so I believe openl2tpd.conf is a fully substitution of l2tpconfig.

comment:5 follow-up: Changed 6 years ago by Pilot6 <hanipouspilot@…>

You can compile yourself a package with no RPC and use it as you wish. Other users need RPC to change and debug openl2tp without restart. It is enough space even on 4 MB devices for Openl2tp with RPC. If it is so big a problem for you, I can give you an ipk without RPC. But commit changes to the trunk is not good, because many people, who use Openl2tp with RPC will get it unusable all of a sudden.

comment:6 in reply to: ↑ 5 Changed 6 years ago by Eric Liu <hoveringnowings@…>

Replying to Pilot6 <hanipouspilot@…>:

You can compile yourself a package with no RPC and use it as you wish. Other users need RPC to change and debug openl2tp without restart. It is enough space even on 4 MB devices for Openl2tp with RPC. If it is so big a problem for you, I can give you an ipk without RPC. But commit changes to the trunk is not good, because many people, who use Openl2tp with RPC will get it unusable all of a sudden.

Thanks a lot. I suddenly noticed that it will cause inconvenient for people using it currently. However, that is really my huge concern because I want to instead openl2tp, qos-scripts and ipv6 support, and then I have completely no free space.

I would really appreciate your kindness if you can make an option in "make menuconfig" or give me a patch for Makefile instead of current one.

I agree that it should be marked as wontfix.

comment:7 Changed 6 years ago by Pilot6 <hanipouspilot@…>

If you know how to use patches, then you can easily make it yourself. You just need to edit openl2tp native Makefile and switch off RPC there. Then go to Openwrt Makefile of openl2tp and remove dependencies of portmap, etc.

comment:8 follow-ups: Changed 6 years ago by jow

I would suggest a compromise here. We could build a openl2tp and openl2tp-mini variant, similar to how we build hostapd and hostapd-mini out of the same source package.

comment:9 in reply to: ↑ 8 Changed 6 years ago by Pilot6 <hanipouspilot@…>

Replying to jow:

I would suggest a compromise here. We could build a openl2tp and openl2tp-mini variant, similar to how we build hostapd and hostapd-mini out of the same source package.

A good idea!

comment:10 in reply to: ↑ 8 Changed 6 years ago by Eric Liu <hoveringnowings@…>

Replying to jow:

I would suggest a compromise here. We could build a openl2tp and openl2tp-mini variant, similar to how we build hostapd and hostapd-mini out of the same source package.

That is a really good idea.

Replying to Pilot6:

If it is so big a problem for you, I can give you an ipk without RPC.

I have tried to compile it myself but failed. It will not accept "-c configfile" option. May I have your patch or package?

comment:11 Changed 6 years ago by Pilot6 <hanipouspilot@…>

It should work. I lost my binary accidentally. But I can make another one. But I have no time this week.

comment:12 Changed 6 years ago by mastabog@…

I have the same problem. I tried mangling the makefile patch to allow the config file option to be compiled in but it fails compilation:

  • first it fails compiling l2tp_config_parse.c as the includes dir is no longer parsed (fixed by adding $(CPPFLAGS) to the l2tp_config_token.o: and l2tp_config_parse.o: rules)
  • then fails as ld cannot find the fl library (ld: cannot find -lfl)

I noticed lots of pacthes that remove the -lfl dependency ... is there a way around this?

Changed 6 years ago by mastabog@…

new makefile patch the fixes compilation errors of .c files

Changed 6 years ago by mastabog@…

new patch file that removes libfl dependency from l2tp_config_token.c

Changed 6 years ago by mastabog@…

new makefile patch the fixes compilation errors of .c files and removes RPC management

comment:13 follow-up: Changed 6 years ago by mastabog@…

I just fixed it and attached patch files. You need to copy only one makefile patch and the no-libfl patch (and replace the existing) and then compile.

The first makefile patch leaves both rpc management and config file. The second (which you should rename to 001-makefile.patch) removes rpc management and leaves only config file.

Cheers

comment:14 in reply to: ↑ 13 Changed 6 years ago by mastabog@…

Replying to mastabog@…:

I just fixed it and attached patch files. You need to copy only one makefile patch and the no-libfl patch (and replace the existing) and then compile.

Mirror here (with clear file/dir namings): http://db.tt/hbAte9DP

comment:15 follow-up: Changed 6 years ago by nico

  • Resolution set to fixed
  • Status changed from new to closed

Applied in r28758. As suggested by Eric, the package was also split in
2 variants:

  • mini: only configuration file support
  • full: configuration file and RPC support

I'm not sure what plugins are needed for each and what a sample
configuration would look like, feel free to submit more patches :)

Thanks!

comment:16 Changed 6 years ago by Pilot6 <hanipouspilot@…>

mini variant saves only 13kB of flash space. I am not sure it is worth it.
Regarding configuration, I made a connection script. It is here http://wiki.openwrt.org/doc/howto/connect_by_l2tp

It uses portmap and thus full version needed. But it is quite easy to make a config without RPC.

comment:17 in reply to: ↑ 15 Changed 6 years ago by anonymous

Replying to nico:

Applied in r28758. As suggested by Eric, the package was also split in
2 variants:

  • mini: only configuration file support
  • full: configuration file and RPC support

Thanks nico. Thanks for your effort.

Replying to Pilot6 <hanipouspilot@…>:

mini variant saves only 13kB of flash space. I am not sure it is worth it.
Regarding configuration, I made a connection script. It is here http://wiki.openwrt.org/doc/howto/connect_by_l2tp

It uses portmap and thus full version needed. But it is quite easy to make a config without RPC.

Hi Pilot6,
the mini version has no deps on libncurses, libreadline, portmap, libwrap, librpc and terminfo which cost around 500KB.

comment:18 Changed 6 years ago by Pilot6 <hanipouspilot@…>

I read the patch wrong. You're right.

comment:19 Changed 6 years ago by Igor Novgorodov <igor@…>

The mini-package does not work, because of ppp timer issues.

See here: http://sourceforge.net/tracker/?func=detail&aid=3149171&group_id=118353&atid=680935

I'll post a new package with this and other patches from SF and an init script included soon.

comment:20 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.