Commit Graph

917 Commits (fbd4214bb0727268aa535af5b600d38939ec8dbc)

Author SHA1 Message Date
Linus Walleij 76338fded0 gemini: Fix up firmware checksum on DIR-685
Using the same method as the D-Link DAP-2695 A1 we use
the "mtd" tool to augment the firmware checkum in flash
on first boot of a new firmware on the D-Link DIR-685.
We need to augment the Makefile for "mtd" to build in
the special WRGG fixup support for Gemini as well.

This works around the problem of the machine not booting
after factory install unless the sysupgrade is applied
immediately.

Based on commit e3875350f3
"ar71xx: add support for D-Link DAP-2695 rev. A1"

Cc: Stijn Tintel <stijn@linux-ipv6.be>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years ago
Linus Walleij 30b4b7ee09 mtd: Make fixwrgg command work on DIR-685
The D-Link DIR-685 has the same problem as the
D-Link DAP-2695: when flashing the factory image, the
checksum includes the whole flashed image, even the
rootfs_data part with the end of filesystem mark.
Also the whole flashed image is stored in the flash,
so on the first boot, the whole rootfs image is loaded
into memory with the kernel.

This is fixed using the fixwrgg command to mtd, but
for this to work we need to make fixwrgg work with
the Little-Endian ARM DIR-685.

The code tries to be endian agnostic but this fails
because the WRGG image loader doesn't. On ARM, the
file size is stored in little endian format, and on
big-endian systems it is stored in big endian format,
so we can just drop all the friendly htonl() that
will make the shdr->size big endian: this will
actually break the little endian systems, and on
the big endian systems the native endianness will
still be correct.

The magic number is always stored in little endian
format however, so make sure this is always read
in LE32 format. I chose to create a straight-forward
le32_to_cpu() static inline that IMO is simple and
easy to read.

Cc: Stijn Tintel <stijn@linux-ipv6.be>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years ago
Jeff Kletsky b3770eaca3 mtd: base-files: Unify dual-firmware devices (Linksys)
Consistently handle boot-count reset and upgrade across
ipq40xx, ipq806x, kirkwood, mvebu

Dual-firmware devices often utilize a specific MTD partition
to record the number of times the boot loader has initiated boot.

Most of these devices are NAND, typically with a 2k erase size.
When this code was ported to the ipq40xx platform, the device in hand
used NOR for this partition, with a 16-byte "record" size. As the
implementation of `mtd resetbc` is by-platform, the hard-coded nature
of this change prevented proper operation of a NAND-based device.

* Unified the "NOR" variant with the rest of the Linksys variants

* Added logging to indicate success and failure

* Provided a meaningful return value for scripting

* "Protected" the use of `mtd resetbc` in start-up scripts so that
   failure does not end the boot sequence

* Moved Linksys-specific actions into common `/etc/init.d/bootcount`

For upgrade, these devices need to determine which partition to flash,
as well as set certain U-Boot envirnment variables to change the next
boot to the newly flashed version.

* Moved upgrade-related environment changes out of bootcount

* Combined multiple flashes of environment into single one

* Current-partition detection now handles absence of `boot_part`

Runtime-tested: Linksys EA8300

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[checkpatch.pl fixes, traded split strings for 80+ chars per line]
5 years ago
Kristian Evensen 97780e363f system: uci: Use config dir on uci_add and support add_/del_list
This commit makes three changes to the uci shell library:

* A check for UCI_CONFIG_DIR has been added to the command line when
adding anonymous sections. Without this change, adding anonymous
sections to configs not stored in /etc/config is not possible.

* Support for adding/removing items from lists were missing, so I have
added the functions uci_add_list() and uci_remove_list() to simplify
working with uci lists from scripts.

Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
[added missing package version bump]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Hans Dedecker 290a7dc0c7 procd: fix compile issue
1361b97 container: include stdbool.h

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years ago
Hans Dedecker 792c9fc8ca procd: update to latest git HEAD
9b35439 procd: detect lxc container and behave accordingly

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years ago
Rafał Miłecki 2c3dd70741 procd: add procd_running() helper for checking running state
This should be helpful for implementing service_running() in procd init
scripts.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: John Crispin <john@phrozen.org>
5 years ago
Hans Dedecker 8696f0c3e3 procd: update to latest git HEAD
01f3dc8 instance: dump user and group as well

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years ago
Michael Heimpold 218b1bbecd procd: allow passing optional group instance parameter
Sometimes is desirable to run a process with a specific group id
instead of the default one which is derived from passwd entry.
This can be achived now by using procd_set_param group $mygroup.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [PKG_SOURCE_VERSION update]
5 years ago
Michael Heimpold a12ab07e21 procd: allow passing optional syslog facility as instance parameter
Optional syslog facility can be set by adding procd_set_param facility
$myfacility.
While at, also add stdout/stderr documentation.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [PKG_SOURCE_VERSION update]
5 years ago
Hans Dedecker 430b66bbe8 procd: update to latest git HEAD
cfaed56 procd: add SIGPWR as signal
a30a8fd procd: copy the respawn property of new instance

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years ago
Martin Schiller e79b9601bf procd/hotplug: add dependency to dialout and audio group
Commit 6e060bd62c introduced a dependency to the dialout group.
Adding this group to the "group" file in the base-files package is not
enough to handle this dependency, because after a sysupgrade this entry
will be missing in the "group" file.

To address this problem the dependencies to the required groups needs to
be set in the Makefile of the procd package.
Then, the uci-default script "13_fix_group_user" will add the groups
on first boot-up after a sysupgrade.

Fixes: 6e060bd62c ("base-files/hotplug: fix dedicated group for tty devices")
Tested-by: Michael Heimpold <mhei@heimpold.de>
Signed-off-by: Martin Schiller <ms@dev.tdt.de>
5 years ago
Hans Dedecker d1739c6c9a procd: update to latest git HEAD
baaf38c procd: instance: Support deleting stopped instances

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years ago
Stijn Tintel 310e2764a8 ubox: bump to git HEAD
5130fa4 kmodloader: fix and optimize loading of failed modules

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
5 years ago
Michael Heimpold 6e060bd62c base-files/hotplug: fix dedicated group for tty devices
Commit 124ab1dc0a and 5523ee3459 introduced the assignment of the
group "tty" to /dev/tty* devices in order to support unprivileged
user access to serial devices.

However, due to an improperly rebased commit this feature broke.

This patch restores the lost hunk in hotplug.json file to
re-introduce this feature and also renames the existing "tty" group
to "dialout" as this is the more typical name for such a group
on desktop systems.

Fixes: 5209cfa534 ("procd: fix hotplug.json syntax")
Signed-off-by: Michael Heimpold <mhei@heimpold.de>
Acked-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Petr Štetiar 1e55171a12 fstools: update to the latest master branch
ff1ded6 libfstools: Fix overflow of F2FS_MINSIZE constant
bc2c876 libfstools: Print error in case of loop blkdev failure

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Hauke Mehrtens 0168af502b ubox: update to latest git HEAD
a782779 kmodloader: increase module name length

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
Josef Schlehofer f22c33b40c ca-certificates: update to version 20190110
- Tested on Turris MOX, OpenWrt master
- Removed PKG_BUILD_DIR
In build_dir there were two folders
ca-certificates and ca-certificates-20190110 and it failed as files
were in ca-certificates-20190110

