Pull in updated system / network components from upstream (stage 1)
authorRISCi_ATOM <bob@bobcall.me>
Wed, 21 Feb 2018 21:21:52 +0000 (16:21 -0500)
committerRISCi_ATOM <bob@bobcall.me>
Wed, 21 Feb 2018 21:21:52 +0000 (16:21 -0500)
25 files changed:
package/network/config/firewall/Makefile
package/network/config/netifd/Makefile
package/network/config/netifd/files/etc/init.d/network
package/network/config/netifd/files/lib/netifd/dhcp.script
package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
package/system/ca-certificates/Makefile
package/system/fstools/Makefile
package/system/fstools/files/blockd.init [new file with mode: 0755]
package/system/fstools/files/snapshot
package/system/mtd/src/Makefile
package/system/mtd/src/mtd.c
package/system/mtd/src/mtd.h
package/system/mtd/src/wrg.c [new file with mode: 0644]
package/system/opkg/Makefile
package/system/procd/Makefile
package/system/procd/files/hotplug-preinit.json
package/system/procd/files/hotplug.json
package/system/procd/files/procd.sh
package/system/rpcd/Makefile
package/system/ubox/Makefile
package/system/ubox/files/log.init
package/system/ubus/Makefile
package/system/uci/Makefile
package/system/uci/files/lib/config/uci.sh
package/system/usign/Makefile

index e5fcb8c916803978460ec2a67f351ecd9564d9c7..47ce836b86f3bc4314f30b0f21068fab3384956c 100644 (file)
@@ -9,13 +9,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=firewall
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=$(LEDE_GIT)/project/firewall3.git
-PKG_SOURCE_DATE:=2017-05-27
-PKG_SOURCE_VERSION:=a4d98aea373e04f3fdc3c492c1688ba52ce490a9
-PKG_MIRROR_HASH:=55402b1e6bb471f6aed599c61c1c63b58212f5789f094d78247646fc0a7cf435
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/firewall3.git
+PKG_SOURCE_DATE:=2017-11-07
+PKG_SOURCE_VERSION:=c4309372acc7e1bef8aa230269f7da1dec790e68
+PKG_MIRROR_HASH:=1699884d8499d01e433959185f79ff9eb69704de47885b996123374b8015b422
 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
 PKG_LICENSE:=ISC
 
@@ -28,7 +28,7 @@ define Package/firewall
   SECTION:=net
   CATEGORY:=Base system
   TITLE:=OpenWrt C Firewall
-  DEPENDS:=+libubox +libubus +libuci +libip4tc +IPV6:libip6tc +libxtables +kmod-ipt-core +kmod-ipt-conntrack +kmod-ipt-nat
+  DEPENDS:=+libubox +libubus +libuci +libip4tc +IPV6:libip6tc +libxtables +kmod-ipt-core +kmod-ipt-conntrack +IPV6:kmod-nf-conntrack6 +kmod-ipt-nat
 endef
 
 define Package/firewall/description
index fb035864017df739a0d0b0c0451fe8488a40c77c..d2210e7c2e148917fca62180c3a66e002b9a2f7c 100644 (file)
@@ -1,13 +1,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=netifd
-PKG_RELEASE:=1
+PKG_RELEASE:=3
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=$(LEDE_GIT)/project/netifd.git
-PKG_SOURCE_DATE:=2017-01-25
-PKG_SOURCE_VERSION:=650758b16e5185505a3fbc1307949340af70b611
-PKG_MIRROR_HASH:=d09c740bc1bf6269678bd75c9af52ecd4be3d1d59402a543ceb9d4459cecfa2b
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git
+PKG_SOURCE_DATE:=2018-02-05
+PKG_SOURCE_VERSION:=1be329c66326c86d7a48ba71004fcef7691bbbf9
+PKG_MIRROR_HASH:=06c1c24ed56b4fe39b92b33719f8bd4f9a8fe3c6a25ce02a6a245e859f1237bf
 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
 
 PKG_LICENSE:=GPL-2.0
