From 61069b82fce98b17ae17062153a5af3cfe5951fa Mon Sep 17 00:00:00 2001 From: David Yang Date: Sat, 5 Dec 2020 16:57:53 +0800 Subject: [PATCH] i2pd: Update to 2.35.0 Signed-off-by: David Yang --- net/i2pd/Makefile | 16 ++++++++++++---- net/i2pd/files/i2pd.config | 4 +++- net/i2pd/files/i2pd.init | 21 +++++++++++---------- net/i2pd/patches/010-config.patch | 9 +++++++-- 4 files changed, 33 insertions(+), 17 deletions(-) diff --git a/net/i2pd/Makefile b/net/i2pd/Makefile index 6d8c5addf..2bcc74042 100644 --- a/net/i2pd/Makefile +++ b/net/i2pd/Makefile @@ -9,18 +9,20 @@ include $(TOPDIR)/rules.mk PKG_NAME:=i2pd -PKG_VERSION:=2.32.1 -PKG_RELEASE:=2 -PKG_BUILD_PARALLEL:=1 +PKG_VERSION:=2.35.0 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/PurpleI2P/i2pd/tar.gz/$(PKG_VERSION)? -PKG_HASH:=64229101411a9dda3237dc27939aa13ec90d4900aae499e59931063c36e8556b +PKG_HASH:=d041fd4e7a88ac168e76f66fdab40174ad093cdc13451cdbd0dd1216e5581f8a PKG_MAINTAINER:=David Yang PKG_LICENSE:=BSD-3-Clause PKG_LICENSE_FILES:=LICENSE +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + include $(INCLUDE_DIR)/package.mk define Package/i2pd @@ -46,6 +48,12 @@ define Package/i2pd/conffiles /etc/i2pd/tunnels.d/ endef +define Build/Prepare + $(Build/Prepare/Default) + # race condition + cd $(PKG_BUILD_DIR); $(MAKE) mk_obj_dir +endef + TARGET_LDFLAGS+=-latomic MAKE_FLAGS+=USE_AESNI=no USE_AVX=no diff --git a/net/i2pd/files/i2pd.config b/net/i2pd/files/i2pd.config index 426ff9d11..c75bad211 100644 --- a/net/i2pd/files/i2pd.config +++ b/net/i2pd/files/i2pd.config @@ -1,8 +1,10 @@ config i2pd + # Make sure your directories have the right owner! (i2pd:i2pd) + # Set where i2pd should store its data (netDB, certificates, addresses, # etc). By default we store it in RAM so no data is written to ROM. # If you store data permanently, you may want to enable - # 'profiles = true' and 'addressbook = true' in i2pd.conf + # 'profiles = true' and 'addressbook = true' in i2pd.conf. #### IMPORTANT! #### # Data is consistently rewritten. DO NOT POINT IT TO INNER ROM. Flash # will die. diff --git a/net/i2pd/files/i2pd.init b/net/i2pd/files/i2pd.init index 4c4790fc3..30dddae10 100755 --- a/net/i2pd/files/i2pd.init +++ b/net/i2pd/files/i2pd.init @@ -17,7 +17,6 @@ CONFFILE=/etc/i2pd/i2pd.conf . /lib/functions.sh - i2pd_start() { local cfg="$1" local data_dir @@ -27,16 +26,19 @@ i2pd_start() { config_get addressbook_dir "$cfg" addressbook_dir ## Setting up data dir - [ -d "$data_dir" ] || { + if [ ! -d "$data_dir" ] ; then mkdir -p "$data_dir" chown "$USER:$GROUP" "$data_dir" ln -s /usr/share/i2pd/certificates "$data_dir/certificates" - [ -n "$addressbook_dir" ] && { - [ -d "$addressbook_dir" ] || mkdir -p "$addressbook_dir" - chown "$USER:$GROUP" "$addressbook_dir" + if [ -n "$addressbook_dir" ] ; then + if [ ! -d "$addressbook_dir" ] ; then + mkdir -p "$addressbook_dir" + chown "$USER:$GROUP" "$addressbook_dir" + fi ln -s "$addressbook_dir" "$data_dir/addressbook" - } - } + fi + fi + [ -d "$DATADIR" ] || ln -s "$data_dir" "$DATADIR" ## We need permissions touch "$PIDFILE" @@ -44,7 +46,6 @@ i2pd_start() { procd_open_instance procd_set_param command "$PROG" --service --conf="$CONFFILE" --pidfile "$PIDFILE" - ## Don't know about i2pd user's HOME procd_set_param env "HOME=$DATADIR" ## For debugging, provide about 512 MB on external storage for coredump and adjust /proc/sys/kernel/core_pattern # echo "/tmp/coredumps/core.%e.%p.%s.%t" > /proc/sys/kernel/core_pattern @@ -65,13 +66,13 @@ start_service() { config_cb() { local type="$1" local name="$2" - [ "$type" = "i2pd" ] && [ -n "$instance" ] && [ "$instance" = "$name" ] && instance_found=1 + [ "$type" = "i2pd" -a -n "$instance" -a "$instance" = "$name" ] && instance_found=1 } config_load i2pd if [ -n "$instance" ]; then - [ "$instance_found" -gt 0 ] || return + [ "$instance_found" = 0 ] && return i2pd_start "$instance" else config_foreach i2pd_start i2pd diff --git a/net/i2pd/patches/010-config.patch b/net/i2pd/patches/010-config.patch index c3bfbcb28..be0584a4c 100644 --- a/net/i2pd/patches/010-config.patch +++ b/net/i2pd/patches/010-config.patch @@ -1,3 +1,5 @@ +diff --git a/contrib/i2pd.conf b/contrib/i2pd.conf +index 5ef39bc9..8d5034eb 100644 --- a/contrib/i2pd.conf +++ b/contrib/i2pd.conf @@ -8,12 +8,12 @@ @@ -11,7 +13,7 @@ ## Use that path to store separated tunnels in different config files. ## Default: ~/.i2pd/tunnels.d or /var/lib/i2pd/tunnels.d -# tunnelsdir = /var/lib/i2pd/tunnels.d -+tunnelsdir = /etc/i2pd/tunnels.conf ++tunnelsdir = /etc/i2pd/tunnels.d ## Where to write pidfile (default: i2pd.pid, not used in Windows) # pidfile = /run/i2pd.pid @@ -78,10 +80,13 @@ port = 4447 ## Optional keys file for proxy local destination # keys = socks-proxy-keys.dat -@@ -228,4 +230,5 @@ verify = true +@@ -228,7 +230,8 @@ verify = true [persist] ## Save peer profiles on disk (default: true) -# profiles = true +profiles = false +addressbook = false + + [cpuext] + ## Use CPU AES-NI instructions set when work with cryptography when available (default: true)