Signed-off-by: Josef Schlehofer <josef.schlehofer@nic.cz>
5 years ago
Wojciech Dubowik 5107176861 procd: Enable seccomp for powerpc
Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
5 years ago
Daniel Golle 69d3c7e6da ucert: add PROVIDES also for minimal 'ucert' package
Otherwise ucert-full gets selected instead of ucert when depending on
ucert.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
5 years ago
Felix Fietkau 8f4e31ea6e fwtool: add support for extracting the truncated data part to stdout
This allows extracing the firmware + metadata from a signed firmware without
altering the original image file

Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years ago
Felix Fietkau d5681e45f0 fwtool: do not strip metadata if extracting signature
This allows the signature to cover the metadata area

Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years ago
Jo-Philipp Wich 40bb2ae211 opkg: update to latest Git head
d4ba162 libopkg: only perform size check when information is available

Fixes: e079591b84 ("opkg: update to latest Git head")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Jo-Philipp Wich e079591b84 opkg: update to latest Git head
cb66403 libopkg: check for file size mismatches

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
David Bauer 1e06482f7d mtd: add logic for TP-Link ramips recovery magic
This adds an option to set the recovery flag of newer TP-Link MediaTek
boards and remove it after a successful write.

To make use of this feature, add the '-t' option to mtd-write.

The '-t' option takes the mtd partition containing the recovery flag
(usually 'romfile') as an argument. Make sure this partition is not
flagged as read-only!

Example:
 > mtd -t romfile write owrt.bin firmware

This command writes the recovery-flag before it begins writing the image
to the firmware partition. After the image-write has been successful,
the recovery flag is removed.

This way, the TP-Link web-recovery is automatically enabled on an
unsucessful flash (e.g. power loss).

This option is only available if the mtd package is compiled for the
ramips target.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Oever González c43acdf342 mtd: add linksys_bootcount to the ipq40xx target
This commit adds the object 'linksys_bootcount_fix.o' to the ipq40xx
target.

This is needed for the Linksys EA6350v3 device. Without this patch, the
device will switch-back between the current and the last flashed firmware
every 3 (three) reboots. With this patch, the device works as expected.

Signed-off-by: Ryan Pannell <ryan@osukl.com>
Signed-off-by: Oever González <notengobattery@gmail.com>
5 years ago
Hans Dedecker e906a75e67 procd: update to latest git HEAD
e2b055e hotplug.c: Make sure hotplug buffer is NULL terminated

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years ago
Jo-Philipp Wich 0e70f69a35 treewide: revise library packaging
- Annotate versionless libraries (such as libubox, libuci etc.) with a fixed
  ABI_VERSION resembling the source date of the last incompatible change
- Annotate packages shipping versioned library objects with ABI_VERSION
- Stop shipping unversioned library symlinks for packages with ABI_VERSION

Ref: https://openwrt.org/docs/guide-developer/package-policies#shared_libraries
Ref: https://github.com/KanjiMonster/maintainer-tools/blob/master/check-abi-versions.pl
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Jeffery To d13e86d4c2 procd: Add wrapper for uci_validate_section()
This adds a wrapper (uci_load_validate) for uci_validate_section() that
allows callers (through a callback function) to access the values set by
uci_validate_section(), without having to manually declare a
(potentially long) list of local variables.

The callback function receives two arguments when called, the config
section name and the return value of uci_validate_section().

If no callback function is given, then the wrapper exits with the value
returned by uci_validate_section().

This also updates several init scripts to use the new wrapper function.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
5 years ago
Matthias Badaire cf8483cb4f fstools: media change detection (eg:sdcard) using kernel polling
Linux kernel has a polling mechanism that can be activated by changing
the parameter /sys/module/block/parameters/events_dfl_poll_msecs which
is deactivated by default or the /sys/block/[device]/events_poll_msecs
for one device.

This patch set the events_poll_msecs when a disk is inserted.
Once the media disk change event is sent by the kernel then we force a
re-read of the devices using /sbin/block info.

With this patch, insertion and ejection of sd card will automatically
generate partition devices in /dev.

Signed-off-by: Matthias Badaire <mbadaire@gmail.com>
[rewrap commit message, fix bashisms, fix non-matching condition,
 bump pkg release]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Jo-Philipp Wich 797e5c1c48 packages: set more explicit ABI_VERSION values
In the case of upstream libraries, set the ABI_VERSION variable to the
soname value of the first version version after the last backwards
incompatible change.

For custom OpenWrt libraries, set the ABI_VERSION to the date of the
last Git commit doing backwards incompatible changes to the source,
such as changing function singatures or dropping exported symbols.

The soname values have been determined by either checking
https://abi-laboratory.pro/index.php?view=tracker or - in the case
of OpenWrt libraries - by carefully reviewing the changes made to
header files thorough the corresponding Git history.

In the future, the ABI_VERSION values must be bumped whenever the
library is updated to an incpompatible version but not with every
package update, in order to reduce the dependency churn in the
binary package repository.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Jo-Philipp Wich 1bd18f2b5c opkg: update to latest Git head
This update fixes some cosmetical issues and a number of segmentation
faults when parsing lists having Conflicts or Replaces tags.

d217daf libopkg: fix replacelist parsing and writing
9dd9a07 libopkg: fix segmentation fault when traversing conflicts
34571ba libopkg: consider provided packages in pkg_vec_mark_if_matches()
18740e6 opkg_download: print error when fork() fails
e3d7330 libopkg: don't print unresolved dependencies twice

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Rafał Miłecki 5c4277ec37 fstools: update to the latest master branch
This is a big block(d) cleanup with new feature of generating "mount"
hotplug.d events.

It's an important update for those who were using mountd in the
pre-18.06 releases. Due to the mountd being replaced with blockd a
support for "mountd" hotplug.d events has been lost. It broke all kind
of shell scripts that were e.g. managing services depending on an
external USB drive availability.

This basically (re-)adds support for calling /etc/hotplug.d/mount/
scripts with ACTION ("add" or "remove") and DEVICE set.

af93f4b block(d): improve hotplug.d "mount" events for the autofs
3bb3352 blockd: unmount device explicitly when it disappears
28753b3 block: remove target directory after unmounting
c8c7ca5 block: cleanup handling "start" action of the "autofs" command
f1bb762 block: make blockd_notify() return an int instead of void
71c2bde block: generate hotplug.d mount events
30f5096 block: validate amount of arguments for the "autofs" command
dc6a462 blockd: don't reparse blob msg in the vlist callbacks
f6a9686 blockd: don't unmount device when removing it from the list
1913fea block: don't duplicate unmounting code in the mount_action()
6b445fa block: make umount_device() function more generic
a778468 block: don't duplicate mounting code in the mount_device()
5dc631d block: simplify code picking mount target directory
2971779 block: move blockd_notify() call out of the conditional blocks
b86bd6e block: fix formatting & indent in the mount_device()
e12c0d6 fstools: use EXIT_FAILURE when indicating error on exit
091aa3d fstools: guard usage of WEXITSTATUS

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
Jonas Gorski d3bf5ff9bc opkg: drop argument from check_signature in opkg.conf
check_signature is a bool option and doesn't take any arguments. The
presence of the 1 falsely suggests setting it to 0 disables the check,
while the option actually needs to be removed or commented out to be
disabled. So remove the argument to make it more clear.

Fixes: beca028bd6 ("build: add integration for managing opkg package feed keys")
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
5 years ago
Stijn Tintel b209e2b3b0 ubox: bump to git HEAD
876c7f5 kmodloader: load_modprobe: abort after 2 attempts

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
5 years ago
Jo-Philipp Wich e533fb1706 rpcd: update to latest Git head
3aa81d0 file: access exec timeout via daemon ops structure
7235f34 plugin: store pointer to exec timeout value in the ops structure
ccd7c0a treewide: rename exec_timeout to rpc_exec_timeout

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years ago
Hans Dedecker c19f1a8665 procd: update to latest git HEAD
d667354 early: set /tmp permissions explicitly

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
6 years ago
Jo-Philipp Wich 952b11766c rpcd: update to latest Git head
c79ef22 main: fix logic bug when not specifying a timeout option

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years ago
Jo-Philipp Wich 4105555115 rpcd: update to latest Git head
2cc4b99 file: use global exec timeout instead of own hardcoded limit
ecd1660 exec: increase maximum execution time to 120s