index a825dfd31fbc805feae2ede556ddef7f728dfb72..6cd167d19d221dead5e0dc28a518c21c8c120dbb 100755 (executable)
@@ -26,9 +26,12 @@ start_service() {
 }
 
 reload_service() {
+       local rv=0
+
        init_switch
-       ubus call network reload
+       ubus call network reload || rv=1
        /sbin/wifi reload_legacy
+       return $rv
 }
 
 stop_service() {
index b3a61e27509061f9d6aa849deb45130f88a12161..00604f40e70e8ba988bde6af04437d326b5b548a 100755 (executable)
@@ -18,10 +18,18 @@ setup_interface () {
        proto_add_ipv4_address "$ip" "${subnet:-255.255.255.0}"
        # TODO: apply $broadcast
 
+       local ip_net
+       eval "$(ipcalc.sh "$ip/$mask")";ip_net="$NETWORK"
+
+       local i
        for i in $router; do
-               proto_add_ipv4_route "$i" 32 "" "$ip"
+               local gw_net
+               eval "$(ipcalc.sh "$i/$mask")";gw_net="$NETWORK"
+
+               [ "$ip_net" != "$gw_net" ] && proto_add_ipv4_route "$i" 32 "" "$ip"
                proto_add_ipv4_route 0.0.0.0 0 "$i" "$ip"
 
+               local r
                for r in $CUSTOMROUTES; do
                        proto_add_ipv4_route "${r%%/*}" "${r##*/}" "$i" "$ip"
                done
@@ -31,11 +39,11 @@ setup_interface () {
        [ -n "$staticroutes" ] && set_classless_routes $staticroutes
        [ -n "$msstaticroutes" ] && set_classless_routes $msstaticroutes
 
-       for dns in $dns; do
-               proto_add_dns_server "$dns"
+       for i in $dns; do
+               proto_add_dns_server "$i"
        done
-       for domain in $domain; do
-               proto_add_dns_search "$domain"
+       for i in $domain; do
+               proto_add_dns_search "$i"
        done
 
        proto_add_data
@@ -60,7 +68,7 @@ setup_interface () {
                ip6rd="${ip6rd#* }"
                local ip6rdbr="${ip6rd%% *}"
 
-               [ -n "$ZONE" ] || ZONE=$(fw3 -q network $INTERFACE)
+               [ -n "$ZONE" ] || ZONE=$(fw3 -q network $INTERFACE 2>/dev/null)
                [ -z "$IFACE6RD" -o "$IFACE6RD" = 1 ] && IFACE6RD=${INTERFACE}_6
 
                json_init
index ea02d68bb4fb00a2365c4f9bfd68ea1c3b7d34ba..385cfc397474f94eee37df500dd7c35a5ecef6a3 100755 (executable)
@@ -14,6 +14,7 @@ proto_dhcp_init_config() {
        proto_config_add_boolean 'broadcast:bool'
        proto_config_add_boolean 'release:bool'
        proto_config_add_string 'reqopts:list(string)'
+       proto_config_add_boolean 'defaultreqopts:bool'
        proto_config_add_string iface6rd
        proto_config_add_string sendopts
        proto_config_add_boolean delegate
@@ -28,8 +29,8 @@ proto_dhcp_setup() {
        local config="$1"
        local iface="$2"
 
-       local ipaddr hostname clientid vendorid broadcast release reqopts iface6rd sendopts delegate zone6rd zone mtu6rd customroutes classlessroute
-       json_get_vars ipaddr hostname clientid vendorid broadcast release reqopts iface6rd sendopts delegate zone6rd zone mtu6rd customroutes classlessroute
+       local ipaddr hostname clientid vendorid broadcast release reqopts defaultreqopts iface6rd sendopts delegate zone6rd zone mtu6rd customroutes classlessroute
+       json_get_vars ipaddr hostname clientid vendorid broadcast release reqopts defaultreqopts iface6rd sendopts delegate zone6rd zone mtu6rd customroutes classlessroute
 
        local opt dhcpopts
        for opt in $reqopts; do
@@ -40,6 +41,8 @@ proto_dhcp_setup() {
                append dhcpopts "-x $opt"
        done
 
+       [ -z "$hostname" ] && hostname="$(cat /proc/sys/kernel/hostname)"
+       [ "$defaultreqopts" = 0 ] && defaultreqopts="-o" || defaultreqopts=
        [ "$broadcast" = 1 ] && broadcast="-B" || broadcast=
        [ "$release" = 1 ] && release="-R" || release=
        [ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}" || clientid="-C"
@@ -61,7 +64,7 @@ proto_dhcp_setup() {
                ${ipaddr:+-r $ipaddr} \
                ${hostname:+-x "hostname:$hostname"} \
                ${vendorid:+-V "$vendorid"} \
-               $clientid $broadcast $release $dhcpopts
+               $clientid $defaultreqopts $broadcast $release $dhcpopts
 }
 
 proto_dhcp_renew() {
index ecf9a6b039bf5995330795591bfcb27c679b2cc6..73a267e0b7fc4082e4243ee53475f54e5097ff86 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2016 OpenWrt.org
+# Copyright (C) 2006-2017 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -7,13 +7,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ca-certificates
-PKG_VERSION:=20161130+nmu1
+PKG_VERSION:=20170717
 PKG_MAINTAINER:=Christian Schoenebeck <christian.schoenebeck@gmail.com>
 
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/c/ca-certificates
-PKG_HASH:=77f9aca431e3122bf04aa0ffd989b723d906db4d1c106e3290e463d73c177f0e
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-20161130
+PKG_HASH:=e487639b641fa75445174734dd6e9d600373e3248b3d86a7e3c6d0f6977decd2
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
 
 PKG_INSTALL:=1
 
index 43febd4727b94bca1311987558b0363eb5319180..fe4530ac008f61e011d4f76a3733b089ac6c32c3 100644 (file)
@@ -11,11 +11,10 @@ PKG_NAME:=fstools
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=$(LEDE_GIT)/project/fstools.git
-PKG_SOURCE_DATE:=2017-06-30
-PKG_SOURCE_VERSION:=bdcb075fafdac0bfe3207c23f64acd58432bad86
-PKG_MIRROR_HASH:=760a1fdbd379f1191947ac6ba9881a85a9b8c43f4a96d49db18d4654b0c312c4
-PKG_RELEASE:=1
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/fstools.git
+PKG_SOURCE_DATE:=2018-02-11
+PKG_SOURCE_VERSION:=3d239815bb048041ec0d48cba273573d148ad7a9
+PKG_MIRROR_HASH:=28b7e9f6b8ba4ad3dcab44daa629df412af103bf31448177cffb0d176f0aacf1
 CMAKE_INSTALL:=1
 
 PKG_LICENSE:=GPL-2.0
@@ -67,6 +66,13 @@ define Package/block-mount
   DEPENDS:=+ubox +libubox +libuci
 endef
 
+define Package/blockd
+  SECTION:=base
+  CATEGORY:=Base system
+  TITLE:=Block device automounting
+  DEPENDS:=+block-mount +fstools +libubus +kmod-fs-autofs4
+endef
+
 define Package/fstools/install
        $(INSTALL_DIR) $(1)/sbin $(1)/lib
 
@@ -96,6 +102,12 @@ define Package/block-mount/install
 
 endef
 
+define Package/blockd/install
+       $(INSTALL_DIR) $(1)/sbin $(1)/etc/init.d/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/blockd $(1)/sbin/
+       $(INSTALL_BIN) ./files/blockd.init $(1)/etc/init.d/blockd
+endef
+
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include
        $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
@@ -106,3 +118,4 @@ endef
 $(eval $(call BuildPackage,fstools))
 $(eval $(call BuildPackage,snapshot-tool))
 $(eval $(call BuildPackage,block-mount))
+$(eval $(call BuildPackage,blockd))
diff --git a/package/system/fstools/files/blockd.init b/package/system/fstools/files/blockd.init
new file mode 100755 (executable)
index 0000000..a4ce57d
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/sh /etc/rc.common
+
+START=80
+
+USE_PROCD=1
+PROG=/sbin/blockd
+
+service_triggers() {
+       procd_add_reload_trigger "fstab"
+}
+
+reload_service() {
+       block autofs start
+}
+
+start_service() {
+       procd_open_instance
+       procd_set_param command "$PROG"
+       procd_set_param respawn
+       procd_close_instance
+}
index c1a5b733f3c70e2bb5f2e83d3589e2f10832760f..a495e3434523b7a4b1b2f1bc3f4c9298197fc745 100644 (file)
@@ -42,7 +42,7 @@ do_snapshot_upgrade() {
 
        opkg list-upgradable
        [ $? -eq 0 ] || exit 2
-       
+
        UPDATES=`opkg list-upgradable | cut -d" " -f1`
        [ -z "${UPDATES}" ] && exit 0
 
@@ -64,14 +64,16 @@ do_convert_jffs2() {
 do_convert() {
        . /lib/functions.sh
        . /lib/upgrade/common.sh
-       ubus call system upgrade
-       touch /tmp/sysupgrade
+
        cd /overlay/upper
        tar czf /tmp/snapshot.tar.gz *
-       kill_remaining TERM
-       sleep 3
-       kill_remaining KILL
-       run_ramfs '. /sbin/snapshot; do_convert_jffs2'
+
+       install_bin /sbin/upgraded
+       ubus call system sysupgrade "{
+               \"prefix\": \"$RAM_ROOT\",
+               \"path\": \"\",
+               \"command\": \". /sbin/snapshot; do_convert_jffs2\"
+       }"
 }
 
 [ -n "$(cat /proc/mounts|grep /overlay|grep jffs2)" ] && {
index 4e39a89315bc9605b4e21ec7e66c99fafae976fd..daeadbcd35eee3ab3058b62f0f6ab72adb4ae2fc 100644 (file)
@@ -4,13 +4,14 @@ LDFLAGS += -lubox
 
 obj = mtd.o jffs2.o crc32.o md5.o
 obj.seama = seama.o md5.o
+obj.wrg = wrg.o md5.o
 obj.wrgg = wrgg.o md5.o
 obj.ar71xx = trx.o $(obj.seama) $(obj.wrgg)
 obj.brcm = trx.o
 obj.brcm47xx = $(obj.brcm)
 obj.bcm53xx = $(obj.brcm) $(obj.seama)
 obj.brcm63xx = imagetag.o
-obj.ramips = $(obj.seama)
+obj.ramips = $(obj.seama) $(obj.wrg)
 obj.mvebu = linksys_bootcount.o
 obj.kirkwood = linksys_bootcount.o
 obj.ipq806x = linksys_bootcount.o
index e66e647c0135625bf57cbad69268063008642de3..55a3bdba8105dea7c6260b32e2f652c9225a1861 100644 (file)
@@ -54,6 +54,7 @@
 
 #define TRX_MAGIC              0x48445230      /* "HDR0" */
 #define SEAMA_MAGIC            0x5ea3a417
+#define WRG_MAGIC              0x20040220
 #define WRGG03_MAGIC           0x20080321
 
 #if !defined(__BYTE_ORDER)
@@ -76,6 +77,7 @@ enum mtd_image_format {
        MTD_IMAGE_FORMAT_UNKNOWN,
        MTD_IMAGE_FORMAT_TRX,
        MTD_IMAGE_FORMAT_SEAMA,
+       MTD_IMAGE_FORMAT_WRG,
        MTD_IMAGE_FORMAT_WRGG03,
 };
 
@@ -205,6 +207,8 @@ image_check(int imagefd, const char *mtd)
                imageformat = MTD_IMAGE_FORMAT_TRX;
        else if (be32_to_cpu(magic) == SEAMA_MAGIC)
                imageformat = MTD_IMAGE_FORMAT_SEAMA;
+       else if (le32_to_cpu(magic) == WRG_MAGIC)
+               imageformat = MTD_IMAGE_FORMAT_WRG;
        else if (le32_to_cpu(magic) == WRGG03_MAGIC)
                imageformat = MTD_IMAGE_FORMAT_WRGG03;
 
@@ -214,7 +218,7 @@ image_check(int imagefd, const char *mtd)
                        ret = trx_check(imagefd, mtd, buf, &buflen);
                break;
        case MTD_IMAGE_FORMAT_SEAMA:
-               break;
+       case MTD_IMAGE_FORMAT_WRG:
        case MTD_IMAGE_FORMAT_WRGG03:
                break;
        default:
@@ -685,6 +689,10 @@ resume:
                        if (mtd_fixseama)
                                mtd_fixseama(mtd, 0, 0);
                        break;
+               case MTD_IMAGE_FORMAT_WRG:
+                       if (mtd_fixwrg)
+                               mtd_fixwrg(mtd, 0, 0);
+                       break;
                case MTD_IMAGE_FORMAT_WRGG03:
                        if (mtd_fixwrgg)
                                mtd_fixwrgg(mtd, 0, 0);
@@ -734,6 +742,10 @@ static void usage(void)
            fprintf(stderr,
        "        fixseama                fix the checksum in a seama header on first boot\n");
        }
+       if (mtd_fixwrg) {
+           fprintf(stderr,
+       "        fixwrg                  fix the checksum in a wrg header on first boot\n");
+       }
        if (mtd_fixwrgg) {
            fprintf(stderr,
        "        fixwrgg                 fix the checksum in a wrgg header on first boot\n");
@@ -755,9 +767,9 @@ static void usage(void)
            fprintf(stderr,
        "        -o offset               offset of the image header in the partition(for fixtrx)\n");
        }
-       if (mtd_fixtrx || mtd_fixseama || mtd_fixwrgg) {
+       if (mtd_fixtrx || mtd_fixseama || mtd_fixwrg || mtd_fixwrgg) {
                fprintf(stderr,
-       "        -c datasize             amount of data to be used for checksum calculation (for fixtrx / fixseama / fixwrgg)\n");
+       "        -c datasize             amount of data to be used for checksum calculation (for fixtrx / fixseama / fixwrg / fixwrgg)\n");
        }
        fprintf(stderr,
 #ifdef FIS_SUPPORT
@@ -798,6 +810,7 @@ int main (int argc, char **argv)
                CMD_JFFS2WRITE,
                CMD_FIXTRX,
                CMD_FIXSEAMA,
+               CMD_FIXWRG,
                CMD_FIXWRGG,
                CMD_VERIFY,
                CMD_DUMP,
@@ -913,6 +926,9 @@ int main (int argc, char **argv)
        } else if (((strcmp(argv[0], "fixseama") == 0) && (argc == 2)) && mtd_fixseama) {
                cmd = CMD_FIXSEAMA;
                device = argv[1];
+       } else if (((strcmp(argv[0], "fixwrg") == 0) && (argc == 2)) && mtd_fixwrg) {
+               cmd = CMD_FIXWRG;
+               device = argv[1];
        } else if (((strcmp(argv[0], "fixwrgg") == 0) && (argc == 2)) && mtd_fixwrgg) {
                cmd = CMD_FIXWRGG;
                device = argv[1];
@@ -1012,6 +1028,10 @@ int main (int argc, char **argv)
                        if (mtd_fixseama)
                                mtd_fixseama(device, 0, data_size);
                        break;
+               case CMD_FIXWRG:
+                       if (mtd_fixwrg)
+                               mtd_fixwrg(device, 0, data_size);
+                       break;
                case CMD_FIXWRGG:
                        if (mtd_fixwrgg)
                                mtd_fixwrgg(device, 0, data_size);
index 50a42da14bbd5b3f7acc6f94adcbc299f3bfb359..0250a90e0be65ba03d4f11cf7ff539e1d3da5f92 100644 (file)
@@ -27,6 +27,7 @@ extern int trx_fixup(int fd, const char *name)  __attribute__ ((weak));
 extern int trx_check(int imagefd, const char *mtd, char *buf, int *len) __attribute__ ((weak));
 extern int mtd_fixtrx(const char *mtd, size_t offset, size_t data_size) __attribute__ ((weak));
 extern int mtd_fixseama(const char *mtd, size_t offset, size_t data_size) __attribute__ ((weak));
+extern int mtd_fixwrg(const char *mtd, size_t offset, size_t data_size) __attribute__ ((weak));
 extern int mtd_fixwrgg(const char *mtd, size_t offset, size_t data_size) __attribute__ ((weak));
 extern int mtd_resetbc(const char *mtd) __attribute__ ((weak));
 #endif /* __mtd_h */
diff --git a/package/system/mtd/src/wrg.c b/package/system/mtd/src/wrg.c
new file mode 100644 (file)
index 0000000..879cf1b
--- /dev/null
@@ -0,0 +1,208 @@
+/*
+ * wrg.c
+ *
+ * Copyright (C) 2005 Mike Baker
+ * Copyright (C) 2008 Felix Fietkau <nbd@nbd.name>
+ * Copyright (C) 2011-2012 Gabor Juhos <juhosg@openwrt.org>
+ * Copyright (C) 2016 Stijn Tintel <stijn@linux-ipv6.be>
+ * Copyright (C) 2017 George Hopkins <george-hopkins@null.net>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+#include <byteswap.h>
+#include <endian.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <string.h>
+#include <errno.h>
+#include <arpa/inet.h>
+
+#include <sys/ioctl.h>
+#include <mtd/mtd-user.h>
+#include "mtd.h"
+#include "md5.h"
+
+#if !defined(__BYTE_ORDER)
+#error "Unknown byte order"
+#endif
+
+#if __BYTE_ORDER == __BIG_ENDIAN
+#define cpu_to_le32(x) bswap_32(x)
+#define le32_to_cpu(x) bswap_32(x)
+#elif __BYTE_ORDER == __LITTLE_ENDIAN
+#define cpu_to_le32(x) (x)
+#define le32_to_cpu(x) (x)
+#else
+#error "Unsupported endianness"
+#endif
+
+#define WRG_MAGIC      0x20040220
+
+struct wrg_header {
+       char            signature[32];
+       uint32_t        magic1;
+       uint32_t        magic2;
+       uint32_t        size;
+       uint32_t        offset;
+       char            devname[32];
+       char            digest[16];
+} __attribute__ ((packed));
+
+ssize_t pread(int fd, void *buf, size_t count, off_t offset);
+ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset);
+
+int
+wrg_fix_md5(struct wrg_header *shdr, int fd, size_t data_offset, size_t data_size)
+{
+       char *buf;
+       ssize_t res;
+       MD5_CTX ctx;
+       unsigned char digest[16];
+       int i;
+       int err = 0;
+
+       buf = malloc(data_size);
+       if (!buf) {
+               err = -ENOMEM;
+               goto err_out;
+       }
+
+       res = pread(fd, buf, data_size, data_offset);
+       if (res != data_size) {
+               perror("pread");
+               err = -EIO;
+               goto err_free;
+       }
+
+       MD5_Init(&ctx);
+       MD5_Update(&ctx, (char *)&shdr->offset, sizeof(shdr->offset));
+       MD5_Update(&ctx, (char *)&shdr->devname, sizeof(shdr->devname));
+       MD5_Update(&ctx, buf, data_size);
+       MD5_Final(digest, &ctx);
+
+       if (!memcmp(digest, shdr->digest, sizeof(digest))) {
+               if (quiet < 2)
+                       fprintf(stderr, "the header is fixed already\n");
+               return -1;
+       }
+
+       if (quiet < 2) {
+               fprintf(stderr, "new size: %u, new MD5: ", data_size);
+               for (i = 0; i < sizeof(digest); i++)
+                       fprintf(stderr, "%02x", digest[i]);
+
+               fprintf(stderr, "\n");
+       }
+
+       /* update the size in the image */
+       shdr->size = cpu_to_le32(data_size);
+
+       /* update the checksum in the image */
+       memcpy(shdr->digest, digest, sizeof(digest));
+
+err_free:
+       free(buf);
+err_out:
+       return err;
+}
+
+int
+mtd_fixwrg(const char *mtd, size_t offset, size_t data_size)
+{
+       int fd;
+       char *first_block;
+       ssize_t res;
+       size_t block_offset;
+       size_t data_offset;
+       struct wrg_header *shdr;
+
+       if (quiet < 2)
+               fprintf(stderr, "Trying to fix WRG header in %s at 0x%x...\n",
+                       mtd, offset);
+
+       block_offset = offset & ~(erasesize - 1);
+       offset -= block_offset;
+
+       fd = mtd_check_open(mtd);
+       if(fd < 0) {
+               fprintf(stderr, "Could not open mtd device: %s\n", mtd);
+               exit(1);
+       }
+
+       if (block_offset + erasesize > mtdsize) {
+               fprintf(stderr, "Offset too large, device size 0x%x\n",
+                       mtdsize);
+               exit(1);
+       }
+
+       first_block = malloc(erasesize);
+       if (!first_block) {
+               perror("malloc");
+               exit(1);
+       }
+
+       res = pread(fd, first_block, erasesize, block_offset);
+       if (res != erasesize) {
+               perror("pread");
+               exit(1);
+       }
+
+       shdr = (struct wrg_header *)(first_block + offset);
+       if (le32_to_cpu(shdr->magic1) != WRG_MAGIC) {
+               fprintf(stderr, "No WRG header found (%08x != %08x)\n",
+                       le32_to_cpu(shdr->magic1), WRG_MAGIC);
+               exit(1);
+       } else if (!le32_to_cpu(shdr->size)) {
+               fprintf(stderr, "WRG entity with empty image\n");
+               exit(1);
+       }
+
+       data_offset = offset + sizeof(struct wrg_header);
+       if (!data_size)
+               data_size = mtdsize - data_offset;
+       if (data_size > le32_to_cpu(shdr->size))
+               data_size = le32_to_cpu(shdr->size);
+       if (wrg_fix_md5(shdr, fd, data_offset, data_size))
+               goto out;
+
+       if (mtd_erase_block(fd, block_offset)) {
+               fprintf(stderr, "Can't erease block at 0x%x (%s)\n",
+                       block_offset, strerror(errno));
+               exit(1);
+       }
+
+       if (quiet < 2)
+               fprintf(stderr, "Rewriting block at 0x%x\n", block_offset);
+
+       if (pwrite(fd, first_block, erasesize, block_offset) != erasesize) {
+               fprintf(stderr, "Error writing block (%s)\n", strerror(errno));
+               exit(1);
+       }
+
+       if (quiet < 2)
+               fprintf(stderr, "Done.\n");
+
+out:
+       close (fd);
+       sync();
+
+       return 0;
+}
index 876a72d0161c473e12d972b46ca225f6a570545f..f00e574de08d0f22d12b03895341c41f2a020933 100644 (file)
@@ -1,32 +1,32 @@
 #
 # Copyright (C) 2006-2015 OpenWrt.org
-# Copyright (C) 2016 LEDE Project
+# Copyright (C) 2016-2017 LEDE Project
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
-include $(INCLUDE_DIR)/version.mk
-include $(INCLUDE_DIR)/feeds.mk
 
 PKG_NAME:=opkg
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_FLAGS:=essential
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://git.lede-project.org/project/opkg-lede.git
-PKG_SOURCE_DATE:=2017-12-08
-PKG_SOURCE_VERSION:=9f61f7acf3845d2e09675b49fec5d783d57eb780
-PKG_MIRROR_HASH:=3e70d78e92f73e0848a75cfd74762656a4172b6d71369b9e2717dc57acf39cbf
+PKG_SOURCE_URL:=https://git.openwrt.org/project/opkg-lede.git
+PKG_SOURCE_DATE:=2017-12-07
+PKG_SOURCE_VERSION:=3b417b9f41b4ceb5912d82f867dd5534e5675b5c
+PKG_MIRROR_HASH:=1c9c21e56186345d0034d15051c1d9c5ebb5aa6658d6ae8886d8403207a914a3
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
 
 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
 
-PKG_FLAGS := nonshared
-PKG_CONFIG_DEPENDS := CONFIG_SIGNED_PACKAGES CONFIG_TARGET_INIT_PATH
+# Extend depends from version.mk
+PKG_CONFIG_DEPENDS += \
+       CONFIG_SIGNED_PACKAGES \
+       CONFIG_TARGET_INIT_PATH
 
 PKG_BUILD_PARALLEL:=1
 HOST_BUILD_PARALLEL:=1
@@ -43,7 +43,7 @@ define Package/opkg
   CATEGORY:=Base system
   TITLE:=opkg package manager
   DEPENDS:=+uclient-fetch +libpthread +libubox
-  URL:=https://git.lede-project.org/?p=project/opkg-lede.git
+  URL:=$(PKG_SOURCE_URL)
   MENU:=1
 endef
 
@@ -86,8 +86,6 @@ define Package/opkg/install
        $(INSTALL_DIR) $(1)/etc/uci-defaults
        $(INSTALL_DATA) ./files/customfeeds.conf $(1)/etc/opkg/customfeeds.conf
        $(INSTALL_DATA) ./files/opkg$(2).conf $(1)/etc/opkg.conf
-       $(call FeedSourcesAppend,$(1)/etc/opkg/distfeeds.conf)
-       $(VERSION_SED) $(1)/etc/opkg/distfeeds.conf
        $(INSTALL_BIN) ./files/20_migrate-feeds $(1)/etc/uci-defaults/
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/opkg-cl $(1)/bin/opkg
   ifneq ($(CONFIG_SIGNED_PACKAGES),)
index 864d3f62a9c3e0f9ab1b72b1ede8205a2edd83d4..b3b38ada8b67d2f9aead2d915d69fa85b35170da 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=procd
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=$(LEDE_GIT)/project/procd.git
-PKG_SOURCE_DATE:=2017-11-14
-PKG_SOURCE_VERSION:=d9dc0e03d70937dbbea12af86997701fbd717dc5
-PKG_MIRROR_HASH:=ad62410e6e43113c13aebf15f60c145f1eac09f309b8e7bd006a3621ca8f07a5
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git
+PKG_SOURCE_DATE:=2018-01-23
+PKG_SOURCE_VERSION:=653629f19e591a0827ab39de07b4526bb119a57a
+PKG_MIRROR_HASH:=2e0c3ae45521eea456a8411c8d9ef19ed9a5ed6c0ab38b9496555625fb4ba6a2
 CMAKE_INSTALL:=1
 
 PKG_LICENSE:=GPL-2.0
@@ -22,11 +22,9 @@ PKG_LICENSE_FILES:=
 
 PKG_MAINTAINER:=John Crispin <john@phrozen.org>
 
-PKG_FLAGS:=nonshared
-
 PKG_CONFIG_DEPENDS:= \
        CONFIG_TARGET_INIT_PATH CONFIG_KERNEL_SECCOMP \
-       CONFIG_NAND_SUPPORT CONFIG_PROCD_SHOW_BOOT CONFIG_PROCD_ZRAM_TMPFS \
+       CONFIG_PROCD_SHOW_BOOT CONFIG_PROCD_ZRAM_TMPFS \
        CONFIG_KERNEL_NAMESPACES CONFIG_PACKAGE_procd-ujail CONFIG_PACKAGE_procd-seccomp
 
 include $(INCLUDE_DIR)/package.mk
@@ -42,7 +40,7 @@ TARGET_LDFLAGS += $(if $(CONFIG_USE_GLIBC),-lrt)
 define Package/procd
   SECTION:=base
   CATEGORY:=Base system
-  DEPENDS:=+ubusd +ubus +libjson-script +ubox +USE_GLIBC:librt +libubox +libubus +NAND_SUPPORT:procd-nand
+  DEPENDS:=+ubusd +ubus +libjson-script +ubox +USE_GLIBC:librt +libubox +libubus
   TITLE:=OpenWrt system process manager
 endef
 
@@ -60,20 +58,6 @@ define Package/procd-seccomp
   TITLE:=OpenWrt process seccomp helper + utrace
 endef
 
-define Package/procd-nand
-  SECTION:=utils
-  CATEGORY:=Utilities
-  DEPENDS:=@NAND_SUPPORT +ubi-utils
-  TITLE:=OpenWrt sysupgrade nand helper
-endef
-
-define Package/procd-nand-firstboot
-  SECTION:=utils
-  CATEGORY:=Utilities
-  DEPENDS:=procd-nand
-  TITLE:=OpenWrt firstboot nand helper
-endef
-
 define Package/procd/config
 menu "Configuration"
        depends on PACKAGE_procd
@@ -91,10 +75,6 @@ endmenu
 endef
 
 
-ifeq ($(CONFIG_NAND_SUPPORT),y)
-  CMAKE_OPTIONS += -DBUILD_UPGRADED=1
-endif
-
 ifeq ($(CONFIG_PROCD_SHOW_BOOT),y)
   CMAKE_OPTIONS += -DSHOW_BOOT_ON_CONSOLE=1
 endif
@@ -107,14 +87,13 @@ ifdef CONFIG_PACKAGE_procd-ujail
   CMAKE_OPTIONS += -DJAIL_SUPPORT=1
 endif
 
-ifdef CONFIG_PACKAGE_procd-seccomp
-  CMAKE_OPTIONS += -DSECCOMP_SUPPORT=1 -DUTRACE_SUPPORT=1
-endif
+SECCOMP=$(if $(CONFIG_PACKAGE_procd-seccomp),1,0)
+CMAKE_OPTIONS += -DSECCOMP_SUPPORT=$(SECCOMP) -DUTRACE_SUPPORT=$(SECCOMP)
 
 define Package/procd/install
        $(INSTALL_DIR) $(1)/sbin $(1)/etc $(1)/lib/functions
 
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{init,procd,askfirst,udevtrigger} $(1)/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{init,procd,askfirst,udevtrigger,upgraded} $(1)/sbin/
        $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libsetlbf.so $(1)/lib
        $(INSTALL_BIN) ./files/reload_config $(1)/sbin/
        $(INSTALL_DATA) ./files/hotplug*.json $(1)/etc/
@@ -130,24 +109,10 @@ define Package/procd-seccomp/install
        $(INSTALL_DIR) $(1)/sbin $(1)/lib
        $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libpreload-seccomp.so $(1)/lib
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/utrace $(1)/sbin/
+       $(LN) utrace $(1)/sbin/seccomp-trace
        $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libpreload-trace.so $(1)/lib
 endef
 
-define Package/procd-nand/install
-       $(INSTALL_DIR) $(1)/sbin $(1)/lib/upgrade
-
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/upgraded $(1)/sbin/
-       $(INSTALL_DATA) ./files/nand.sh $(1)/lib/upgrade/
-endef
-
-define Package/procd-nand-firstboot/install
-       $(INSTALL_DIR) $(1)/lib/preinit
-
-       $(INSTALL_DATA) ./files/nand-preinit.sh $(1)/lib/preinit/60-nand-firstboot.sh
-endef
-
 $(eval $(call BuildPackage,procd))
 $(eval $(call BuildPackage,procd-ujail))
 $(eval $(call BuildPackage,procd-seccomp))
-$(eval $(call BuildPackage,procd-nand))
-$(eval $(call BuildPackage,procd-nand-firstboot))
index 58afc6c696ff546f0f5da20fb9fc131f1afbd77c..658c685474fe0e31dd2667662d07ba037661c147 100644 (file)
@@ -8,11 +8,11 @@
                                        [ "load-firmware", "/lib/firmware" ],
                                        [ "return" ]
                                ]
-                       ],
-               ],
-       }, ],
+                       ]
+               ]
+       } ],
        [ "if",
                [ "eq", "SUBSYSTEM", "button" ],
                [ "exec", "/etc/rc.button/failsafe" ]
-       ],
+       ]
 ]
