aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2014-09-29 14:24:17 +0800
committerJoe MacDonald <joe_macdonald@mentor.com>2014-10-21 14:02:14 -0400
commitfd7b22c3f503e677c801d19a7dd1074d6cb66730 (patch)
tree75f349e05d954477a59df5c291d02c066227bf3c /meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb
parent71d2fe7c9e2681fede255d7f5b430d63a122ab18 (diff)
downloadmeta-openembedded-contrib-fd7b22c3f503e677c801d19a7dd1074d6cb66730.tar.gz
meta-openembedded-contrib-fd7b22c3f503e677c801d19a7dd1074d6cb66730.tar.bz2
meta-openembedded-contrib-fd7b22c3f503e677c801d19a7dd1074d6cb66730.zip
ebtables: fix for sysvinit and systemd
The solution mainly references Fedora20. Extract the common part of the code and install it into ${sbindir}. Add systemd service file. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Diffstat (limited to 'meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb')
-rw-r--r--meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb22
1 files changed, 17 insertions, 5 deletions
diff --git a/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb b/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb
index 9222b2d447..32cfc752b4 100644
--- a/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb
+++ b/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb
@@ -15,6 +15,8 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/ebtables/ebtables-v${PV}.tar.gz \
file://installnonroot.patch \
file://01debian_defaultconfig.patch \
file://ebtables.init \
+ file://ebtables.common \
+ file://ebtables.service \
file://no-as-needed.patch \
"
@@ -23,7 +25,7 @@ SRC_URI[sha256sum] = "dc6f7b484f207dc712bfca81645f45120cb6aee3380e77a1771e9c34a9
S = "${WORKDIR}/ebtables-v${PV}"
-inherit update-rc.d
+inherit update-rc.d systemd
EXTRA_OEMAKE = " \
BINDIR=${base_sbindir} \
@@ -39,21 +41,29 @@ EXTRA_OEMAKE = " \
"
do_install () {
+ install -d ${D}${sbindir}
+ install -m 0755 ${WORKDIR}/ebtables.common ${D}${sbindir}/ebtables.common
+ # Fix hardcoded paths in scripts
+ sed -i 's!/sbin/!${base_sbindir}/!g' ${D}${sbindir}/ebtables.common
+ sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sbindir}/ebtables.common
+
install -d ${D}${sysconfdir}/init.d
install -d ${D}${sysconfdir}/default
install -d ${D}${sysconfdir}/ebtables
oe_runmake DESTDIR='${D}' install
install -m 0755 ${WORKDIR}/ebtables.init ${D}/${sysconfdir}/init.d/ebtables
mv ${D}${sysconfdir}/default/ebtables-config ${D}${sysconfdir}/default/ebtables
-
- # Fix hardcoded paths in scripts
- sed -i 's!/sbin/!${base_sbindir}/!g' ${D}/${sysconfdir}/init.d/ebtables
- sed -i 's!/etc/!${sysconfdir}/!g' ${D}/${sysconfdir}/init.d/ebtables
+ sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/ebtables
# The script ebtables-save refernces perl in exec_prefix, so
# move it to sbindir to avoid QA issue
install -d ${D}/${sbindir}
mv ${D}/${base_sbindir}/ebtables-save ${D}/${sbindir}
+
+ # Install systemd service files
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/ebtables.service ${D}${systemd_unitdir}/system
+ sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/ebtables.service
}
CONFFILES_${PN} += "${sysconfdir}/default/ebtables"
@@ -61,5 +71,7 @@ CONFFILES_${PN} += "${sysconfdir}/default/ebtables"
INITSCRIPT_NAME = "ebtables"
INITSCRIPT_PARAMS = "start 41 S . stop 41 6 ."
+SYSTEMD_SERVICE_${PN} = "ebtables.service"
+
FILES_${PN}-dbg += "${base_libdir}/ebtables/.debug"
FILES_${PN} += "${base_libdir}/ebtables/*.so"