[OE-core] [PATCH] iputils: enable rdisc and add systemd support.
Li xin
lixin.fnst at cn.fujitsu.com
Thu Jun 11 05:56:53 UTC 2015
Signed-off-by: Li Xin <lixin.fnst at cn.fujitsu.com>
---
.../iputils/files/enable-rdisc.patch | 21 +++++++++++++++++++++
meta/recipes-extended/iputils/files/rdisc.conf | 1 +
meta/recipes-extended/iputils/files/rdisc.service | 11 +++++++++++
meta/recipes-extended/iputils/iputils_s20121221.bb | 22 ++++++++++++++++++++--
4 files changed, 53 insertions(+), 2 deletions(-)
create mode 100644 meta/recipes-extended/iputils/files/enable-rdisc.patch
create mode 100644 meta/recipes-extended/iputils/files/rdisc.conf
create mode 100644 meta/recipes-extended/iputils/files/rdisc.service
diff --git a/meta/recipes-extended/iputils/files/enable-rdisc.patch b/meta/recipes-extended/iputils/files/enable-rdisc.patch
new file mode 100644
index 0000000..7e0cb08
--- /dev/null
+++ b/meta/recipes-extended/iputils/files/enable-rdisc.patch
@@ -0,0 +1,21 @@
+diff -Nurp iputils-s20121221.orig/Makefile iputils-s20121221/Makefile
+--- iputils-s20121221.orig/Makefile 2015-02-15 17:50:39.135219862 +0800
++++ iputils-s20121221/Makefile 2015-02-15 17:51:40.843221908 +0800
+@@ -44,7 +44,7 @@ USE_RESOLV=yes
+ ENABLE_PING6_RTHDR=no
+
+ # rdisc server (-r option) support [no|yes]
+-ENABLE_RDISC_SERVER=no
++ENABLE_RDISC_SERVER=yes
+
+ # -------------------------------------
+ # What a pity, all new gccs are buggy and -Werror does not work. Sigh.
+@@ -108,7 +108,7 @@ endif
+ # -------------------------------------
+ IPV4_TARGETS=tracepath ping clockdiff arping
+ IPV6_TARGETS=tracepath6 traceroute6 ping6
+-TARGETS=$(IPV4_TARGETS) $(IPV6_TARGETS)
++TARGETS=$(IPV4_TARGETS) $(IPV6_TARGETS) rdisc
+
+ CFLAGS=$(CCOPTOPT) $(CCOPT) $(GLIBCFIX) $(DEFINES)
+ LDLIBS=$(LDLIB) $(ADDLIB)
diff --git a/meta/recipes-extended/iputils/files/rdisc.conf b/meta/recipes-extended/iputils/files/rdisc.conf
new file mode 100644
index 0000000..2e6b02e
--- /dev/null
+++ b/meta/recipes-extended/iputils/files/rdisc.conf
@@ -0,0 +1 @@
+RDISCOPTS=""
diff --git a/meta/recipes-extended/iputils/files/rdisc.service b/meta/recipes-extended/iputils/files/rdisc.service
new file mode 100644
index 0000000..b799b8a
--- /dev/null
+++ b/meta/recipes-extended/iputils/files/rdisc.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=rdisc daemon which discovers routers on the local subnet
+After=syslog.target network.target
+
+[Service]
+Type=forking
+EnvironmentFile=@SYSCONFDIR@/default/rdisc
+ExecStart=@BASE_BINDIR@/rdisc $RDISCOPTS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta/recipes-extended/iputils/iputils_s20121221.bb b/meta/recipes-extended/iputils/iputils_s20121221.bb
index e87a32a..72afd45 100644
--- a/meta/recipes-extended/iputils/iputils_s20121221.bb
+++ b/meta/recipes-extended/iputils/iputils_s20121221.bb
@@ -19,6 +19,9 @@ SRC_URI = "http://www.skbuff.net/iputils/${BPN}-${PV}.tar.bz2 \
file://debian/targets.diff \
file://nsgmls-path-fix.patch \
file://fix-build-command-line-argument-with-gnutls.patch \
+ file://enable-rdisc.patch \
+ file://rdisc.conf \
+ file://rdisc.service \
"
SRC_URI[md5sum] = "6072aef64205720dd1893b375e184171"
@@ -43,9 +46,18 @@ do_install () {
for i in tracepath.8 traceroute6.8 ping.8 arping.8; do
install -m 0644 doc/$i ${D}${mandir}/man8/ || true
done
+
+ install -m 4555 ${S}/clockdiff ${D}/${base_bindir}/
+ install -m 0755 ${S}/rdisc ${D}/${base_bindir}/
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/rdisc.service ${D}${systemd_unitdir}/system
+ sed -i -e 's#@BASE_BINDIR@#${base_bindir}#g' ${D}${systemd_unitdir}/system/rdisc.service
+ sed -i -e 's#@SYSCONFDIR@#${sysconfdir}#g' ${D}${systemd_unitdir}/system/rdisc.service
+ install -d ${D}${sysconfdir}/default/
+ install -m 0644 ${WORKDIR}/rdisc.conf ${D}${sysconfdir}/default/rdisc
}
-inherit update-alternatives
+inherit update-alternatives systemd
ALTERNATIVE_PRIORITY = "100"
@@ -55,7 +67,7 @@ ALTERNATIVE_LINK_NAME[ping] = "${base_bindir}/ping"
ALTERNATIVE_${PN}-ping6 = "ping6"
ALTERNATIVE_LINK_NAME[ping6] = "${base_bindir}/ping6"
-PACKAGES += "${PN}-ping ${PN}-ping6 ${PN}-arping ${PN}-tracepath ${PN}-tracepath6 ${PN}-traceroute6 ${PN}-clockdiff"
+PACKAGES += "${PN}-ping ${PN}-ping6 ${PN}-arping ${PN}-tracepath ${PN}-tracepath6 ${PN}-traceroute6 ${PN}-clockdiff ${PN}-rdisc"
ALLOW_EMPTY_${PN} = "1"
RDEPENDS_${PN} += "${PN}-ping ${PN}-ping6 ${PN}-arping ${PN}-tracepath ${PN}-tracepath6 ${PN}-traceroute6 ${PN}-clockdiff"
@@ -69,3 +81,9 @@ FILES_${PN}-tracepath6 = "${base_bindir}/tracepath6"
FILES_${PN}-traceroute6 = "${base_bindir}/traceroute6"
FILES_${PN}-clockdiff = "${base_bindir}/clockdiff"
FILES_${PN}-doc = "${mandir}/man8"
+
+FILES_${PN}-clockdiff = "${base_bindir}/clockdiff"
+FILES_${PN}-rdisc = "${base_bindir}/rdisc \
+ ${sysconfdir}/default/rdisc \
+ ${systemd_unitdir}/system/rdisc.service"
+
--
1.8.4.2
More information about the Openembedded-core
mailing list