From b6e24f02ac33c4998ce05a3506a6a25dd6a7b536 Mon Sep 17 00:00:00 2001 From: RISCi_ATOM Date: Wed, 21 Feb 2018 16:21:52 -0500 Subject: [PATCH] Pull in updated system / network components from upstream (stage 1) --- package/network/config/firewall/Makefile | 12 +- package/network/config/netifd/Makefile | 10 +- .../config/netifd/files/etc/init.d/network | 5 +- .../netifd/files/lib/netifd/dhcp.script | 20 +- .../netifd/files/lib/netifd/proto/dhcp.sh | 9 +- package/system/ca-certificates/Makefile | 8 +- package/system/fstools/Makefile | 23 +- package/system/fstools/files/blockd.init | 21 ++ package/system/fstools/files/snapshot | 16 +- package/system/mtd/src/Makefile | 3 +- package/system/mtd/src/mtd.c | 26 ++- package/system/mtd/src/mtd.h | 1 + package/system/mtd/src/wrg.c | 208 ++++++++++++++++++ package/system/opkg/Makefile | 24 +- package/system/procd/Makefile | 57 +---- .../system/procd/files/hotplug-preinit.json | 8 +- package/system/procd/files/hotplug.json | 22 +- package/system/procd/files/procd.sh | 46 +++- package/system/rpcd/Makefile | 8 +- package/system/ubox/Makefile | 18 +- package/system/ubox/files/log.init | 2 +- package/system/ubus/Makefile | 8 +- package/system/uci/Makefile | 8 +- package/system/uci/files/lib/config/uci.sh | 5 +- package/system/usign/Makefile | 2 +- 25 files changed, 425 insertions(+), 145 deletions(-) create mode 100755 package/system/fstools/files/blockd.init create mode 100644 package/system/mtd/src/wrg.c diff --git a/package/network/config/firewall/Makefile b/package/network/config/firewall/Makefile index e5fcb8c916..47ce836b86 100644 --- a/package/network/config/firewall/Makefile +++ b/package/network/config/firewall/Makefile @@ -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 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 diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile index fb03586401..d2210e7c2e 100644 --- a/package/network/config/netifd/Makefile +++ b/package/network/config/netifd/Makefile @@ -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 PKG_LICENSE:=GPL-2.0 diff --git a/package/network/config/netifd/files/etc/init.d/network b/package/network/config/netifd/files/etc/init.d/network index a825dfd31f..6cd167d19d 100755 --- a/package/network/config/netifd/files/etc/init.d/network +++ b/package/network/config/netifd/files/etc/init.d/network @@ -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() { diff --git a/package/network/config/netifd/files/lib/netifd/dhcp.script b/package/network/config/netifd/files/lib/netifd/dhcp.script index b3a61e2750..00604f40e7 100755 --- a/package/network/config/netifd/files/lib/netifd/dhcp.script +++ b/package/network/config/netifd/files/lib/netifd/dhcp.script @@ -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 diff --git a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh index ea02d68bb4..385cfc3974 100755 --- a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh +++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh @@ -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() { diff --git a/package/system/ca-certificates/Makefile b/package/system/ca-certificates/Makefile index ecf9a6b039..73a267e0b7 100644 --- a/package/system/ca-certificates/Makefile +++ b/package/system/ca-certificates/Makefile @@ -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 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 diff --git a/package/system/fstools/Makefile b/package/system/fstools/Makefile index 43febd4727..fe4530ac00 100644 --- a/package/system/fstools/Makefile +++ b/package/system/fstools/Makefile @@ -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 index 0000000000..a4ce57d40d --- /dev/null +++ b/package/system/fstools/files/blockd.init @@ -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 +} diff --git a/package/system/fstools/files/snapshot b/package/system/fstools/files/snapshot index c1a5b733f3..a495e34345 100644 --- a/package/system/fstools/files/snapshot +++ b/package/system/fstools/files/snapshot @@ -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)" ] && { diff --git a/package/system/mtd/src/Makefile b/package/system/mtd/src/Makefile index 4e39a89315..daeadbcd35 100644 --- a/package/system/mtd/src/Makefile +++ b/package/system/mtd/src/Makefile @@ -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 diff --git a/package/system/mtd/src/mtd.c b/package/system/mtd/src/mtd.c index e66e647c01..55a3bdba81 100644 --- a/package/system/mtd/src/mtd.c +++ b/package/system/mtd/src/mtd.c @@ -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); diff --git a/package/system/mtd/src/mtd.h b/package/system/mtd/src/mtd.h index 50a42da14b..0250a90e0b 100644 --- a/package/system/mtd/src/mtd.h +++ b/package/system/mtd/src/mtd.h @@ -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 index 0000000000..879cf1bbe0 --- /dev/null +++ b/package/system/mtd/src/wrg.c @@ -0,0 +1,208 @@ +/* + * wrg.c + * + * Copyright (C) 2005 Mike Baker + * Copyright (C) 2008 Felix Fietkau + * Copyright (C) 2011-2012 Gabor Juhos + * Copyright (C) 2016 Stijn Tintel + * Copyright (C) 2017 George Hopkins + * + * 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#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; +} diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile index 876a72d016..f00e574de0 100644 --- a/package/system/opkg/Makefile +++ b/package/system/opkg/Makefile @@ -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 -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),) diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile index 864d3f62a9..b3b38ada8b 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -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 -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)) diff --git a/package/system/procd/files/hotplug-preinit.json b/package/system/procd/files/hotplug-preinit.json index 58afc6c696..658c685474 100644 --- a/package/system/procd/files/hotplug-preinit.json +++ b/package/system/procd/files/hotplug-preinit.json @@ -8,11 +8,11 @@ [ "load-firmware", "/lib/firmware" ], [ "return" ] ] - ], - ], - }, ], + ] + ] + } ], [ "if", [ "eq", "SUBSYSTEM", "button" ], [ "exec", "/etc/rc.button/failsafe" ] - ], + ] ] diff --git a/package/system/procd/files/hotplug.json b/package/system/procd/files/hotplug.json index e5f8d967e8..1c949bbea3 100644 --- a/package/system/procd/files/hotplug.json +++ b/package/system/procd/files/hotplug.json @@ -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" ], @@ -33,14 +33,14 @@ [ "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%" ] ] - ], + ] ] diff --git a/package/system/procd/files/procd.sh b/package/system/procd/files/procd.sh index 6347de57ab..6f16b746ff 100644 --- a/package/system/procd/files/procd.sh +++ b/package/system/procd/files/procd.sh @@ -33,11 +33,25 @@ # 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 } diff --git a/package/system/rpcd/Makefile b/package/system/rpcd/Makefile index ce62e83673..2dc960e48d 100644 --- a/package/system/rpcd/Makefile +++ b/package/system/rpcd/Makefile @@ -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 -PKG_MIRROR_HASH:=5f66a6ad2eced71cccd43fc011077806e3bbc6dadd0403175947a02c25fe6344 +PKG_MIRROR_HASH:=4857497c88115defbf6add68a37975ed79e8f992e65d7d0df56cd29288dea379 PKG_LICENSE:=ISC PKG_LICENSE_FILES:= diff --git a/package/system/ubox/Makefile b/package/system/ubox/Makefile index 3c9b4aa515..89cc6768fb 100644 --- a/package/system/ubox/Makefile +++ b/package/system/ubox/Makefile @@ -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 diff --git a/package/system/ubox/files/log.init b/package/system/ubox/files/log.init index 722dc20e90..21e0787125 100644 --- a/package/system/ubox/files/log.init +++ b/package/system/ubox/files/log.init @@ -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 } diff --git a/package/system/ubus/Makefile b/package/system/ubus/Makefile index 4f3d4e8309..7dc3c92dea 100644 --- a/package/system/ubus/Makefile +++ b/package/system/ubus/Makefile @@ -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 diff --git a/package/system/uci/Makefile b/package/system/uci/Makefile index b4d019cf39..d5b4eac4aa 100644 --- a/package/system/uci/Makefile +++ b/package/system/uci/Makefile @@ -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:= diff --git a/package/system/uci/files/lib/config/uci.sh b/package/system/uci/files/lib/config/uci.sh index 50891a64e4..78ec277669 100644 --- a/package/system/uci/files/lib/config/uci.sh +++ b/package/system/uci/files/lib/config/uci.sh @@ -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() { diff --git a/package/system/usign/Makefile b/package/system/usign/Makefile index 84adccb4a3..63f9f09953 100644 --- a/package/system/usign/Makefile +++ b/package/system/usign/Makefile @@ -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 -- 2.25.1