Also expose the socket and timeout options in /etc/config/rpcd for
easier use.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years ago
Hans Dedecker c97c672f9b procd: update to latest git HEAD
20192e4 watchdog: improve seting watchdog timeout and frequency

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
6 years ago
Hans Dedecker 59db98d0f2 fstools: update to git HEAD
29e53af fstools: add ntfs support

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
6 years ago
John Crispin d24bdaa794 procd: update to latest git HEAD
94944ab procd: Add cpu string to board detection

Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
John Crispin 3e8ef61c01 package/: fix $(PROJECT_GIT) usage
Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Rosen Penev 82d272efed procd: Install hotplug files as 600
procd runs as root, so it only makes sense that its files are restricted.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
6 years ago
Rosy Song 0fa1dd71cc fstools: filter unknown action in mount.hotplug script
Signed-off-by: Rosy Song <rosysong@rosinson.com>
6 years ago
Hans Dedecker f771a1b962 ubus: update to latest git HEAD
221ce7e ubusd_acl: event send access list support
da503db ubusd_acl: event listen access list support
c035bab ubusd_acl: rework wildcard support
73bd847 ubusd_event: move strmatch_len to ubus_common.h
0327a91 ubus/lua: add support for BLOBMSG_TYPE_DOUBLE

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
6 years ago
Emil Muratov bbf46c9f8f zram-swap: bump pkg version
Signed-off-by: Emil Muratov <gpm@hotplug.ru>
6 years ago
Emil Muratov 70d3ffb47f zram-swap: Add "max compression streams" configuration option
Config option to limit maximum compression streams per zram dev for
multicore CPU's. This could be defined via 'zram_comp_streams' option in
the 'system' section of '/etc/config/system' file or via cli (for e.x.
with 'uci set system.@System[0].zram_comp_streams=2 && uci commit
system'). Default is number of logical CPU cores.

Signed-off-by: Emil Muratov <gpm@hotplug.ru>
6 years ago
Emil Muratov 814cae7362 zram-swap: fix number of created zram devices for multicore CPU's
Use only one zram swap device of the specified $size instead of
[N x $size] devices for multicore CPUs Now zram module uses multiple
compression streams for each dev by default, so we do not need to create
several zram devs to utilize multicore CPUs.

Signed-off-by: Emil Muratov <gpm@hotplug.ru>
6 years ago
Emil Muratov 9edc1fe8ab zram-swap: fix zram dev reset for multicore cpu devices
* "zram stop" could reset up to $(num_of_cores) zram devices even if
   some of those were not mounted as swap dev's. This fix tries to
   enumerate mounted swap zram dev's before making a reset

 * remove hot-added zram devs on stop (except zram0)

Signed-off-by: Emil Muratov <gpm@hotplug.ru>
6 years ago
Emil Muratov b9e89adfb7 zram-swap: compression algorithm configuration option
Compression algorithms for zram are provided by kernel crypto API, could
be any of [lzo|zl4|deflate|<some_more>] depending on kernel modules.
Compress algo for zram-swap could be defined via 'zram_comp_algo' option
in 'system' section of '/etc/config/system' file, or via cli (for e.x.
with 'uci set system.@System[0].zram_comp_algo=lz4 && uci commit
system'). check available algo's via 'cat /sys/block/zram0
/comp_algorithm'

Signed-off-by: Emil Muratov <gpm@hotplug.ru>
6 years ago
Samuel Casa 65e9561b3d zram-swap: Shell cosmetic
Signed-off-by: Samuel Casa <samuel.casa@neratec.com>
6 years ago
Samuel Casa b291517fdf zram-swap: remove trailing whitespaces in init script
Signed-off-by: Samuel Casa <samuel.casa@neratec.com>
[slightly reword subject]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years ago
Rosen Penev 4ad87744fa fstools: Install mount.hotplug and 10-fstab.defaults as 600
Both of these are used by programs that run as root and nothing else.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
6 years ago
Mike McCormack e8cbfedc72 ucert: work around short read
usign occasionally writes 16 characters then exits without writing a LF,
leaving ucert hanging waiting for more input.  Accept 16 characters
or more rather than 17 to work around the short read.

Signed-off-by: Mike McCormack <mike@atratus.org>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
6 years ago
Jo-Philipp Wich 8c91807214 rpcd: update to latest git HEAD
41333ab uci: tighten uci reorder operation error handling
f91751b uci: tighten uci delete operation error handling
c2c612b uci: tighten uci set operation error handling
948bb51 uci: tighten uci add operation error handling
51980c6 uci: reject invalid section and option names

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years ago
Yousong Zhou 3493c1cf41 uci: bump to source date 2018-08-11
Fixes segfault when parsing malformed delta lines

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
6 years ago
Jo-Philipp Wich cc21dab6cc ucert: update to lastest git HEAD
Update to latest HEAD in order to fix a stack memory corruption issue:

1056e73 Change the sigb buffer to be the same size as the fread

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years ago
Daniel Golle 7a52ce3faf ucert: update source
ad816fc set rpath to make bundle-libraries.sh happy
 63ad591 blob_buf needs to be zero'd

Now that libubox, libjson-c and libblobms_json are installed into
STAGING_DIR_HOST we can properly bundle ucert in the ImageBuilder.
Follow-up commits will make use of it to include a signature-chain in
sysupgrade images using fwtool.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
6 years ago
Hans Dedecker 9537c1a153 procd: update to latest git HEAD
e29966f Allow disabling seccomp or changing the whitelist
5f57223 trace: Use properly sized type for PTRACE_GETEVENTMSG
747efb6 procd: fix ustream deadlock when there are 0 bytes or no newlines

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
6 years ago
Christian Schoenebeck c89195eb25 ca-caertificates: remove myself as PKG_MAINTAINER
remove myself as PKG_MAINTAINER

Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
6 years ago
Jo-Philipp Wich 7316515891 ubus: update to latest git HEAD
40e0931 libubus: pass an empty UBUS_ATTR_DATA block if msg is NULL on invoke

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years ago
John Crispin a5c3bbaf56 ubus: update to latest git HEAD
884be45 libubus: check for non-NULL data before running callbacks

Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Rafał Miłecki 82498a7f7a mtd: improve check for TRX header being already fixed
First of all lengths should be compared after checking all blocks for
being good/bad. It's because requested length may differ from a final
one if there were some bad blocks.

Secondly it makes sense to also compare crc32 since we already have a
new one calculated.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
6 years ago
Rafał Miłecki 0f54489f75 mtd: support bad blocks within the mtd_fixtrx()
Reading MTD data with (p)read doesn't return any error when accessing
bad block. As the result, with current code, CRC32 covers "data" stored
in bad blocks.

That behavior doesn't match CFE's one (bootloader simply skips bad
blocks) and may result in:
1) Invalid CRC32
2) CFE refusing to boot firmware with a following error:
Boot program checksum is invalid

