From 1bb157401b823d6a18222d7f943dc98fb20d7f04 Mon Sep 17 00:00:00 2001 From: Philip Prindeville Date: Fri, 1 May 2020 11:45:25 -0600 Subject: [PATCH] xtables-addons: iptgeoip: preserve database across sysupgrade Updating the system image or the package should not obliterate the downloaded/unpacked geolocation database. If you use xt_geoip in /etc/firewall.user you don't want the database disappearing when sysupgrade runs and then reboots your system as you'll be left exposed. Signed-off-by: Philip Prindeville --- net/xtables-addons/Makefile | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/net/xtables-addons/Makefile b/net/xtables-addons/Makefile index bf1b6f98ce..c5e2c3f8a3 100644 --- a/net/xtables-addons/Makefile +++ b/net/xtables-addons/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=xtables-addons PKG_VERSION:=3.13 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_HASH:=893c0c4ea09759cda1ab7e68f1281d125e59270f7b59e446204ce686c6a76d65 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz @@ -139,6 +139,22 @@ define Package/iptgeoip +wget-ssl +!BUSYBOX_CONFIG_ZCAT:gzip endef +define Package/iptgeoip/config + menu "Select iptgeoip options" + config IPTGEOIP_PRESERVE + bool "Preserve across sysupgrades" + default n + help + Backup and restore during sysupgrade (requires >7MB) + endmenu +endef + +ifeq ($(CONFIG_IPTGEOIP_PRESERVE),y) +define Package/iptgeoip/conffiles +/usr/share/xt_geoip/ +endef +endif + define Package/iptgeoip/install $(INSTALL_DIR) $(1)/usr/lib/xtables-addons $(CP) \ @@ -149,6 +165,7 @@ define Package/iptgeoip/install $(PKG_INSTALL_DIR)/usr/bin/xt_geoip_fetch \ $(1)/usr/bin/ $(INSTALL_DIR) $(1)/usr/share/xt_geoip + touch $(1)/usr/share/xt_geoip/.keep endef