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
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
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
}
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() {
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
[ -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
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
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
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
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"
${ipaddr:+-r $ipaddr} \
${hostname:+-x "hostname:$hostname"} \
${vendorid:+-V "$vendorid"} \
- $clientid $broadcast $release $dhcpopts
+ $clientid $defaultreqopts $broadcast $release $dhcpopts
}
proto_dhcp_renew() {
#
-# 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.
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
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
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
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/
$(eval $(call BuildPackage,fstools))
$(eval $(call BuildPackage,snapshot-tool))
$(eval $(call BuildPackage,block-mount))
+$(eval $(call BuildPackage,blockd))
--- /dev/null
+#!/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
+}
opkg list-upgradable
[ $? -eq 0 ] || exit 2
-
+
UPDATES=`opkg list-upgradable | cut -d" " -f1`
[ -z "${UPDATES}" ] && exit 0
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)" ] && {
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
#define TRX_MAGIC 0x48445230 /* "HDR0" */
#define SEAMA_MAGIC 0x5ea3a417
+#define WRG_MAGIC 0x20040220
#define WRGG03_MAGIC 0x20080321
#if !defined(__BYTE_ORDER)
MTD_IMAGE_FORMAT_UNKNOWN,
MTD_IMAGE_FORMAT_TRX,
MTD_IMAGE_FORMAT_SEAMA,
+ MTD_IMAGE_FORMAT_WRG,
MTD_IMAGE_FORMAT_WRGG03,
};
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;
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:
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);
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");
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
CMD_JFFS2WRITE,
CMD_FIXTRX,
CMD_FIXSEAMA,
+ CMD_FIXWRG,
CMD_FIXWRGG,
CMD_VERIFY,
CMD_DUMP,
} 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];
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);
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 */
--- /dev/null
+/*
+ * 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;
+}
#
# 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
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
$(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),)
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
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
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
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
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
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/
$(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))
[ "load-firmware", "/lib/firmware" ],
[ "return" ]
]
- ],
- ],
- }, ],
+ ]
+ ]
+ } ],
[ "if",
[ "eq", "SUBSYSTEM", "button" ],
[ "exec", "/etc/rc.button/failsafe" ]
- ],
+ ]
]
[ "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%" ]
]
[ "if",
[ "and",
[ "has", "BUTTON" ],
- [ "eq", "SUBSYSTEM", "button" ],
+ [ "eq", "SUBSYSTEM", "button" ]
],
[ "button", "/etc/rc.button/%BUTTON%" ]
],
[ "isdir", "/etc/hotplug.d/%SUBSYSTEM%" ],
[ "exec", "/sbin/hotplug-call", "%SUBSYSTEM%" ]
]
- ],
+ ]
]
# 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
}
_procd_wrapper() {
+ procd_lock
while [ -n "$1" ]; do
eval "$1() { _procd_call _$1 \"\$@\"; }"
shift
_procd_open_trigger
service_triggers
_procd_close_trigger
+ _procd_open_data
+ service_data
+ _procd_close_data
_procd_ubus_call ${1:-set}
}
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"
json_add_string "" "$@"
json_close_array
;;
- nice)
+ nice|term_timeout)
json_add_int "$type" "$1"
;;
reload_signal)
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
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"
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 ..
procd_add_mdns() {
procd_open_data
json_add_object "mdns"
- procd_add_mdns_service $@
+ procd_add_mdns_service "$@"
json_close_object
procd_close_data
}
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:=
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
$(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
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
}
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
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:=
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() {
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