Fix that problem by checking every block before reading its content.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
6 years ago
Felix Fietkau 154c0c4006 ubus: compile with LTO enabled
Reduces total .ipk size by about 1k

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau 73fc67b614 procd: compile with LTO enabled
Reduces .ipk size on MIPS from 42k to 39k

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Felix Fietkau e07ad61aec procd: update to the latest version, fixes gcc 8 build error
a0372ac procd: increase watchdog fd_buf storage size to fix gcc8 build error

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Yousong Zhou 191078e83d ca-certificates: ca-bundle: add symlink for openssl default setting
OpenSSL defaults X509_CERT_FILE to /etc/ssl/cert.pem.  This change is
needed for wget-ssl and possibly others to work seamlessly with fresh
ca-bundle installation

Fixes openwrt/packages#6152

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
6 years ago
Daniel Golle f47d7df6a8 ucert: fix build
set PKG_BUILD_DIR before including package.mk to avoid problems as
seen on buildbot.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
6 years ago
Daniel Golle 1b8f3d9c2e ucert: add package
ucert is a wrapper around usign to allow delegation and revocation of
public keys for future use in sysupgrade.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This work was sponsored by WIO (wiowireless.com)
6 years ago
Karl Palsson 987e10af07 logd: create log directory for log_file
If log_file is specified, make sure its directory exists.

Signed-off-by: Karl Palsson <karlp@etactica.com>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [PKG_RELEASE increase]
6 years ago
Mirko Parthey 46d7ced9d1 mtd: mark as nonshared to fix FS#484
The mtd tool is built with different configurations depending on the
target. For example, brcm47xx adds the fixtrx subcommand, without which
an image fails when booting the second time.

Mark the mtd package as nonshared to really fix FS#484.

Signed-off-by: Mirko Parthey <mirko.parthey@web.de>
6 years ago
Hans Dedecker 5df2597c59 fstools: update to latest git HEAD
dd02dad fstools: allow the mounting with full access time accounting
242248c fstools: allow to compress the filesystem

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
6 years ago
Pierre Lebleu e6b8ce4c08 fstools: Add the new options available in the menuconfig
Mounting using the zlib compression and mounting with
full access accounting are now available in the
menuconfig.

Signed-off-by: Pierre Lebleu <pme.lebleu@gmail.com>
6 years ago
Jo-Philipp Wich 6d108c4a1a openwrt-keyring: bundle latest usign certificates
Includes the public usign certificates used by the 18.06.* release builds.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years ago
Jo-Philipp Wich fd72e67ffe openwrt-keyring: rename from lede-keyring
Also let the new openwrt-keyring package provide lede-keyring for backwards
compatibility.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years ago
Jo-Philipp Wich 6aaeec666d rpcd: update to lastest HEAD
8206219 uci: fix memory leak in rpc_uci_replace_savedir()
10f7878 exec: close stdout and stderr streams on child signal
92d0d75 uci: use correct sort index when reordering sections

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years ago
Christian Schoenebeck 80cb5c5703 ca-certificates: Update to Version 20180409
ca-certificates: Update to Version 20180409

Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
6 years ago
Jo-Philipp Wich 99d9c98748 rpcd: update to latest HEAD
6994c87 uci: fix session delta isolation
f0f6f81 session: remove redundant key attribute to rpc_session_set()
3d400c7 session: support reclaiming pending apply session
eb09f3a session: ignore non-string username attribute upon restore
edd37f8 uci: add rpc_uci_replace_savedir() helper
2423162 uci: switch to proper save directory on apply/rollback
66a9bad uci: fix memory leak in rpc_uci_apply_timeout()

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years ago
Felix Fietkau d92ec071b2 mtd: fix erase handling with partition offset on write
When a partition offset is given, it is used in an lseek call, which
affects write, but not erase. Add it to the offset for erase calls as
well

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Rafał Miłecki e8f8d6cde4 fstools: update to latest master branch
e243683 libfstools: move mount points when switching to JFFS2
3782b59 libfstools: add "const" to char pointer arguments in mount_move()
79721f0 libfstools: fix foreachdir() to pass dir with a trailing slash

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
6 years ago
Yousong Zhou 01b835970a procd: update to the latest version
Changes since last version

    dfb68f8 service: initialize supplementary group ids
    3db4e6d service: add func for string config change check
    c3faabe procd: get rid of putenv usage.

The supplementary group id change fixes FS#988

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
6 years ago
Hans Dedecker 9b92afa3aa uci: update to latest git HEAD
5d2bf09 uci: fix a potential use-after-free in uci_set()
3b3d63e list: only record ordering deltas if element position changed
4c4d343 cmake: Fix cli shared linking against ubox

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
6 years ago
John Crispin 3cb38368e2 ubox: fix PKG_MIRROR_HASH
Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
John Crispin 88a41074e8 ubox: update to latest git HEAD
128bc35 logread: fix reconnect logd logic
66347ec logread: move the code setting up the request blob out of the main loop
975a258 logread: move output connection setup code out of main loop
b81bea7 logread: cleanup pid file handling
d73e7d2 ubox: Replace strerror(errno) with %m format.

Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
George Hopkins 13f9e40602 ramips: add support for D-Link DAP-1522 A1
D-Link DAP-1522 is a wireless bridge/access point with 4 LAN
ports and a dual-band wireless chipset.

Specifications:
- Ralink RT2880
- 32 MB of RAM
- 4 MB of Flash
- 4x 10/100/1000 Mbps Ethernet (RTL8366SR)
- 802.11abgn (RT2850)

Flash Instructions:
1. Download lede-ramips-rt288x-dap-1522-a1-squashfs-factory.bin
2. Open the web interface and upload the image

Signed-off-by: George Hopkins <george-hopkins@null.net>
6 years ago
George Hopkins 5203355062 mtd: add fixwrg command
Add a command to fix WRG headers, based on wrgg.c.

Signed-off-by: George Hopkins <george-hopkins@null.net>
6 years ago
Zoltan HERPAI d3da2fcb8b tools: add iucode-tool
Add tool to "compile" Intel microcode files. The tool will be
compiled for host (to split the microcode.dat) and for target
(to forcibly reload the microcode if required).

Instead of using the large microcode.bin/microcode-64.bin, the
splitted ucode files (separate for CPU families) will be
installed.

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
6 years ago
John Crispin d3ddced0c7 fstools: update to latest git HEAD
3d23981 strip trailing spaces from vfat labels
c4a3c97 fix vfat volume label
5010710 block: support /dev/nvme* nodes

Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Yousong Zhou 60ad837bea procd: fix procd_lock() when prepare_roofs
This fixes the following errors when doing "make package/install"

    /home/yousong/git-repo/lede-project/lede/build_dir/target-mips_24kc_musl/root-malta/lib/functions/procd.sh: line 47: /home/yousong/git-repo/l
    ede-project/lede/build_dir/target-mips_24kc_musl/root-malta/var/lock/procd_urandom_seed.lock: No such file or directory
    flock: 1000: Bad file descriptor

Fixes FS#1260

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
6 years ago
Hans Dedecker a9ffe9fd75 procd: update to latest git HEAD
653629f trace: check asprintf() return value
67eb7e6 trace: add missing limits.h include

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
6 years ago
John Crispin 24b0424ecb procd: update to latest git HEAD
846e20c procd: add timing to start/stop logging

Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Hauke Mehrtens e3c43ade0b ubus: fix PKG_MIRROR_HASH
Fixes: dd975d15a7 ("ubus: fix wrong PKG_SOURCE_DATE")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
6 years ago
Hans Dedecker 1ca4f8ca1c ubox: update to latest git HEAD
e7a63fb ubox: Remove unnecessary memset calls

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
6 years ago
Hans Dedecker dd975d15a7 ubus: fix wrong PKG_SOURCE_DATE
Fix wrong PKG_SOURCE_DATE introduced in e14cac0

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
6 years ago
Hans Dedecker e14cac0ebf ubus: update to latest git HEAD
5bae22e ubus/lua: pass notification name to callback
212ceb1 valgrind complained about these
d57907c fix invalid close() call

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
6 years ago
John Crispin 69a36cbab2 fstools: update to latest git HEAD
18090d9 overlay: fix compilation with glibc
2a9a6ea libfstools: optimize building directory string for glob
de6b026 libfstools: support file paths longer than 255 chars

Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Jo-Philipp Wich fe920d01bb treewide: replace LEDE_GIT with PROJECT_GIT
Remove LEDE_GIT references in favor to the new name-agnostic
PROJECT_GIT variable.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years ago
Jo-Philipp Wich 4e9af67077 Revert "fstools: update to latest git HEAD"
This reverts commit df326e9b2e.

