strongswan交叉编译与安装
创始人
2024-05-29 05:54:33
0

一. 前言

        由于strongswan是由几个工具组成并且需要依赖一些动态库,某些工具在运行时,会启动其他工具,启动其他工具是通过绝对路径寻找,所以编译时需要指定好工具的路径。

二. 编译

        strongswan在make install后会产生一些目录。包含了命令文件,配置文件,库文件,组件库和man手册。

一级目录如下:

bin  etc  lib  libexec  sbin  share

详细目录结构如下:

├── bin
├── etc
│   ├── ipsec.d
│   │   ├── aacerts
│   │   ├── acerts
│   │   ├── cacerts
│   │   ├── certs
│   │   ├── crls
│   │   ├── ocspcerts
│   │   ├── private
│   │   └── reqs
│   ├── strongswan.d
│   │   └── charon
│   └── swanctl
│       ├── bliss
│       ├── conf.d
│       ├── ecdsa
│       ├── pkcs12
│       ├── pkcs8
│       ├── private
│       ├── pubkey
│       ├── rsa
│       ├── x509
│       ├── x509aa
│       ├── x509ac
│       ├── x509ca
│       ├── x509crl
│       └── x509ocsp
├── lib
│   └── ipsec
│       └── plugins
├── libexec
│   └── ipsec
├── sbin
└── share
    ├── man
    │   ├── man1
    │   ├── man5
    │   └── man8
    └── strongswan
        └── templates
            └── config
                ├── plugins
                └── strongswan.d

1. 配置

./configure \
CC=/myproject_new/mipsel-mt7620-linux-gnu/bin/mipsel-mt7620-linux-gnu-gcc \
--host=mipsel-mt7620-linux-gnu \
--prefix=/usr \
--libexecdir=/usr/libexec \
--libdir=/lib \
--sysconfdir=/etc \
--with-ipseclibdir=/usr/lib/ipsec \
--with-plugindir=/usr/lib/ipsec/plugins \
LDFLAGS=-L/myproject_new/staging_dir/lib \
CFLAGS=-I/myproject_new/staging_dir/include

--prefix:bin和sbin目录安装的路径。本例为/usr。

--libexecdir:libexec目录下的文件安装的路径。本例为/usr/libexec。

--libdir:这里没有用到

--sysconfdir:etc目录安装的路径。本例为/etc。

--with-ipseclibdir:lib下的libstrongswan和libcharon等库的安装路径。本例为/usr/lib/ipsec。

--with-plugindir:组件库的安装路径。本例中为/usr/lib/ipsec/plugins。

2. 编译

make && make install

3. 安装

cp /usr/lib/ipsec usr/lib/ -rdf 
cp /etc/ipsec.conf etc/ -rdf 
cp /etc/ipsec.d etc/ -rdf 
cp /etc/ipsec.secrets etc/ -rdf 
cp /etc/strongswan.conf etc/ -rdf 
cp /etc/strongswan.d etc/ -rdf 
cp /etc/swanctl etc/ -rdf 
cp /bin/pki bin/ -rdf 
cp /usr/sbin/ipsec usr/sbin/ipsec -rdf 
cp /usr/sbin/swanctl usr/sbin/swanctl -rdf 
mkdir usr/libexec 
cp /usr/libexec/ipsec usr/libexec/ -rdf

        将安装的编译文件拷贝到跟文件系统。

三. 总结

        本文介绍了strongswan安装的详细步骤,并且介绍了编译的安装路径的选项的含义。下一篇将介绍一个简单的示例。

相关内容

热门资讯

监控摄像头接入GB28181平... 流程简介将监控摄像头的视频在网站和APP中直播,要解决的几个问题是:1&...
Windows10添加群晖磁盘... 在使用群晖NAS时,我们需要通过本地映射的方式把NAS映射成本地的一块磁盘使用。 通过...
protocol buffer... 目录 目录 什么是protocol buffer 1.protobuf 1.1安装  1.2使用...
在Word、WPS中插入AxM... 引言 我最近需要写一些文章,在排版时发现AxMath插入的公式竟然会导致行间距异常&#...
【PdgCntEditor】解... 一、问题背景 大部分的图书对应的PDF,目录中的页码并非PDF中直接索引的页码...
修复 爱普生 EPSON L4... L4151 L4153 L4156 L4158 L4163 L4165 L4166 L4168 L4...
Fluent中创建监测点 1 概述某些仿真问题,需要创建监测点,用于获取空间定点的数据࿰...
educoder数据结构与算法...                                                   ...
MySQL下载和安装(Wind... 前言:刚换了一台电脑,里面所有东西都需要重新配置,习惯了所...
MFC文件操作  MFC提供了一个文件操作的基类CFile,这个类提供了一个没有缓存的二进制格式的磁盘...