Skip to contentSkip to conversation

some modifies

PATCH New Bian Naimeng 1 participant 3 messages Feb 16, 2015

lore
Share & tools
lore
#0 lore raw

cover some modifies

Bian Naimeng (2):
ipsec-tools: install a sample config file for racoon
ipsec-tools: add systemd supported

 .../ipsec-tools/ipsec-tools/racoon.conf            |  8 +++++
 .../ipsec-tools/ipsec-tools/racoon.conf.sample     | 40 ++++++++++++++++++++++
 .../ipsec-tools/ipsec-tools/racoon.service         | 11 ++++++
 .../ipsec-tools/ipsec-tools_0.8.2.bb               | 22 +++++++++++-
 4 files changed, 80 insertions(+), 1 deletion(-)
 create mode 100644 meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon.conf
 create mode 100644 meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon.conf.sample
 create mode 100644 meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon.service
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/2 ipsec-tools: install a sample config file for racoon

---
 .../ipsec-tools/ipsec-tools/racoon.conf.sample     | 40 ++++++++++++++++++++++
 .../ipsec-tools/ipsec-tools_0.8.2.bb               |  7 ++++
 2 files changed, 47 insertions(+)
 create mode 100644 meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon.conf.sample
meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon.conf.sample new file +40 -0
new file mode 100644
index 0000000..2948a4a
@@ -0,0 +1,40 @@
+#
+# NOTE: This file will not be used if you use racoon-tool(8) to manage your
+# IPsec connections. racoon-tool will process racoon-tool.conf(5) and
+# generate a configuration (/var/lib/racoon/racoon.conf) and use it, instead
+# of this file.
+#
+# Simple racoon.conf
+# 
+#
+# Please look in /usr/share/doc/racoon/examples for
+# examples that come with the source.
+#
+# Please read racoon.conf(5) for details, and alsoread setkey(8).
+#
+#
+# Also read the Linux IPSEC Howto up at 
+# http://www.ipsec-howto.org/t1.html 
+#
+log notify;
+path pre_shared_key "/etc/racoon/psk.txt";
+path certificate "/etc/racoon/certs";
+
+#remote 172.31.1.1 {
+#        exchange_mode main,aggressive;
+#        proposal {
+#                encryption_algorithm 3des;
+#                hash_algorithm sha1;
+#                authentication_method pre_shared_key;
+#                dh_group modp1024;
+#        }
+#        generate_policy off;
+#}
+# 
+#sainfo address 192.168.203.10[any] any address 192.168.22.0/24[any] any {
+#        pfs_group modp768;
+#        encryption_algorithm 3des;
+#        authentication_algorithm hmac_md5;
+#        compression_algorithm deflate;
+#}
+
meta-networking/recipes-support/ipsec-tools/ipsec-tools_0.8.2.bb +7 -0
index 8cc55ef..7519d83 100644
@@ -15,6 +15,7 @@ SRC_URI = "ftp://ftp.netbsd.org/pub/NetBSD/misc/ipsec-tools/0.8/ipsec-tools-${PV
            file://racoon-check-invalid-ivm.patch \
            file://glibc-2.20.patch \
            file://racoon-Resend-UPDATE-message-when-received-EINTR-message.patch \
+           file://racoon.conf.sample \
           "
 SRC_URI[md5sum] = "d53ec14a0a3ece64e09e5e34b3350b41"
 SRC_URI[sha256sum] = "8eb6b38716e2f3a8a72f1f549c9444c2bc28d52c9536792690564c74fe722f2d"
@@ -54,6 +55,7 @@ EXTRA_OECONF = "--with-kernel-headers=${STAGING_INCDIR} \
                 --enable-shared \
                 --enable-dpd \
                 --enable-natt=yes \
+                --sysconfdir=${sysconfdir}/racoon \
                 ${@base_contains('DISTRO_FEATURES', 'ipv6', '--enable-ipv6=yes', '', d)}"
 
 # See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=530527
@@ -62,3 +64,8 @@ CFLAGS += "-fno-strict-aliasing"
 PACKAGECONFIG ??= ""
 PACKAGECONFIG[pam] = "--with-libpam,--without-libpam,libpam,"
 PACKAGECONFIG[selinux] = "--enable-security-context,--disable-security-context,libselinux,"
+
+do_install_append() {
+    install -d ${D}${sysconfdir}/racoon
+    install -m 0644 ${WORKDIR}/racoon.conf.sample ${D}${sysconfdir}/racoon/racoon.conf
+}
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/2 ipsec-tools: add systemd supported

In reply to Bian Naimeng
---
 .../recipes-support/ipsec-tools/ipsec-tools/racoon.conf   |  8 ++++++++
 .../ipsec-tools/ipsec-tools/racoon.service                | 11 +++++++++++
 .../recipes-support/ipsec-tools/ipsec-tools_0.8.2.bb      | 15 ++++++++++++++-
 3 files changed, 33 insertions(+), 1 deletion(-)
 create mode 100644 meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon.conf
 create mode 100644 meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon.service
meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon.conf new file +8 -0
new file mode 100644
index 0000000..6b50750
@@ -0,0 +1,8 @@
+# Defaults for racoon service
+# sourced by racoon.service
+# installed at /etc/default/racoon by the maintainer scripts
+#
+# This is a POSIX shell fragment
+#
+# Arguments to pass to racoon
+RACOON_ARGS=""
meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon.service new file +11 -0
new file mode 100644
index 0000000..a10e770
@@ -0,0 +1,11 @@
+[Unit]
+Description=Racoon IKEv1 key management daemon for IPSEC
+After=syslog.target network.target
+
+[Service]
+Type=forking
+EnvironmentFile=-@SYSCONFDIR@/default/racoon
+ExecStart=@SBINDIR@/racoon $RACOON_ARGS
+
+[Install]
+WantedBy=multi-user.target
meta-networking/recipes-support/ipsec-tools/ipsec-tools_0.8.2.bb +14 -1
index 7519d83..9704b13 100644
@@ -16,11 +16,13 @@ SRC_URI = "ftp://ftp.netbsd.org/pub/NetBSD/misc/ipsec-tools/0.8/ipsec-tools-${PV
            file://glibc-2.20.patch \
            file://racoon-Resend-UPDATE-message-when-received-EINTR-message.patch \
            file://racoon.conf.sample \
+           file://racoon.conf \
+           file://racoon.service \
           "
 SRC_URI[md5sum] = "d53ec14a0a3ece64e09e5e34b3350b41"
 SRC_URI[sha256sum] = "8eb6b38716e2f3a8a72f1f549c9444c2bc28d52c9536792690564c74fe722f2d"
 
-inherit autotools
+inherit autotools systemd
 
 # Options:
 #  --enable-adminport      enable admin port
@@ -68,4 +70,15 @@ PACKAGECONFIG[selinux] = "--enable-security-context,--disable-security-context,l
 do_install_append() {
     install -d ${D}${sysconfdir}/racoon
     install -m 0644 ${WORKDIR}/racoon.conf.sample ${D}${sysconfdir}/racoon/racoon.conf
+
+    if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+        install -d ${D}${systemd_unitdir}/system
+        install -m 0644 ${WORKDIR}/racoon.service ${D}${systemd_unitdir}/system
+
+        sed -i -e 's#@SYSCONFDIR@#${sysconfdir}#g' ${D}${systemd_unitdir}/system/racoon.service
+        sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/racoon.service
+
+        install -d ${D}${sysconfdir}/default/
+        install -m 0644 ${WORKDIR}/racoon.conf ${D}${sysconfdir}/default/racoon
+    fi
 }
Signature · 1 line
1.9.1