The referenced commit does not exist in the upstream repository.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years ago
John Crispin df326e9b2e fstools: update to latest git HEAD
2a9a6ea libfstools: optimize building directory string for glob
de6b026 libfstools: support file paths longer than 255 chars

Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Jo-Philipp Wich da95c9aa17 opkg: switch source url to git.openwrt.org
As LEDE is rebranding to OpenWrt now, adjust the Git source references
accordingly.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years ago
Tony Ambardar a367645f23 uci: add missing 'option' support to uci_rename()
When using the uci.sh wrapper, allow parameters to match those supported
by the uci binary i.e. "uci rename <config>.<section>[.<option>]=<name>".

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
6 years ago
Kevin Darbyshire-Bryant 37bb463daa procd: procd_send_signal use signal names
Usage documentation for 'procd_send_signal' states "The signal is SIGHUP
by default, and must be specified by NAME."  Make actual behaviour match
the stated documented behaviour.

https://wiki.openwrt.org/inbox/procd-init-scripts

Suggested-by: Jo-Philip Wich <jow@mein.io>
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
6 years ago
John Crispin 3804f5743d procd: update to latest git HEAD
a5954cf procd: Add %m to several functions that return errno.
810d7a5 procd: Remove redundant errno variable in several printf functions.
fa5ce1c procd: Replace strerror(errno) with %m.

Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
John Crispin 16ed8ac8e9 fstools: update to latest git HEAD
11efbf3 overlay: fix race condition when switching to jffs2
bdeb95a libblkid-tiny: add support for NTFS superblock
ef2cc03 fstools: Replace strerror(errno) with %m format.
98fd5b4 libblkid-tiny: add support for UBI superblock

Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Roman Yeryomin e410f785a4 procd: introduce procd_lock for init script protection
Use flock to protect init script from concurrent execution
(of the same script).
Important for services which generate native config files.

