summaryrefslogtreecommitdiff
path: root/meta-quanta
diff options
context:
space:
mode:
authorTim Lee <timlee660101@gmail.com>2020-06-18 05:28:18 +0300
committerAndrew Geissler <geissonator@yahoo.com>2020-07-30 01:06:23 +0300
commit7e8cdc31c10c1b443063075e5ab6705c378e8ab1 (patch)
treed8ff0e9af54a1d53b16cb17583a4b2e049c02fee /meta-quanta
parent40c92f2f8c69d402c87d8caaf7e76ed0a6b6b77b (diff)
downloadopenbmc-7e8cdc31c10c1b443063075e5ab6705c378e8ab1.tar.xz
meta-quanta: olympus-nuvoton: iptable: save rules while bmc rebooting
The iptable needs to be preserved in order keep the rules. Tested: Verified for Olympus platform (From meta-quanta rev: ae01a4669bc1653ed81998573f25b8dc62a4794b) Signed-off-by: Joseph Liu <kwliu@nuvoton.com> Signed-off-by: Tim Lee <timlee660101@gmail.com> Change-Id: Ic9b226f21a2526994bdf353701d0ca7b7d053d8a Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Diffstat (limited to 'meta-quanta')
-rw-r--r--meta-quanta/meta-olympus-nuvoton/recipes-olympus-nuvoton/network/olympus-nuvoton-iptable-save.bb17
-rw-r--r--meta-quanta/meta-olympus-nuvoton/recipes-olympus-nuvoton/network/olympus-nuvoton-iptable-save/phosphor-save-iptable-rules.service12
2 files changed, 29 insertions, 0 deletions
diff --git a/meta-quanta/meta-olympus-nuvoton/recipes-olympus-nuvoton/network/olympus-nuvoton-iptable-save.bb b/meta-quanta/meta-olympus-nuvoton/recipes-olympus-nuvoton/network/olympus-nuvoton-iptable-save.bb
new file mode 100644
index 000000000..2416ef932
--- /dev/null
+++ b/meta-quanta/meta-olympus-nuvoton/recipes-olympus-nuvoton/network/olympus-nuvoton-iptable-save.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Iptable Save"
+DESCRIPTION = "Save iptable rules"
+PR = "r1"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
+
+inherit allarch systemd
+
+SRC_URI = "file://phosphor-save-iptable-rules.service"
+SYSTEMD_SERVICE_${PN} = "phosphor-save-iptable-rules.service"
+
+S = "${WORKDIR}"
+do_install() {
+ install -d ${D}${systemd_unitdir}/system/
+ install -m 0644 ${WORKDIR}/phosphor-save-iptable-rules.service \
+ ${D}${systemd_unitdir}/system
+}
diff --git a/meta-quanta/meta-olympus-nuvoton/recipes-olympus-nuvoton/network/olympus-nuvoton-iptable-save/phosphor-save-iptable-rules.service b/meta-quanta/meta-olympus-nuvoton/recipes-olympus-nuvoton/network/olympus-nuvoton-iptable-save/phosphor-save-iptable-rules.service
new file mode 100644
index 000000000..9c340bd48
--- /dev/null
+++ b/meta-quanta/meta-olympus-nuvoton/recipes-olympus-nuvoton/network/olympus-nuvoton-iptable-save/phosphor-save-iptable-rules.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Save iptable rules
+DefaultDependencies=no
+After=shutdown.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=true
+ExecStart=/bin/sh -c "iptables-save > /etc/iptables/iptables.rules"
+
+[Install]
+WantedBy=shutdown.target