[Swan-dev] problems with Libreswan 3.15 build for Linux 3.14

Neal P. Murphy neal.p.murphy at alum.wpi.edu
Thu Dec 3 20:26:48 UTC 2015


On Wed, 2 Dec 2015 23:46:05 -0500
"Neal P. Murphy" <neal.p.murphy at alum.wpi.edu> wrote:

> Help! I'm lost! (Well, maybe I'm just a mite bewildered.)
> 
> I'm amidst converting Smoothwall Express to use Libreswan and Linux 3.14. The current release uses Openswan 2.6.42 and Linux 3.4.110.
> 
> As usual, LFS rescued me from one blockage; I got NSPR and NSS added and built. Then I had to add pkgs unbound and libevent.
> 
> [aside]
> Where in the docs are all of the mandatory and optional dependencies specified? Also, http://libreswan.googlecode.com/git/README (which may be old/dead), says:
> ----
>     make programs
>     make module
>     sudo make module_install
> ----
> The install step should probably include target 'install', too.
> [/aside]
> 
> ======
> 
> So I finally got to building Libreswan. Or trying to...
>
> ... (omitted for brevity)
> 
> This seems to be trying to use pam, which smoothwall doesn't use.
> 
> Everything in the logs before these snippets 'looks' OK, so I omitted it. I can supply the entire logs if needed.

OK. I've gotten past the PAM trouble. I put
----
INITSYSTEM = sysvinit
USE_LIBCURL = false
USE_XAUTHPAM = false
----
in Makefile.local.inc. After a couple more adjustments, 'base' and 'module' build, 'install-base' and 'module_install' seem OK with one oddity at the end:
----
OSMODLIB=/lib/modules/3.14.57 (make -C /build/sources/linux/linux -p help)
+ mkdir -p /lib/modules/3.14.57/kernel/net/ipsec
+ cp /build/sources/openswan/libreswan-3.15/modobj/ipsec.ko /lib/modules/3.14.57/kernel/net/ipsec
+ '[' -f /sbin/depmod ']'
+ /sbin/depmod -a
WARNING: Couldn't open directory /lib/modules/3.16.0-4-amd64: No such file or directory
FATAL: Could not open /lib/modules/3.16.0-4-amd64/modules.dep.temp for writing: No such file or directory
+ '[' -n net/ipsec ']'
+ mkdir -p /lib/modules/3.14.57/kernel/net/ipsec
+ '[' -f /lib/modules/3.14.57/kernel/ipsec.ko -a -f /lib/modules/3.14.57/kernel/net/ipsec/ipsec.ko ']'
make[2]: Leaving directory `/build/sources/openswan/libreswan-3.15'
make[1]: Leaving directory `/build/sources/openswan/libreswan-3.15'
----

How do I tell it *not* to use uname or to pick up anything else about the build host that might pollute the target?


Next to figure out how to make DESTDIR work.

N

> 
> ======
> 
> Now on to build commands. To build openswan for smoothwall, I used a patch to Makefile to include DESTDIR, a couple other patches to tweak little things, and this command:
> ----
>         @$(MAKE) $(JOBS) -C $(COMPILE_DIR) V=1 USERCOMPILE='$(CFLAGS)' KLIPSCOMPILE='$(CFLAGS)' INC_USRLOCAL=$(PKG_DIR) FINALCONFDIR=$(PKG_DIR)/etc FINALRCDIR=$(PKG_DIR)/bin KERNELSRC=$(KNL_SRC) programs
> ----
> 
> I assume these vars have all been replaced with stuff in Makefile.inc (and files in mk/). IIUC, I can create Makefile.inc.local for all of the smoothwall-specific vars, locations and needs. But what exactly do I put in there? Copy Makefile.inc, change it as desired, and delete the rest? Add selected stuff from files in mk/?
> 
> For Libreswan, I've reduced the command to:
> ----
>         @$(MAKE) $(JOBS) -C $(COMPILE_DIR) V=1 WERROR_CFLAGS="" KERNELSRC=$(KNL_SRC) base    # or programs
> ----
> 
> So far, the build picks up CFLAGS, so it builds for generic i586 as desired. WERROR_CFLAGS fixes a problem that I think is fixed in 3.16. Once I get the build to finish, I'll be able to see what else needs to be adjusted/tweaked.
> 
> I hope the 64-bit build will 'just work' once I get the 32-bit build going.
> 
> Thanks!
> Neal
> _______________________________________________
> Swan-dev mailing list
> Swan-dev at lists.libreswan.org
> https://lists.libreswan.org/mailman/listinfo/swan-dev



More information about the Swan-dev mailing list