index e5f8d967e8c16c8dc85a437a5259c0ba840d766c..1c949bbea33a0c066934aef92d53d6a096192013 100644 (file)
@@ -4,27 +4,27 @@
                        [ "if",
                                [ "and",
                                        [ "has", "MAJOR" ],
-                                       [ "has", "MINOR" ],
+                                       [ "has", "MINOR" ]
                                ],
                                [
                                        [ "if",
                                                [ "eq", "DEVNAME",
-                                                       [ "null", "full", "ptmx", "zero", "tty", "net", "random", "urandom" ],
+                                                       [ "null", "full", "ptmx", "zero", "tty", "net", "random", "urandom" ]
                                                ],
                                                [
                                                        [ "makedev", "/dev/%DEVNAME%", "0666" ],
-                                                       [ "return" ],
+                                                       [ "return" ]
                                                ]
                                        ],
                                        [ "if",
                                                [ "regex", "DEVNAME", "^snd" ],
-                                               [ "makedev", "/dev/%DEVNAME%", "0660", "audio" ],
+                                               [ "makedev", "/dev/%DEVNAME%", "0660", "audio" ]
                                        ],
                                        [ "if",
                                                [ "has", "DEVNAME" ],
-                                               [ "makedev", "/dev/%DEVNAME%", "0600" ],
-                                       ],
-                               ],
+                                               [ "makedev", "/dev/%DEVNAME%", "0600" ]
+                                       ]
+                               ]
                        ],
                        [ "if",
                                [ "has", "FIRMWARE" ],
                                        [ "load-firmware", "/lib/firmware" ],
                                        [ "return" ]
                                ]