Signed-off-by: Roman Yeryomin <roman@advem.lv>
Signed-off-by: Andrejs Hanins <ahanins@gmail.com>
6 years ago
John Crispin b153745bfb procd: update to latest git HEAD
7aad940 procd: initd: fix path allocation in early_insmod
006c19c procd: Remove unnecessary memset calls.

Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
Jo-Philipp Wich ab703bf174 uci: bump to git HEAD version
5beb95d lua: additionally return name when looking up sections
ff33bb2 lua: support extended section notation

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years ago
Hans Dedecker 0fca474e70 uci: update to latest git HEAD (FS#1182)
25fd142 list: remove unncessary increment of n_section (FS#1182)
021fd65 file: remove unnecessary uci_fixup_section calls

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
7 years ago
Rafał Miłecki d2e96d55ab opkg: fix PKG_CONFIG_DEPENDS to include version.mk entries
Including version.mk sets PKG_CONFIG_DEPENDS to config entries used for
VERSION_SED command. We should keep these configs to make sure package
gets refreshed when needed.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
7 years ago
Jonas Gorski 1cfbd50ff4 package: move distfeeds.conf from opkg to base-files
All the relevant options used for distfeeds.conf are part of base-files,
so it makes more sense to move the file there as well.

This has the added benefit that the we can share the opkg package again,
reducing the amount of target specific packages.

Acked-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
7 years ago
Rafał Miłecki 3cd6ccf199 opkg: bump to version 2017-12-07
Changes:
3b417b9 opkg_download: decode file:/ URLs
71c27cb file_util: implement urldecode_path()
d1fe095 file_util: consolidate hex/unhex routines
ebdfc12 add opkg option http_timeout
9f003e3 opkg: encode archive filenames while constructing download URLs
73e6c81 file_util: implement urlencode_path() helper
468158f libopkg: fix SHA256 calculation for big endian system

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
7 years ago
Daniel Golle 173edcdc9d rpcd: update to version from 2017-12-07
cfe1e75c91bc1 sys: packagelist: allow listing all packages
74a784f037867 sys: fix passwd path

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
7 years ago
Felix Fietkau 4b091ab01a ubus: update to the latest version
9c13096 ubus: Remove unnecessary memset calls.
6d1ea6c libubus: Fix deletion from context's object AVL tree when removing object
e02813b ubusd: don't free messages in ubus_send_msg() anymore
be146ad ubusd: rename goto label from `error` to `out`
27d712d ubusd_monitor: alloc & free the buffer outside of the loop
5f87f54 ubusd: move global retmsg per client

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Daniel Golle 654016bb0a rpcd: fix packagelist memory leak
a0231be8fbc61 sys: fix memory leak in packagelist

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
7 years ago
Daniel Golle 49fde37758 rpcd: update to the latest version from 2017-11-12
4e483312b0216 sys: add packagelist method

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
7 years ago
John Crispin b4e30b863c procd: update to latest git HEAD
7c9aa7c service: add data within the service itself
e2b819a service: fix calls to blobmsg_parse()

Signed-off-by: John Crispin <john@phrozen.org>
7 years ago
Pierre Lebleu 832b6b8305 procd: service_data: Support data within the service itself
Use the same approach than the service_triggers for the service_data.

Signed-off-by: Pierre Lebleu <pme.lebleu@gmail.com>
7 years ago
Rafał Miłecki 5cd48280fd rpcd: update to the latest version from 2017-11-09
9a8640183c031 plugin: use RTLD_LOCAL instead of RTLD_GLOBAL when loading library

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
7 years ago
Felix Fietkau 94491a1571 ubox: update to the latest version, fixes syslog issues
7a49632 logd: use uloop instead of ustream_fd for syslog
69d6542 logd: only create pipe in stream mode
df30c8c logread: terminate after EOF
bdcacad logd: implement oneshot mode for stream log read
4a10d4e logread: use oneshot mode without -f, wait for logd to close
ea3d7fa logd: enforce line length limit for ubus based log messages as well
960a29d logread: remove leftover debug code
a081904 logread: fix line buffer size
2c0d9cf logd: move stripping of newlines to log_add()

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
John Crispin 5b3e35d85b ubox: update to latest git HEAD
da5b8b4 log/syslog: Add missing static to two structs.
dd61c9f ubox: Replace { 0 } with {}.

Signed-off-by: John Crispin <john@phrozen.org>
7 years ago
John Crispin f62e2f611c procd: update to latest git HEAD
53e92d4 procd: lower the logging threshold
b39c362 service: Start services normally when seccomp is disabled
3ba6b45 procd: add missing new lines inside debug code
56a02e3 service: fix service_handle_event array
d4a183f service: fix SERVICE_ATTR_NAME usage in service_handle_set

Signed-off-by: John Crispin <john@phrozen.org>
7 years ago
Michal Sojka 0e300a3a71 procd: Always tell cmake whether to include seccomp support or not
Without this change, when a user disables seccomp support in .config,
procd does not get recompiled unless the package is cleaned manually.
It is because when -D option is missing from cmake command line, cmake
uses cached value from the previous run where seccomp was enabled.

Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
7 years ago
John Crispin 727ab294d0 ubus: update to latest git HEAD
24ffe9b libubus-req: add data_cb callback handling for ubus notifications

Signed-off-by: John Crispin <john@phrozen.org>
7 years ago
Hans Dedecker 7d905f1e95 uci: bump to git HEAD version
5ad59ad Add bitfield_set function from libubox

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
7 years ago
Hans Dedecker a37655baca procd: use LN macro
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
7 years ago
Michal Sojka 1a5bf778fb procd: Install seccomp-trace symlink
Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
7 years ago
John Crispin 3398e8e94d procd: update to latest git HEAD
ee582d1 instance: properly compare and reload respawn config
260a4cd utrace: Start the tracee only after uloop initialization
520ad3c utrace: Switch all logging to ulog
1c48104 utrace: Support non-contiguous syscall numbers
582cf97 utrace: Forward SIGTERM to the traced process
32534f7 utrace: Report ptrace errors
ccde3fb seccomp: Improve error message
7f9b174 preload-seccomp: Use proper log level for error messages
e3c4302 Start seccomp-enabled services via seccomp-trace
5e4ad02 seccomp: Log seccomp violations with utrace
2661b2f utrace: Use PTHREAD_SEIZE instead of PTHREAD_TRACEME
b5d53c6 utrace: Deliver signals to traced processes
b416ed9 utrace: Support tracing multi-threaded processes and vfork
8b7d47a utrace: Trace processes across forks
c6b6ec6 utrace: Sort syscalls by number of invocations
592c532 Update trace attribute
c8faedc Do not disable seccomp when configuration is not found
017f3a1 utrace: Fix off-by-one errors
5acaf15 utrace: Fix environment initialization

Signed-off-by: John Crispin <john@phrozen.org>
7 years ago
Hans Dedecker 80e2ee3e64 ubox: update to git HEAD version
b1bc8d5 kmodloader: log error message in case of out of memory
f346111 kmodloader: lift restriction on module alias info
f1ef2c3 kmodloader: fix possible segfaults
9cb63df kmodloader: fix endianess check
2cff779 kmodloader: Check module endian before loading
d54f38a kmodloader/get_module_info: initialized aliases to make it more clean
a0b6fef kmodloader: insmod: fix a memoryleak in error case
278c4c4 kmodloader/get_module_name: null-terminate the string
16f7e16 syslog: remove unnecessary sizeof struct between messages

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
7 years ago
Karl Palsson 7a423c389a procd: mdns: Support txt values with spaces
Properly quote the arguments so that you can register a service with TXT
entries that contains spaces.

Example:
   procd_add_mdns myservice tcp 9999 "key=descriptive text field 1" \
         "another=something equally verbose"

Output before:
$ avahi-browse -r -v _myservice._tcp
_myservice._tcp      local
   hostname = [blah.local]
   address = [192.168.255.74]
   port = [9999]
   txt = ["verbose" "equally" "another=something" "1" "field" "text" "key=descriptive"]

Output now:
$ avahi-browse -r -v _myservice._tcp
_myservice._tcp      local
   hostname = [blah.local]
   address = [192.168.255.74]
   port = [9999]
   txt = ["another=something equally verbose" "key=descriptive text field 1"]

Signed-off-by: Karl Palsson <karlp@etactica.com>
7 years ago
John Crispin 6b44d9785f procd: update to latest git HEAD
54b46a3 procd: send ubus notify when a config file has changed

Signed-off-by: John Crispin <john@phrozen.org>
7 years ago
Christian Schoenebeck a2a226e6e8 ca-certificates: Update to 20170717
Update to 20170717

Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
7 years ago
Florian Eckert 5209cfa534 procd: fix hotplug.json syntax
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
7 years ago
Florian Eckert a307480e2d procd: fix hotplug-preinit.json syntax
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
7 years ago
Hans Dedecker 0b7f7606dd procd: update to the latest git HEAD
a17e1e8 watchdog: fix inline watchdog_get_magicclose function prototype

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
7 years ago
John Crispin d0fb048b0e procd: update to latest git HEAD
f062b30 procd: Do not leak pipe file descriptors to children

Signed-off-by: John Crispin <john@phrozen.org>
7 years ago
John Crispin 0c1420b3fe fstools: update to latest git HEAD
8ab4fda fstools: add btrfs support

Signed-off-by: John Crispin <john@phrozen.org>
7 years ago
Jo-Philipp Wich eb43a817f7 opkg: bump to version 2017-07-28
Commits since last 2017-07-11:

4bd8601 pkg_parse: fix segfault when parsing descriptions with leading newlines

Fixes FS#933.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Matthias Schiffer ae30673b10
procd: update to latest version
17026f4 system: return ubus error when sysupgrade_exec_upgraded() has failed
13f252f upgraded: Check chroot() return value
85ccb95 init: Check chroot return value in sysupgrade_exec_upgraded()
76dcbee upgraded: improve error handling
d749b2a upgraded: register stage2 process in uloop as intended

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
7 years ago
Daniel Golle cb2a3911e1
fstools: update to latest
0dfe61a block: support /dev/xvd* nodes
f038a61 libfstools: fix matching device name

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
7 years ago
Yousong Zhou 254f0da6d2 opkg: bump to version 2017-07-11
Commits since last 2017-05-03

    52fc006 pkg_alternatives: pass if the desired symlink already exists
    c668fce opkg: add --no-check-certificate argument

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
7 years ago
Hans Dedecker a35a27e8ef uci: update to the latest version
c4df32b file: remove redundant NULL check on return value of uci_realloc()
5d08b7f build: fix BUILD_STATIC
49ec6ef Fix skipping directories in uci_list_config_files
c203c2f Revert "mandatory anonymous section identifier"
0a1a2fc uci/lua: add explicit close() method
7daf942 uci/lua: add list_configs() function
fe45f97 test: adjust for auto-naming anonymous sections
2eb9c09 cli: remove now-defunct UCI_FLAG_EXPORT_NAME support
df72af4 mandatory anonymous section identifier

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
7 years ago
Jo-Philipp Wich 2c5f16ecac procd: support term_timeout parameter
Expose "term_timeout" parameter in procd.sh to allow init scripts to
request a longer termination timeout.

This is required to fix FS#859 in a later commit.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Jo-Philipp Wich 124ab1dc0a procd: assign /dev/tty* nodes to "tty" group
Adjust default permissions and ownership of /dev/tty* nodes from
0600/root:root to 0660/root:tty in order to support granting
unprivileged user access when needed.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Christian Schoenebeck 7d7356df64 ca-certificates: Update to version 20161130+nmu1
Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
7 years ago
Hans Dedecker a1c1f6ea7b procd: update to latest version
e5e99c4 watchdog: add support for starting/stopping kernel watchdog

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
7 years ago
Daniel Golle e3d09e7898 procd: update to latest git HEAD
453116e system: introduce new attribute board_name
e5b963a preinit: define _GNU_SOURCE
e5ff8ca upgraded: cmake: Find and include uloop.h
f367ec6 hotplug: fix a memory leak in handle_button_complete()
796ba3b service/service_stopped(): fix a use-after-free
79bbe6d system: return legacy board name

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
7 years ago
Matthias Schiffer df5e80eb26
procd: update to latest git HEAD
e7bb2c8 upgraded: define __GNU_SOURCE

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
7 years ago
Matthias Schiffer 218af1957e
fstools: snapshot: handle jffs2 conversion using upgraded
We can reuse the kill_remaining and run_ramfs facilities of the stage2 run
by upgraded.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
7 years ago
Matthias Schiffer 6bbb3a2b0a
fstools: clean up trailing whitespace in snapshot script
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
7 years ago
Matthias Schiffer 393817df5d
procd: remove procd-nand package
We always want to support staged upgrades now, so it's better to include
upgraded into the main package. /lib/upgrade/nand.sh is moved to
base-files.

The procd-nand-firstboot package is removed for now, it may return later
as a separate package.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
7 years ago
Matthias Schiffer 8008765f1f
procd: update to latest git HEAD
992b796 rcS: add missing fcntl.h include
63789e5 init: add support for sysupgrades triggered from preinit
5b1fb35 Remove code that has become unnecessary after sysupgrade changes
5918b6d upgraded: add support for passing a "command" argument to stage2
056d8dd upgraded: link dynamically, chroot during exec
7c6cf55 system: always support staged sysupgrade
d42b21e procd/rcS: Use /dev/null as stdin
e0098d4 service/instance: add an auto start option
1247db1 procd: Log initscript output prefixed with script name
8d720b2 procd: Don't use syslog before its initialization
2555474 procd: Add missing \n in debug message

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
7 years ago
Matthias Schiffer 49328cecdf
procd: prepare NAND sysupgrade for making upgraded dynamically linked
Use install_bin to copy upgraded with all dependencies. The old name
/tmp/upgraded is temporarily retained as a symlink to avoid breaking
things.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
7 years ago
Matthias Schiffer 25d1a24e58
procd: clean up trailing whitespace in nand.sh
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
7 years ago
Felix Fietkau 65a3dc277f fstools: update to the latest version
88d48d5 libfstools: silence mkfs.{ext4,f2fs}
a19f2b3 build: disable the format-truncation warning error to fix gcc 7 build errors
633a8d0 libfstools: fix multiple volume_identify usages with the same volume
c43ae11 fstools: use -Wno-format-truncation instead of -Wno-error=format-truncation

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Yousong Zhou 0c3fe281e3 opkg: alternatives: use ERROR level for symlink failure
Changes since last version

    04e279e pkg_alternatives: use ERROR level for symlink failure

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
7 years ago
Yousong Zhou fc9361e60e opkg: alternatives support
Changes since last version

    546bc72 pkg: alternatives support
    7a96972 libbb: xreadlink: fix memory leak on failure case
    3f13edd pkg_run_script: use pkg->dest in half installed case

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
7 years ago
Jo-Philipp Wich 1449b52f02 opkg: backport upstream fixes, code cleanups
Update to latest Git in order to import the following fixes:

1d0263b check_data_file_clashes_change: remove duplicated offline root in paths
a00a6a9 buildReplaces: do not add duplicated replacees
9fbedd8 opkg: compare-versions doesn't need any state
45b54f6 opkg_cmd: fix segmentation fault in opkg_compare_versions_cmd()
93de62b opkg_cmd: fix return of opkg compare-versions
51275a8 pkg_src_list_push: remove unused function
947d3d4 pkg_src_list_pop: remove unused function
980cfb2 str_list_push: remove unused function
52c31c1 str_list_prev: remove unused function
7d24212 str_list_last: remove unused function
48142a3 conffile_list_pop: remove unused function
46c5de5 pkg_dest_list_push: remove unused functions
368bb62 nv_pair_list_prev: remove unused function
2985c00 nv_pair_list_last: remove unused function
f5082ac conffile_list_pop: remove unused function
89bf8b9 conffile_list_push: remove unused function
23d31fb active_list_sort: remove unused function
7fe45f2 active_list_add_depend: remove unused function
86b584d pkg_dependence_satisfied: remove unused function
816d330 Fix typo in pkg_hash_fetch_best_installation_candidate.
07f3b02 set_flags_from_control: remove function

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Felix Fietkau 6411a12de2 build: move PKG_CONFIG_DEPENDS from feeds.mk to opkg
Normal packages don't rely on the feed configuration variables for the
build step

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
John Crispin 4f5776932b fstools: update to latest git HEAD
20c16fc cmake: Make blockd link against libjson-c
92b4c2c libfstools: add basic documentation of mount functions

Signed-off-by: John Crispin <john@phrozen.org>
7 years ago
Christian Lamparter 93aa860405 procd: nand: make it possible to configure kernel and ubi partition
With this patch, the nand.sh script no longer overwrites
CI_KERNELPART and CI_UBIPART if they have been set before.

This allows platforms specify alternative values for these
variables.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
7 years ago
Jo-Philipp Wich 48ae44d033 opkg: gracefully handle missing $PATH, fix build warnings
Update to latest Git in order to import the following fixes:

cfe46c7 opkg_active_list_test: mark functions static, swap strcmp() with memcmp()
0b60d6a libopkg_test: mark functions static, remove unused opkg_test()
28b5e15 pkg_parse: fix bad message level for opkg_msg() call
d9e5814 pkg_parse: remove unused variable in pkg_parse_line()
1654bcc pkg_parse: remove const requirement from pkg_parse_line()
53e199e pkg_hash: remove unused variable in pkg_hash_load_feeds()
da8d599 pkg_depends: add missing parse_replacelist() prototype
f0c0a80 opkg_utils: add missing header
e450488 libopkg: remove unused progress parameters from opkg_download()
f4a55d1 libopkg: remove unused progress callback
7cbc466 libopkg: remove unused variable from opkg_install_package()
6fbf8a9 libbb: remove unused variables
7975c73 libbb: change gzip_read() buffer argument to void *
6e28563 libbb: fix gzip_thread() warnings
1ff2475 libopkg/opkg_cmd.c: more robust PATH handling
5dc3e33 libopkg: specify "/bin/sh" instead of "sh"

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Claudiu Brasovean c70c6ac070 procd.sh: use parameterized respawn values
continue work started here: http://patchwork.ozlabs.org/patch/520859

Extend /etc/config/system with parameters to set the default respawn treshold and respawn timeout
	for procd launched services that have respawn enabled.
This results in cleaner init scripts, while making sure services have respawn parameters set.

Signed-off-by: Claudiu Brasovean <cbrasho@gmail.com>
7 years ago
Hans Dedecker 42e3053ee4 procd: update to git HEAD version
8f218f5 procd: service gets deleted when its last instance is freed
35209a0 procd: update modprobe path

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
7 years ago
Jo-Philipp Wich aedd5d5cb0 opkg: fix several package installation bugs
Update to latest Git in order to import the following fixes:

19070b6 unarchive: fix possible segmentation fault in deb_extract()
758527e pkg: forward "provided_by_hand" flag in pkg_merge()
1fdc2ca pkg: mark bit fields in pkg_t unsigned
15fc1ee opkg_cmd: avoid null pointer dereference in opkg_what_depends_conflicts_cmd()
439c89e opkg_cmd: fix endless loop in whatprovides/whatreplaces
0fb3e9f pkg_depends: propagate virtual provided detail flag to providers
793155f pkg_depends: fix unsatisfied dependency installation order
b1dc770 libopkg: fix some overly aggressive line wrapping in pkg_depends.c

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
John Crispin 7e4b869c45 fstools: add blockd
this daemon replaces mountd.

Signed-off-by: John Crispin <john@phrozen.org>
7 years ago
John Crispin 6a772cb953 mountd: drop in favour of blockd
Signed-off-by: John Crispin <john@phrozen.org>
7 years ago
Felix Fietkau c8f7031ba7 ubox: update to the latest version
21a4bd0 kmodloader: modprobe: return 0 for loaded modules

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Jo-Philipp Wich ebf846b005 opkg: mark as essential (FS#571)
Flag the opkg package as essential to avoid accidential uninstalls of it.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Felix Fietkau 887347497f ubus: update to the latest version
c09e4f0 ubusd: fix incomplete copy of shared buf during queue-ing
453b87f cli: add support for subscribing to objects
6eb3c96 cli: do not use default timeout for listen
dfe3383 libubus: reset ctx->sock.error when doing ubus reconnect
34c6e81 cli: fix listen_timeout compile issue

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Yousong Zhou e8871d946a ubox: fix possible address alignment issue
Fixes FS#544

3dc78a4 kmodloader: don't store aliases info in struct module

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
7 years ago
Jo-Philipp Wich 9e4555f58d opkg: fix stray printf() (#551)
Update to latest Git head to get rid of a stray printf() causing unwanted
output in the "opkg list-upgradable" command.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Jo-Philipp Wich 19720a6f03 opkg: fix handling conffiles in status lists
A missing list pointer initialization caused opkg to ignore conffile entries
from status files, breaking the conffile tracking on the target.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Felix Fietkau 2a1ee042cd ubox: update to the latest version
c553354 cmake: fix typo
8973576 kmodloader: fix not being able to find some modules
fce9382 cmake: Check for getrandom system call

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Jo-Philipp Wich 55ffc38004 opkg: re-enable usign support
The switch to cmake caused the -DHAVE_USIGN flag to get lost, disabling
compilation of the correspondinf support code.

Update to latest Git head which enables usign support by default.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Jo-Philipp Wich b65dc04712 opkg: switch to own fork to improve memory usage
Switch to our own fork of opkg to significantly reduce the required amount
of memory when updating lists or installing packages.

Preliminary tests showed a usage drop of about 90% during these operations,
from ~3.7MB with unmodified opkg to ~360KB with our custom fork.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
John Crispin 946d1dfb87 procd: update to latest git HEAD
5f91241 procd: add cancel_timeout on rc scripts when a runtime_timeout is specified
961dc69 procd: stop service using SIGKILL if SIGTERM failed to do so

Signed-off-by: John Crispin <john@phrozen.org>
7 years ago
Denis Osvald d9a358d562 procd: fix default timeout for reload trigger actions
Default trigger action timeout was added to procd.sh in commit f88e3a4c0
(procd: add default timeout for reload trigger actions)
However, the timeout value was not placed under the correct JSON-script
array nesting level and thus did not apply.

To fix this and make the timeout actually apply to the reload triggers,
we place it in the correct scope, that is the per-trigger array.

Fixes: f88e3a4c0a
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
7 years ago
Felix Fietkau de07a99447 fstools: update to the latest version
Fixes compatibility issues with glibc 2.25

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 2ffb80bc9f procd: update to the latest version
Fixes compatibility issues with glibc 2.25

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
John Crispin 1f3de99547 procd: update to latest git HEAD
cdc3dab ujail: fix signal forwarding

Signed-off-by: John Crispin <john@phrozen.org>
7 years ago
Felix Fietkau 785f2a70da ubus: update to the latest version
Adds the following fixes:

91acde6 libubus: do not modify uloop_cancelled
763b9b2 libubus: reset ctx->sock.eof to fix reconnect issues

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Jo-Philipp Wich c26ff034fc ubox: support quiet modprobe, support millisecond log timestamp accuracy
Update ubox to latest Git HEAD in order to import the following fixes:

ac2d43e kmodloader: support '-q' quiet option
f8d3d16 ubox: Add an option for more accurate timestamps in log

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Florian Fainelli f3c5934981 rpcd: Explicitly link with lcrypt
Fixes build issues with some toolchains that don't add lcrypt in the default
search paths:

CMakeFiles/rpcd.dir/session.c.o: In function `rpc_login_test_password':
build_dir/target-mipsel-linux-gnu/rpcd-2016-12-03-0577cfc1/session.c:823: undefined reference to `crypt'
collect2: error: ld returned 1 exit status

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
7 years ago
Jo-Philipp Wich 453343a834 ubox: import kmodloader fixes
Update ubox to latest Git head in order to import the following fixes:

14839f0 kmodloader: make insert_module() idempotent
6e3c6dc kmodloader: add module alias awareness
9371411 kmodloader: fix out-of-bound access when parsing .modinfo
a62c946 kmodloader: modprobe: skip possible command line arguments
46a4b5f kmodloader: log to kmsg when loading directories of modules
eacc426 kmodloader: remove redundant glob wildcard char
8488bb5 ubox: Initialize conditionally uninitialized variable
db070f1 ubox: Fix some memory leaks
acc48b5 kmodloader: Fix typo in error message

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Yousong Zhou 81aeba9b7f ubox: install kernel module utilities to /sbin directory
This is how other Linux distributions are doing and kernel
modprobe_path[] of request_module() also has a default value of
/sbin/modprobe

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
7 years ago
Bastian Bittorf b54cbad6ef procd: update procd.sh to disallow signal-numbers, enforce signal-names
A given signal-name is now converted to the corresonding number. In general
it's good style to use names (readability) and it's more portable: signal
numbers can be architecture-dependent, so we are more safe giving names.

A real world example is signal 10, which is BUS on ramips and USR1 on PPC.

All users of 'procd_send_signal' must change their code to reflect this.

Signed-off-by: Bastian Bittorf <bb@npl.de>
7 years ago
Matthias Schiffer 0c50ea6289
procd: update to latest git HEAD
0f58977 init: fix /tmp permissions on zram

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
7 years ago
Hannu Nyman 7ba2062744 opkg: clarify messages and errors related to downloads
Clarify opkg's messages related to downloads:

* more visible error message for package list download failure
* separate error message for signature file download error
* if wget returns 4, signal the network error more clearly
* remove '.' from end of filenames and URLs

* try signature check only if the package list was downloaded ok.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
7 years ago
Felix Fietkau 26ae7abc15 ubus: update to the latest version
Adds uloop related libubus fixes

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 2bc647e015 ubus: update to the latest version
- Adds support for passing file descriptors in ubus invoke requests
- Fixes clearing pending timers on ubus_shutdown()
- Fixes checking the amount of written data in ubusd
- Fixes an ubusd crash when trying to subscribe to system objects

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Jo-Philipp Wich 47c22c299c lede-keyring: bundle latest usign certificates
Includes the public usign certificates used by the 17.01.* release builds.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Andrej Vlasic 5c20a4fec9 ubox: turn logd into a separate package
Currently system log is always included as a part of ubox. Add logd as a
seperate package and add it to default packages list.

Signed-off-by: Andrej Vlasic <andrej.vlasic@sartura.hr>
Signed-off-by: Luka Perkov <luka.perkov@sartura.hr>
7 years ago
Matthias Schiffer 621fd9fd62
opkg: use default PKG_BUILD_DIR
opkg doesn't have BUILD_VARIANTs anymore, so the previously defined
PKG_BUILD_DIR would lead to a weird 'opkg-' path component.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
7 years ago
Felix Fietkau 627b0d3559 mountd: drop USB related dependencies
That way we can avoid making it nonshared

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 1ad30be982 Revert the recent dependency and metadata scanning rework
This reverts the following commits:
fbe522d120
278ad007ee
863888e44f
96daf6352f
cfd83555fc

This seems to trigger some mconf bugs when built with all feeds
packages, so I will try to find a less intrusive solution before the
release.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 96daf6352f mountd: allow build without USB_SUPPORT
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 4d8da82c29 procd: add support for overriding the tar sysupgrade board name
Useful for providing images that work for multiple devices

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
John Crispin 1ce9b566fd procd: update mirror hash
Signed-off-by: John Crispin <john@phrozen.org>
7 years ago