-                       ],
+                       ]
                ],
                "remove" : [
                        [ "if",
                                [ "and",
                                        [ "has", "DEVNAME" ],
                                        [ "has", "MAJOR" ],
-                                       [ "has", "MINOR" ],
+                                       [ "has", "MINOR" ]
                                ],
                                [ "rm", "/dev/%DEVNAME%" ]
                        ]
@@ -49,7 +49,7 @@
        [ "if",
                [ "and",
                        [ "has", "BUTTON" ],
-                       [ "eq", "SUBSYSTEM", "button" ],
+                       [ "eq", "SUBSYSTEM", "button" ]
                ],
                [ "button", "/etc/rc.button/%BUTTON%" ]
        ],
@@ -65,5 +65,5 @@
                        [ "isdir", "/etc/hotplug.d/%SUBSYSTEM%" ],
                        [ "exec", "/sbin/hotplug-call", "%SUBSYSTEM%" ]
                ]
-       ],
+       ]
 ]
index 6347de57abb186126133d3c25ac2ce2f88a0e7a6..6f16b746ffb42c3c7eeba9fed628676a8eb3e761 100644 (file)
 #   Send a signal to a service instance (or all instances)
 #
 
-. $IPKG_INSTROOT/usr/share/libubox/jshn.sh
+. "$IPKG_INSTROOT/usr/share/libubox/jshn.sh"
 
 PROCD_RELOAD_DELAY=1000
 _PROCD_SERVICE=
 
+procd_lock() {
+       local basescript=$(readlink "$initscript")
+       local service_name="$(basename ${basescript:-$initscript})"
+
+       flock -n 1000 &> /dev/null
+       if [ "$?" != "0" ]; then
+               exec 1000>"$IPKG_INSTROOT/var/lock/procd_${service_name}.lock"
+               flock 1000
+               if [ "$?" != "0" ]; then
+                       logger "warning: procd flock for $service_name failed"
+               fi
+       fi
+}
+
 _procd_call() {
        local old_cb
 
@@ -47,6 +61,7 @@ _procd_call() {
 }
 
 _procd_wrapper() {
+       procd_lock
        while [ -n "$1" ]; do
                eval "$1() { _procd_call _$1 \"\$@\"; }"
                shift
@@ -79,6 +94,9 @@ _procd_close_service() {
        _procd_open_trigger
        service_triggers
        _procd_close_trigger
+       _procd_open_data
+       service_data
+       _procd_close_data
        _procd_ubus_call ${1:-set}
 }
 
@@ -134,6 +152,18 @@ _procd_close_trigger() {
        json_close_array
 }
 
+_procd_open_data() {
+       let '_procd_data_open = _procd_data_open + 1'
+       [ "$_procd_data_open" -gt 1 ] && return
+       json_add_object "data"
+}
+
+_procd_close_data() {
+       let '_procd_data_open = _procd_data_open - 1'
+       [ "$_procd_data_open" -lt 1 ] || return
+       json_close_object
+}
+
 _procd_open_validate() {
        json_select ..
        json_add_array "validate"
@@ -213,7 +243,7 @@ _procd_set_param() {
                        json_add_string "" "$@"
                        json_close_array
                ;;
-               nice)
+               nice|term_timeout)
                        json_add_int "$type" "$1"
                ;;
                reload_signal)
@@ -351,8 +381,10 @@ _procd_close_instance() {
        if json_select respawn ; then
                json_get_values respawn_vals
                if [ -z "$respawn_vals" ]; then
+                       local respawn_threshold=$(uci_get system.@service[0].respawn_threshold)
+                       local respawn_timeout=$(uci_get system.@service[0].respawn_timeout)
                        local respawn_retry=$(uci_get system.@service[0].respawn_retry)
-                       _procd_add_array_data 3600 5 ${respawn_retry:-5}
+                       _procd_add_array_data ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-5}
                fi
                json_select ..
        fi
@@ -381,6 +413,10 @@ _procd_send_signal() {
        local instance="$2"
        local signal="$3"
 
+       case "$signal" in
+               [A-Z]*) signal="$(kill -l "$signal" 2>/dev/null)" || return 1;;
+       esac
+
        json_init
        json_add_string name "$service"
        [ -n "$instance" -a "$instance" != "*" ] && json_add_string instance "$instance"
@@ -421,7 +457,7 @@ procd_add_mdns_service() {
        json_add_int port "$port"
        [ -n "$1" ] && {
                json_add_array txt
-               for txt in $@; do json_add_string "" $txt; done
+               for txt in "$@"; do json_add_string "" "$txt"; done
                json_select ..
        }
        json_select ..
@@ -430,7 +466,7 @@ procd_add_mdns_service() {
 procd_add_mdns() {
        procd_open_data
        json_add_object "mdns"
-       procd_add_mdns_service $@
+       procd_add_mdns_service "$@"
        json_close_object
        procd_close_data
 }
index ce62e83673718ff755b4a327fb4391f75c107b75..2dc960e48dc48e3b88f29ed661a5207b049f8385 100644 (file)
@@ -11,11 +11,11 @@ PKG_NAME:=rpcd
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=$(LEDE_GIT)/project/rpcd.git
-PKG_SOURCE_DATE:=2017-11-12
-PKG_SOURCE_VERSION:=a0231be8fbc61bb97e725eb206fc9b1ce9f69c05
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/rpcd.git
+PKG_SOURCE_DATE:=2017-12-07
+PKG_SOURCE_VERSION:=cfe1e75c91bc1bac82e6caab3e652b0ebee59524
 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
-PKG_MIRROR_HASH:=5f66a6ad2eced71cccd43fc011077806e3bbc6dadd0403175947a02c25fe6344
+PKG_MIRROR_HASH:=4857497c88115defbf6add68a37975ed79e8f992e65d7d0df56cd29288dea379
 
 PKG_LICENSE:=ISC
 PKG_LICENSE_FILES:=
index 3c9b4aa5157d5ff0eb8e9ff6d31fe5d6ab74ad13..89cc6768fbeb24fc9c0a3ebc78ef97c74f28f027 100644 (file)
@@ -4,10 +4,10 @@ PKG_NAME:=ubox
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=$(LEDE_GIT)/project/ubox.git
-PKG_SOURCE_DATE:=2017-03-10
-PKG_SOURCE_VERSION:=16f7e16181e2f3e9cf3e2ce56a7e291844900d09
-PKG_MIRROR_HASH:=5f10f3df134eb8a69d281a73d39f5d2e2fc96af531a2f3960b0c6116ff11a707
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubox.git
+PKG_SOURCE_DATE:=2018-02-14
+PKG_SOURCE_VERSION:=128bc35fa951ac3beff6e977bc3cced87c2e2600
+PKG_MIRROR_HASH:=f58dfb9a9bb69c6303cb69bbd850b14bd29ec59ea240bac4063fd74a7fce64aa
 CMAKE_INSTALL:=1
 
 PKG_LICENSE:=GPL-2.0
@@ -41,11 +41,11 @@ define Package/ubox/install
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/getrandom $(1)/usr/bin/
        $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libvalidate.so $(1)/lib
 
-       $(LN) ../../sbin/kmodloader $(1)/usr/sbin/rmmod
-       $(LN) ../../sbin/kmodloader $(1)/usr/sbin/insmod
-       $(LN) ../../sbin/kmodloader $(1)/usr/sbin/lsmod
-       $(LN) ../../sbin/kmodloader $(1)/usr/sbin/modinfo
-       $(LN) ../../sbin/kmodloader $(1)/usr/sbin/modprobe
+       $(LN) kmodloader $(1)/sbin/rmmod
+       $(LN) kmodloader $(1)/sbin/insmod
+       $(LN) kmodloader $(1)/sbin/lsmod
+       $(LN) kmodloader $(1)/sbin/modinfo
+       $(LN) kmodloader $(1)/sbin/modprobe
 endef
 
 define Package/logd/install
index 722dc20e90baf3d945f08f1e04a849edf6255583..21e078712559f3e839c8154210bac766c3f231a0 100644 (file)
@@ -39,7 +39,7 @@ start_service_daemon()
        procd_open_instance
        procd_set_param command "/sbin/logd"
        procd_append_param command -S "${log_buffer_size}"
-       procd_set_param respawn
+       procd_set_param respawn 5 1 -1
        procd_close_instance
 }
 
index 4f3d4e8309d626044bbeea3aa9798da440cae7c7..7dc3c92deadbaf0e15d8e0135585b6e8cbc0e8c5 100644 (file)
@@ -4,10 +4,10 @@ PKG_NAME:=ubus
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=$(LEDE_GIT)/project/ubus.git
-PKG_SOURCE_DATE:=2017-02-18
-PKG_SOURCE_VERSION:=34c6e818e431cc53478a0f7c7c1eca07d194d692
-PKG_MIRROR_HASH:=fc4f1121faa4f5b8fa52ee25460b98b2e60e7d245aefa70e7f76c56ce5628fd5
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubus.git
+PKG_SOURCE_DATE:=2018-01-16
+PKG_SOURCE_VERSION:=5bae22eb5472c9c7cc30caa9a84004bba19940d3
+PKG_MIRROR_HASH:=6f46398279339dcc597965306275fe1272af384f8cb253ee8de2c68e366eed55
 CMAKE_INSTALL:=1
 
 PKG_LICENSE:=LGPL-2.1
index b4d019cf39367c84629cd8a51884f4450584ca40..d5b4eac4aa8cbbb1733d0ccaa4610a4d049ea3b0 100644 (file)
@@ -11,11 +11,11 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=uci
 PKG_RELEASE:=1
 
-PKG_SOURCE_URL=$(LEDE_GIT)/project/uci.git
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/uci.git
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_DATE=2016-07-04
-PKG_SOURCE_VERSION:=e1bf4356e1b513e158e1b5049147087ed6342cfd
-PKG_MIRROR_HASH:=4994a10a9e15f71312502f8babf045da7cea18c64227b387fc2dcf64f2252f19
+PKG_SOURCE_DATE=2018-01-01
+PKG_SOURCE_VERSION:=5beb95da3dbec6db11a6bdfaab7807ee2daf41e6
+PKG_MIRROR_HASH:=123c5d3ed8f86db76ab52584e952c8e870891bca4dab682b753ca384d7d067bf
 
 PKG_LICENSE:=LGPL-2.1
 PKG_LICENSE_FILES:=
index 50891a64e4b444500ef82c0803f22a643752759d..78ec277669977d5c3328be16af7c455c3aae44d3 100644 (file)
@@ -118,9 +118,10 @@ uci_add() {
 uci_rename() {
        local PACKAGE="$1"
        local CONFIG="$2"
-       local VALUE="$3"
+       local OPTION="$3"
+       local VALUE="$4"
 
-       /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} rename "$PACKAGE.$CONFIG=$VALUE"
+       /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} rename "$PACKAGE.$CONFIG${VALUE:+.$OPTION}=${VALUE:-$OPTION}"
 }
 
 uci_remove() {
index 84adccb4a3e9d9f8e5c88d83c336f0a6c8039629..63f9f09953d47459729d8f4859e8bfac4012c90c 100644 (file)
@@ -4,7 +4,7 @@ PKG_NAME:=usign
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=$(LEDE_GIT)/project/usign.git
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/usign.git
 PKG_SOURCE_DATE:=2015-07-04
 PKG_SOURCE_VERSION:=ef6419142a3b0fbcddcccf536e3c1880302c6f89
 PKG_MIRROR_HASH:=9499ed7e40889b364e446a428e185c40986b75087888bd7e1496542457a6dbaa