librecmc/librecmc.git
7 years agoumdns: remove superfluous include in init script
Jo-Philipp Wich [Thu, 1 Jun 2017 23:26:20 +0000 (01:26 +0200)]
umdns: remove superfluous include in init script

The umdns init script includes function/network.sh globally, outside of any
service procedure. This causes init script activation to fail in buildroot
and IB context if umdns is set to builtin.

Additionally, the network.sh helper is not actually used.

Drop the entire include in order to repair init script activation in build
host context. Fixes FS#658.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agodnsmasq: bump to 2.77
Jo-Philipp Wich [Thu, 1 Jun 2017 22:12:34 +0000 (00:12 +0200)]
dnsmasq: bump to 2.77

This is a cumulative backport of multiple dnsmasq update commits in master.

Drops three LEDE specific patches which are included upstream and another
patch which became obsolete. Remaining LEDE specific patches are rebased.

Fixes FS#766 - Intermittent SIGSEGV crash of dnsmasq-full.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agodnsmasq: make tftp root if not existing
Alberto Bursi [Tue, 2 May 2017 17:31:17 +0000 (19:31 +0200)]
dnsmasq: make tftp root if not existing

If there's a TFTP root directory configured, create it with mkdir -p
(which does not throw an error if the folder exists already)
before starting dnsmasq. This is useful for TFTP roots in /tmp, for example.

Originally submitted by nfw user aka Nathaniel Wesley Filardo

Signed-off-by: Alberto Bursi <alberto.bursi@outlook.it>
7 years agodnsmasq: use logical interface name for dhcp relay config
Karl Vogel [Wed, 29 Mar 2017 09:39:35 +0000 (11:39 +0200)]
dnsmasq: use logical interface name for dhcp relay config

The relay section should use the logical interface name and
not the linux network device name directly. This to be
consistent with other sections of the dnsmasq config where
'interface' means the logical interface.

Signed-off-by: Karl Vogel <karl.vogel@gmail.com>
7 years agodnsmasq: don't point --resolv-file to default location unconditionally
Philip Prindeville [Tue, 14 Mar 2017 18:58:37 +0000 (12:58 -0600)]
dnsmasq: don't point --resolv-file to default location unconditionally

If noresolv is set, we should not generate a --resolv-file parameter.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [minor cleanup]
7 years agoar71xx: fix Wallys DR344 GPIO-connected LEDs and button
Piotr Dymacz [Mon, 29 May 2017 19:32:11 +0000 (21:32 +0200)]
ar71xx: fix Wallys DR344 GPIO-connected LEDs and button

This fixes wrong GPIO numbers for LEDs and button in Wallys DR344 board
and sets color of all LEDs to green as the mass production boards have
only green one.

Actually, DR344 has 6 GPIO-connected LEDs and one button:

- GPIO11: status
- GPIO12: sig1
- GPIO13: sig2
- GPIO14: sig3
- GPIO15: sig4
- GPIO16: reset button
- GPIO17: lan

WAN LED is connected directly with AR8035 PHY.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years agoar71xx: set GE interface as wan by default in Wallys DR344
Piotr Dymacz [Mon, 29 May 2017 19:25:03 +0000 (21:25 +0200)]
ar71xx: set GE interface as wan by default in Wallys DR344

This aligns default network interfaces configuration with vendor
firmware: GE (eth0) -> wan, FE (eth1) -> lan.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years agoar71xx: fix GE interface support in Wallys DR344
Piotr Dymacz [Mon, 29 May 2017 17:18:52 +0000 (19:18 +0200)]
ar71xx: fix GE interface support in Wallys DR344

GMAC0 interface of AR9344 SOC in Wallys DR344 board is connected with
AR8035, not with AR8327. Without this fix, GE interface doesn't work at
all or shows high packet loss ratio.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years agotoolchain/gdb: update to version 7.12.1
Etienne Haarsma [Sun, 5 Feb 2017 12:37:52 +0000 (13:37 +0100)]
toolchain/gdb: update to version 7.12.1

Update gdb to version 7.12.1.

GDB 7.12.1 brings the following fixes and enhancements over GDB 7.12:

   * PR tdep/20682 (aarch64 regression: gdb.cp/nextoverthrow.exp)
   * PR server/20733 (Failed to build aarch64_be-linux-gnu GDBserver)
   * PR tdep/20953 (GDB crashes after "set architecture rl78")
   * PR tdep/20954 (GDB crashes if "set architecture rx")
   * PR tdep/20955 (GDB internal error in cris-tdep.c)
   * PR build/20712 (gdb 7.12+ doesn't build as C++ on Solaris)
   * PR breakpoint/20653 (string_to_explicit_location has some weird code)
   * PR build/20753 (MinGW compilation errors due to strcasecmp)
   * PR gdb/20977 (GDB exception handling is broken on i686-w64-mingw32)
   * PR python/21048 (backtrace is broken on i686)
   * PR sim/20808 (mips sim build fails due to undefined SD/CPU variables)
   * PR sim/20809 (mips sim build fails for r3900 cpus)
   * PR gdb/20939 (GDB aborts

Signed-off-by: Etienne Haarsma <bladeoner112@gmail.com>
7 years agousbmode: update usb-modeswitch-data to 20170205
Julian Labus [Wed, 24 May 2017 14:32:17 +0000 (16:32 +0200)]
usbmode: update usb-modeswitch-data to 20170205

add support for new hardware

Signed-off-by: Julian Labus <julian@labus-online.de>
7 years agousbmode: update to latest version
Julian Labus [Wed, 24 May 2017 14:32:16 +0000 (16:32 +0200)]
usbmode: update to latest version

453da8e convert-modeswitch.pl: fix message indices

Signed-off-by: Julian Labus <julian@labus-online.de>
7 years agousbmode: Update to latest HEAD
Florian Fainelli [Sun, 12 Feb 2017 21:59:50 +0000 (13:59 -0800)]
usbmode: Update to latest HEAD

Brings the following changes:

22f041e18df0 Extend StandardEject sequence to include LUN 1
61fdf7e9b1cc cmake: Search for libjson-c
2769852e76b5 cmake: Find libubox/blobmsg_json.h
8a47c4b6649f add TargetClass support

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
7 years agosamba: bump PKG_RELEASE
Jo-Philipp Wich [Sat, 27 May 2017 10:15:06 +0000 (12:15 +0200)]
samba: bump PKG_RELEASE

The previous CVE bugfix commit did not adjust PKG_RELEASE, therefor the
fixed samba package does not appear as opkg update.

Bump the PKG_RELEASE to signify upgrades to downstream users.

Ref: https://forum.lede-project.org/t/sambacry-are-lede-devices-affected/3972/4

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agofirewall: resync with master
Jo-Philipp Wich [Sun, 19 Feb 2017 18:04:09 +0000 (19:04 +0100)]
firewall: resync with master

Update to latest Git HEAD in order to import a number of fixes and other
improvements:

a4d98ae options: remove stray continue statement
3d2c18a options: improve handling of negations when parsing space separated values
0e5dd73 iptables: support -i, -o, -s and -d in option extra
4cb06c7 ubus: increase ubus network interface dump timeout
e5dfc82 iptables: add exception handling
f625954 firewall3: add check_snat() function
7d3d9dc firewall3: display the section type for UBUS rules
53ef9f1 firewall3: add UBUS support for include scripts
5cd4af4 firewall3: add UBUS support for ipset sections
02d6832 firewall3: add UBUS support for forwarding sections
0a7d36d firewall3: add UBUS support for redirect sections
d44f418 firewall3: add fw3_attr_parse_name_type() function
e264c8e firewall3: replace warn_rule() by warn_section()
6039c7f firewall3: check the return value of fw3_parse_options()
c328d1f build: use -Wno-format-truncation instead of -Wno-error=format-truncation
e06e537 utils: replace sprintf use with snprintf to avoid overflows
533f834 build: disable the format-truncation warning error to fix gcc 7 build errors
e751cde zones: drop outgoing invalid traffic in masqueraded zones
d596f72 rules: fix UCI context in error reporting
1d0564c ubus: fix interface name and proto lookup
82ccd9e firewall3: fix handling of UTC times
1949e0c iptables: support xtables API > 11

Fixes FS#548, FS#640, FS#806, FS#811.

Ref: https://forum.lede-project.org/t/nat-leakage-on-tl-wr1043nd-v4/1712

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agomac80211, hostapd: always explicitly set beacon interval
Matthias Schiffer [Sat, 13 May 2017 14:17:44 +0000 (16:17 +0200)]
mac80211, hostapd: always explicitly set beacon interval

One of the latest mac80211 updates added sanity checks, requiring the
beacon intervals of all VIFs of the same radio to match. This often broke
AP+11s setups, as these modes use different default intervals, at least in
some configurations (observed on ath9k).

Instead of relying on driver or hostapd defaults, change the scripts to
always explicitly set the beacon interval, defaulting to 100. This also
applies the beacon interval to 11s interfaces, which had been forgotten
before. VIF-specific beacon_int setting is removed from hostapd.sh.

Fixes FS#619.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
7 years agohostapd: add legacy_rates option to disable 802.11b data rates.
Nick Lowe [Mon, 27 Mar 2017 09:50:23 +0000 (10:50 +0100)]
hostapd: add legacy_rates option to disable 802.11b data rates.

Setting legacy_rates to 0 disables 802.11b data rates.
Setting legacy_rates to 1 enables 802.11b data rates. (Default)

The basic_rate option and supported_rates option are filtered based on this.

The rationale for the change, stronger now than in 2014, can be found in:

https://mentor.ieee.org/802.11/dcn/14/11-14-0099-00-000m-renewing-2-4ghz-band.pptx

The balance of equities between compatibility with b clients and the
detriment to the 2.4 GHz ecosystem as a whole strongly favors disabling b
rates by default.

Signed-off-by: Nick Lowe <nick.lowe@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name> [cleanup, defaults change]
7 years agoipq806x: fix Netgear X4 R7500 ath10k firmware selection
Thomas Reifferscheid [Fri, 17 Mar 2017 13:01:34 +0000 (14:01 +0100)]
ipq806x: fix Netgear X4 R7500 ath10k firmware selection

Netgear X4 R7500 comes with a QCA988X. Select a firmware that matches
the ath10k chipset

Signed-off-by: Thomas Reifferscheid <thomas@reifferscheid.org>
7 years agotreewide: select ath10k firmware explicit
Mathias Kresin [Fri, 17 Mar 2017 18:36:06 +0000 (19:36 +0100)]
treewide: select ath10k firmware explicit

Do not rely on the default firmware selected by ath10k.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years agoath10k-firmware: do not select the qca988x by default
Mathias Kresin [Fri, 17 Mar 2017 18:54:55 +0000 (19:54 +0100)]
ath10k-firmware: do not select the qca988x by default

Do not select the qca988x by default as soon as kmod-ath10k is
selected. We do support more ath10k chips than the qca988x in the
meantime, so this dependency doesn't make sense any longer.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years agobuild: fix possible issue with kmod package having multiple AutoLoad's
Yousong Zhou [Sat, 27 May 2017 02:22:02 +0000 (10:22 +0800)]
build: fix possible issue with kmod package having multiple AutoLoad's

This commit contains the following changes

 - Use local shell var where appliable
 - The $(sort $$$$$$$$mods) call will have no expected effect
 - Avoid EEXIST when creating symlinks in /etc/modules-boot.d/
 - Avoid duplicate arguments for insert_modules() in postinst-pkg

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
7 years agokernel: update kernel 4.4 to 4.4.70
Hauke Mehrtens [Fri, 26 May 2017 22:18:01 +0000 (00:18 +0200)]
kernel: update kernel 4.4 to 4.4.70

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years agokernel: fix autoloading arch-specific modules
Yousong Zhou [Thu, 25 May 2017 06:41:34 +0000 (14:41 +0800)]
kernel: fix autoloading arch-specific modules

Fixes FS#745

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
7 years agobacklight-pwm: fix module description
Yousong Zhou [Thu, 25 May 2017 06:40:36 +0000 (14:40 +0800)]
backlight-pwm: fix module description

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
7 years agokernel: update kernel 4.4 to 4.4.69
Stijn Segers [Wed, 24 May 2017 20:39:28 +0000 (22:39 +0200)]
kernel: update kernel 4.4 to 4.4.69

Bump the 17.01 tree kernel to 4.4.69. Trunk 4.4 and 17.01 4.4 have diverged, talked this
through with jow, he was okay with a clean diff against 17.01 and not a backported trunk
patch.

The following patches were applied upstream:

* 062-[1-6]-MIPS-* series
* 042-0004-mtd-bcm47xxpart-fix-parsing-first-block

Reintroduced lantiq/patches-4.4/0050-MIPS-Lantiq-Fix-cascaded-IRQ-setup, as
it was incorrectly included upstream thus dropped from LEDE, but subsequently
reverted upstream. Thanks to Kevin Darbyshire-Bryant for pointing me to it.

  Compile-tested on: ar71xx, ramips/mt7621, x86/64.

  Run-tested on: ar71xx, ramips/mt7621, x86/64.

Signed-off-by: Stijn Segers <francesco.borromini@inventati.org>
7 years agobinutils: fix build with host gcc < 4.9
Hauke Mehrtens [Sun, 2 Apr 2017 15:40:43 +0000 (17:40 +0200)]
binutils: fix build with host gcc < 4.9

binutils 2.27 checks if the target compiler supports -Wstack-
usage=262144, and also uses this setting for the host compiler. If the
host compiler is gcc < 4.9 binutils build will fail. This backports 2
commits which are fixing this problem for binutils 2.28.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years agoutil-linux: fix build with uclibc
Hauke Mehrtens [Thu, 13 Apr 2017 16:07:05 +0000 (18:07 +0200)]
util-linux: fix build with uclibc

Fix build of scriptreplay with uClibc.
Some parts of the libm detection were backported to 2.29.2, but some
parts were missing, which are added here. This patch is needed when
libm is a separate library, this is not needed for LEDE master, because
libm is there integrated in the libc for uClibc and musl.

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
7 years agodropbear: bump to 2017.75
Kevin Darbyshire-Bryant [Sat, 20 May 2017 11:54:11 +0000 (12:54 +0100)]
dropbear: bump to 2017.75

- Security: Fix double-free in server TCP listener cleanup A double-free
in the server could be triggered by an authenticated user if dropbear is
running with -a (Allow connections to forwarded ports from any host)
This could potentially allow arbitrary code execution as root by an
authenticated user.  Affects versions 2013.56 to 2016.74. Thanks to Mark
Shepard for reporting the crash.
CVE-2017-9078 https://secure.ucc.asn.au/hg/dropbear/rev/c8114a48837c

- Security: Fix information disclosure with ~/.ssh/authorized_keys
symlink.  Dropbear parsed authorized_keys as root, even if it were a
symlink.  The fix is to switch to user permissions when opening
authorized_keys

A user could symlink their ~/.ssh/authorized_keys to a root-owned file
they couldn't normally read. If they managed to get that file to contain
valid authorized_keys with command= options it might be possible to read
other contents of that file.
This information disclosure is to an already authenticated user.
Thanks to Jann Horn of Google Project Zero for reporting this.
CVE-2017-9079 https://secure.ucc.asn.au/hg/dropbear/rev/0d889b068123

Refresh patches, rework 100-pubkey_path.patch to work with new
authorized_keys validation.

Signed-off-by: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
7 years agosamba: fix CVE-2017-7494
Stijn Tintel [Wed, 24 May 2017 12:44:03 +0000 (14:44 +0200)]
samba: fix CVE-2017-7494

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
(cherry picked from commit 3f0d3d12da77d8833a725f99f6fa08640678a1ae)

7 years agoumdns: update to the version 2017-05-22
Rafał Miłecki [Mon, 22 May 2017 10:04:01 +0000 (12:04 +0200)]
umdns: update to the version 2017-05-22

This includes following changes:
0e8b948 Support specifying instance name in JSON file
49fdb9f Support PTR queries for a specific service
26ce7dc Allow filtering with instance name in service_reply
920c62a Store instance name in the struct service
ff09d9a Rename service_name function to the service_instance_name
64f78f1 Rename mdns_hostname variable to the umdns_host_label

Previous package update pulled commit 70c66fbbcde86 ("Fix sending
replies to PTR questions") which introduced a regression which this
update fixes.

Fixes: 474c31a20d834 ("umdns: update to the version 2017-03-21")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
7 years agobcm53xx: add support for TP-LINK Archer C5 V2
Rafał Miłecki [Sun, 21 May 2017 15:41:41 +0000 (17:41 +0200)]
bcm53xx: add support for TP-LINK Archer C5 V2

This model also contains few partitions non-discoverable partitions we
need to "protect". Othen than that it uses non-deprecated serial entry
in DTS that doesn't work with LEDE so we need to workaround it as well.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
7 years agofirmware-utils: tplink-safeloader: add support for Archer C5 V2
Rafał Miłecki [Sat, 11 Mar 2017 11:05:33 +0000 (12:05 +0100)]
firmware-utils: tplink-safeloader: add support for Archer C5 V2

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
7 years agofstools: backport regression fix for volume_identify
Rafał Miłecki [Tue, 9 May 2017 08:18:15 +0000 (10:18 +0200)]
fstools: backport regression fix for volume_identify

This fixes regression when volume_identify didn't identify volume on
subsequent calls.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
7 years agoimagebuilder: fix bundling of DTS sources
Jo-Philipp Wich [Sun, 14 May 2017 18:45:06 +0000 (20:45 +0200)]
imagebuilder: fix bundling of DTS sources

Refer to LINUX_KARCH instead of ARCH when bundling DTS files in the image
builder tarball.

While we're at it, also dereference symbolic links when copying as some
kernel architectures contain symbolic links in their DTS directories.

This fixes aarch64 imagebuilders such as brcm2708/bcm2710 ones in particular
as the kernel refers to "aarch64" as "arm64" internally.

Ref: https://forum.lede-project.org/t/lede-image-builder-problem/3680

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agoimage.mk: Generate cpiogz with root-owned files
Michal Sojka [Tue, 2 May 2017 14:57:18 +0000 (16:57 +0200)]
image.mk: Generate cpiogz with root-owned files

Some files (e.g. /etc/dropbear) need to be owned by root. Add cpio
option to ensure that.

Other image types (at least targz and squashfs) already have this.

Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
7 years agoramips: add om-watchdog to rut5xx DEVICE_PACKAGES
Steffen Weinreich [Tue, 25 Apr 2017 14:44:39 +0000 (16:44 +0200)]
ramips: add om-watchdog to rut5xx DEVICE_PACKAGES

Add om-watchdog as default package for rut5xx.

Signed-off-by: Steffen Weinreich <steve@weinreich.org>
7 years agoom-watchdog: add support for Teltonika RUT5xx (ramips)
Steffen Weinreich [Tue, 25 Apr 2017 14:44:39 +0000 (16:44 +0200)]
om-watchdog: add support for Teltonika RUT5xx (ramips)

Add rut5xx GPIO PIN selection to om-package startup script.

Testet on a RUT500 device, the timeout value of the hardware watchdog
is about 280 sec.

Signed-off-by: Steffen Weinreich <steve@weinreich.org>
[split into two commits, bump PKG_RELEASE]
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years agoom-watchdog: cosmetic code style fixes
Piotr Dymacz [Thu, 11 May 2017 22:10:11 +0000 (00:10 +0200)]
om-watchdog: cosmetic code style fixes

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years agoom-watchdog: cleanup Makefile
Piotr Dymacz [Thu, 11 May 2017 21:53:41 +0000 (23:53 +0200)]
om-watchdog: cleanup Makefile

Drop redundant Build/Prepare, empty lines and duplicated Build/Compile.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years agoar71xx: enable nand-utils in the mikrotik subtarget to ensure it makes it to initramfs
Felix Fietkau [Fri, 12 May 2017 11:28:56 +0000 (13:28 +0200)]
ar71xx: enable nand-utils in the mikrotik subtarget to ensure it makes it to initramfs

Without it, sysupgrade from initramfs to nand fails

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years agoopenvpn: update to v2.4.2
Jo-Philipp Wich [Fri, 12 May 2017 09:48:58 +0000 (11:48 +0200)]
openvpn: update to v2.4.2

Update to version 2.4.2 in order to address two potential Denial-of-Service
vectors in OpenVPN.

CVE-2017-7478 - Don't assert out on receiving too-large control packets
CVE-2017-7479 - Drop packets instead of assert out if packet id rolls over

Ref: https://community.openvpn.net/openvpn/wiki/ChangesInOpenvpn24#OpenVPN2.4.2
Ref: https://community.openvpn.net/openvpn/wiki/QuarkslabAndCryptographyEngineerAudits

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agoopenvpn: add myself as maintainer
Felix Fietkau [Mon, 3 Apr 2017 07:00:32 +0000 (09:00 +0200)]
openvpn: add myself as maintainer

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years agoOpenVPN: Update to 2.4.1
Daniel Engberg [Mon, 27 Mar 2017 12:51:44 +0000 (14:51 +0200)]
OpenVPN: Update to 2.4.1

Update OpenVPN to 2.4.1
Remove 200-small_build_enable_occ.patch as it's included upstream.
Refresh patches
Add mirror and switch to HTTPS

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
7 years agoopenvpn: add extra respawn parameters
Martin Schiller [Thu, 16 Mar 2017 10:25:53 +0000 (11:25 +0100)]
openvpn: add extra respawn parameters

This change protects the openvpn instances to be marked as "in a crash
loop" and thereby the connection retries will run infinitely.

When the remote site of an openvpn connection goes down for some time
(network failure etc.) the openvpn instance in an openwrt/lede device
should not stop retrying to establish the connection.

With the current limit of 5 retries, there is a user interaction
required, which isn't really what you want when the device should
simply do everything to keep the vpn connection up.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
7 years agoopenvpn: move list of params and bools to a separate file
Yousong Zhou [Sun, 26 Feb 2017 07:22:04 +0000 (15:22 +0800)]
openvpn: move list of params and bools to a separate file

So that future patches for addition/removal of them can be more
readable

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
7 years agoramips: fixup-mac-address: add missing include
Jo-Philipp Wich [Wed, 10 May 2017 22:50:48 +0000 (00:50 +0200)]
ramips: fixup-mac-address: add missing include

Add missing include of ramips.sh in order to import the missing
ramips_board_name() procedure.

Fixes FS#774.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agodnsmasq: support dhcp_option config as a list
Hans Dedecker [Wed, 26 Apr 2017 20:37:27 +0000 (22:37 +0200)]
dnsmasq: support dhcp_option config as a list

Configuring dhcp_option as an option does not allow the usage of white
spaces in the option value; fix this by supporting dhcp_option as a list
config while still supporting the option config to maintain backwards
compatibility

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
7 years agobcm53xx: backport DT patches for serial, thermal and MDIO
Rafał Miłecki [Thu, 20 Apr 2017 20:15:09 +0000 (22:15 +0200)]
bcm53xx: backport DT patches for serial, thermal and MDIO

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
7 years agoramips: add factory firmware for Tp-Link C20i/C50
Henryk Heisig [Fri, 5 May 2017 15:07:28 +0000 (17:07 +0200)]
ramips: add factory firmware for Tp-Link C20i/C50

TP-Link firmware doesn't accept sysupgrade.bin with metadata.

Signed-off-by: Henryk Heisig <hyniu@o2.pl>
7 years agobrcm63xx: fix invalid Asmax AR 1004g DTS reference
Marcin Jurkowski [Fri, 21 Apr 2017 00:36:18 +0000 (02:36 +0200)]
brcm63xx: fix invalid Asmax AR 1004g DTS reference

Build profile for Asmax AR 1004g refers to an invalid DTS "rg100a". The
correct DTS for this device is "ar1004g".

Signed-off-by: Marcin Jurkowski <marcin1j@gmail.com>
7 years agolantiq: fix avm fritz box mac addresses
Mathias Kresin [Sun, 26 Mar 2017 08:53:35 +0000 (10:53 +0200)]
lantiq: fix avm fritz box mac addresses

It has been shown that the Fritz boxes have the correct mac address set
in the wireless calibration data/eeeprom. Use this mac address as base
for the ethernet and xdsl interface increment/decrement the address to
match the values stored in the tffs.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years agoramips: enable ramdisk for mt7621
Paul Spooren [Wed, 3 May 2017 22:47:34 +0000 (00:47 +0200)]
ramips: enable ramdisk for mt7621

Fixes #758

Signed-off-by: Paul Spooren <paul@spooren.de>
7 years agoipq806x: fix EA8500 switch configuration
Jo-Philipp Wich [Wed, 3 May 2017 11:59:55 +0000 (13:59 +0200)]
ipq806x: fix EA8500 switch configuration

Do not assign the CPU port twice, this confuses LuCI and possible other
programs relying on topology information in board.json.

Ref: https://github.com/openwrt/luci/issues/1086

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agobase-files: implement ucidef_set_hostname(), ucidef_set_ntpserver()
Jo-Philipp Wich [Wed, 3 May 2017 11:32:33 +0000 (13:32 +0200)]
base-files: implement ucidef_set_hostname(), ucidef_set_ntpserver()

Commit 2036ae4 (base-files: support hostname and ntp servers through board.d)
was supposed to implement these procedures but lacked the required changes
to uci-defaults.sh.

Add the missing procedures now to fix config generation on targets relying
on hostname or NTP server presetting.

Fixes FS#754.

Reported-by: Cristian Morales Vega <cristian@samknows.com>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agomac80211: rt2800: fix mt7620 E2 channel registers
Tomislav Požega [Fri, 14 Apr 2017 18:59:47 +0000 (20:59 +0200)]
mac80211: rt2800: fix mt7620 E2 channel registers

update RF register 47 and 54 values according to vendor driver

Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
[daniel@makrotopia.org: moved changes into a separate patch]

7 years agomac80211: rt2800: fix mt7620 vco calibration registers
Tomislav Požega [Sun, 16 Apr 2017 12:14:42 +0000 (14:14 +0200)]
mac80211: rt2800: fix mt7620 vco calibration registers

Use register values from init LNA function instead of the ones from
restore LNA function. Apply register values based on rx path
configuration.

Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
[daniel@makrotopia.org: moved changes into a separate patch]

7 years agomac80211: rt2x00: fix MT7620 LNA gain and VCO-after-ALC
Daniel Golle [Mon, 17 Apr 2017 19:38:32 +0000 (21:38 +0200)]
mac80211: rt2x00: fix MT7620 LNA gain and VCO-after-ALC

This should fix issues with bad RX as well as AP not coming up and/or
scanning failing.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
7 years agomac80211: rt2x00: import upstream changes and rebase our patches
Daniel Golle [Thu, 30 Mar 2017 16:08:49 +0000 (18:08 +0200)]
mac80211: rt2x00: import upstream changes and rebase our patches

Some of our local patches have been accepted upstream. And there are
some more relevant changes (mostly for rt2800usb). Import them and
rebase our remaining local patches on top.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
7 years agort2x00: mt7620: make fixes requested upstream
Daniel Golle [Sat, 11 Mar 2017 13:10:16 +0000 (14:10 +0100)]
rt2x00: mt7620: make fixes requested upstream

Introduce RT6352 instead of matching against RF7620.
Clean up channel setting rfvals.
Port bandwidth filter calibration.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
7 years agort2x00: mt7620: yet another beauty session
Daniel Golle [Mon, 13 Feb 2017 05:25:35 +0000 (06:25 +0100)]
rt2x00: mt7620: yet another beauty session

So here is another round of improvements for MT7620 WiFi.

This commit fixes a few significant issues related to TX_PWR_CFG_x and
TX_ALC and also makes the code more readable by adding register
descriptions for things added for MT7620 and use the usual bit-field
access macros and the now defined macros instead of plain bit-ops and
magic numbers.

Properly describe EEPROM_TARGET_POWER at word 0x68 (== byte 0xD0) and
thereby fix internal TXALC which would otherwise just read
out-of-bounds of the EEPROM map.

Split-out tx-power/ALC related stuff into an additional function.
Fix VCO calibration, it was carried out properly in the channel
switching but incomplete in the actual VCO calibration function.
Also there is no need to trigger VCO calibration in channel switching,
the VCO calibration function is already being called at this point.
Remove it from channel switching function to avoid redundant code.

The TX power calibration differs significantly from all other
Mediatek/Ralink chips: They finally allow 0.5dB steps stored as 8-bit
values for (almost) each bitrate -- and promptly ran out of space and
for some reason didn't want to change the EEPROM layout. The hence
opted for a scheme of sharing values for some adjecent bitrates and
a highly over-complicated (or obfuscated?) way to populate the
TX_PWR_CFG_x registers with the values stored in the EEPROM.
The code here now looks much less complicated than what you see in the
vendor's driver, however, it does the exact same thing:
bGpwrdeltaMinus is a constant and always TRUE, hence half of the
code was dead. Gpwrdelta is always 0 (rather than using the value read
from the EEPROM). What remains is some very grotesque effort to avoid
0x20, probably some hardware bug related to some misunderstanding of
what a singed 8-bit value is (imagine: if it was a signed 6-bit value
then someone could believe that 0x20 == 0x0). And then they didn't
clean it up once they later on anandonned that whole story of having a
constant offset for 40 MHz channels and just set the offset to be
constant 0 -- there is no effort for avoiding 0x20 for the 20 MHz
values stored in the EEPROM, hence that's probably just a forbidden
value in the EEPROM specs and won't appear anyway...
Anyway, the whole thing felt like solving some college math test
where in the end everything cancels out and the result equals 0 ;)
To make sure that channel bandwidth power compensation really doesn't
need to be taken care of, output a warning when the corresponding
value stored in the EEPROM is non-zero.

Also there is no apparent reason to refrain from initializing RFCSR
register 13, it doesn't fail what-so-ever.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
7 years agomac80211: add rt2x00 debug symbols to PKG_CONFIG_DEPENDS
Jonas Gorski [Wed, 12 Apr 2017 10:44:12 +0000 (12:44 +0200)]
mac80211: add rt2x00 debug symbols to PKG_CONFIG_DEPENDS

Chaning these symbols require a recompilation of the modules, so make the
system aware of it.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
7 years agoath9k: fix power limits on init
Felix Fietkau [Wed, 22 Mar 2017 19:46:14 +0000 (20:46 +0100)]
ath9k: fix power limits on init

The tx power applied by set_txpower is limited by the CTL (conformance
test limit) entries in the EEPROM. These can change based on the user
configured regulatory domain.
Depending on the EEPROM data this can cause the tx power to become too
limited, if the original regdomain CTLs impose lowr limits than the CTLs
of the user configured regdomain.

To fix this issue, set the initial channel limits without any CTL
restrictions and only apply the CTL at run time when setting the channel
and the real tx power.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years agoath: do not apply broken power limits with ATH_USER_REGD
Felix Fietkau [Wed, 22 Mar 2017 19:24:32 +0000 (20:24 +0100)]
ath: do not apply broken power limits with ATH_USER_REGD

If a device uses the default EEPROM code, typically only the main CTLs
are valid, and they do not apply properly when switching to a different
regulatory domain. If the regdomain deviates from the EEPROM one, force
the world roaming regdomain to ensure that power limits are sane

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years agoodhcpd: update to version 2017-04-28 (FS#595)
Hans Dedecker [Fri, 28 Apr 2017 19:45:10 +0000 (21:45 +0200)]
odhcpd: update to version 2017-04-28 (FS#595)

9268ca6 ndp: don't trigger IPv6 ping when neighbor entry is invalid
2b3355f ndp: fix adding proxy neighbor entries
7dff5b4 ndp: fix wrong interface name in syslog message
a54afb5 dhcpv6-ia: Fix segfault when writing DHCPv4 leases in state file
c0e9dbf ubus: don't segfault when there're no leases

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
7 years agoodhcpd: update to version 2017-04-21
Hans Dedecker [Mon, 24 Apr 2017 16:39:59 +0000 (18:39 +0200)]
odhcpd: update to version 2017-04-21

570069d ubus: rework dumping IPv6 and IPv4 leases
4e579c4 dhcpv6-ia: simplify logic to write statefile and dhcpv6 logging

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
7 years agobuild: fix symlinked .config handling
Sergey Ryazanov [Thu, 20 Apr 2017 02:10:45 +0000 (05:10 +0300)]
build: fix symlinked .config handling

When running "make menuconfig" with symlinked .config (e.g. to
env/.config) it renames symlink to .config.old, creates new .config file
and writes updated configuration here.

This breaks the desired workflow when changes in the configuration could
be checked using "scripts/env diff" and commited with
"scripts/env save". Since the env/.config file is not updated.

Fix this issue by exporting KCONFIG_OVERWRITECONFIG=1, which forces
mconf to overwrite the .config content, instead of renaming it and
creating a new file. This variable is set only if .config is a symlink,
otherwise the variable is not exported and the old behaviour is
preserved.

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
7 years agoramips: WN3000RPv3: do not setup switch
Thibaut VARENE [Sun, 12 Feb 2017 16:11:08 +0000 (17:11 +0100)]
ramips: WN3000RPv3: do not setup switch

The WN3000RPv3 is a repeater with a single ethernet port. Setting up the
switch, even to disable it, is unnecessary and possibly confusing.

Configure LAN as eth0 instead.

Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
7 years agobrcm63xx: Add Observa VH4032N support
Daniel Gonzalez Cabanelas [Sat, 3 Dec 2016 14:51:05 +0000 (15:51 +0100)]
brcm63xx: Add Observa VH4032N support

Add support for the Observa Telecom VH4032N router.

This is another BCM6368 router, 128 MB RAM, 32MB flash and 3 USB
host ports.

The wifi chip is an onboard Broadcom BCM43222.

Signed-off-by: Daniel Gonzalez Cabanelas <dgcbueu@gmail.com>
[jonas.gorski: use gpio-hog instead of abusing ephy-reset]
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
7 years agocns3xxx: use proper macro's for ID handling
Koen Vandeputte [Mon, 6 Feb 2017 11:11:39 +0000 (12:11 +0100)]
cns3xxx: use proper macro's for ID handling

Compiled & tested on cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
7 years agoramips: add support for Sanlinking D240
Kristian Evensen [Sat, 4 Feb 2017 20:28:52 +0000 (21:28 +0100)]
ramips: add support for Sanlinking D240

The Sanlinking Technologies D240
(http://www.sanlinking.com/en/29-dual-4g-wifi-router.html) is basically the same
device as the ZBT WE826, so adding support for it in LEDE is straight forward.
The differences is that the D240 has two mini-PCIe slots (instead of one), blue
LEDs and supports PoE.

Specification:
* CPU: MT7620A
* 1x 10/100Mbps POE (802.3af/802.3at) Ethernet, 4x 10/100Mbps.
* 16 MB Flash.
* 128 MB RAM.
* 1x USB 2.0 port.
* 2x mini-PCIe slots.
* 2x SIM slots.
* 1x 2.4Ghz WIFI.
* 1x button.

Wifi, USB, switch and both mini-PCIe slots are working. I have not been able to
test the SD card reader.

The device comes pre-installed with an older version of OpenWRT, including Luci.
In order to install LEDE, you need to follow the existing procedure for updating
OpenWRT/LEDE using Luci. I.e., you need to access the UI and update the firmware
using the sysupgrade-image. Remember to select that you do not want to keep
existing settings. The default router address is 192.168.10.1 and
username/password admin/root (at least on my devices).

If you brick the device, the procedure for recovery is the same as for the
WE826. Please see the wiki page for that device for instructions.

Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
7 years agoar71xx: select ATH79_NVRAM only by boards actually use it
Piotr Dymacz [Fri, 27 Jan 2017 14:50:35 +0000 (15:50 +0100)]
ar71xx: select ATH79_NVRAM only by boards actually use it

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years agoramips: fix Sercomm NA930 compatible string
Mathias Kresin [Thu, 2 Feb 2017 21:35:59 +0000 (22:35 +0100)]
ramips: fix Sercomm NA930 compatible string

The Sercomm NA930 is not a mt7620a evaluation board and shouldn't use
the eval board compatible string.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years agoramips: remove Planex CS-QR10 sound device tree node
Mathias Kresin [Thu, 2 Feb 2017 21:34:53 +0000 (22:34 +0100)]
ramips: remove Planex CS-QR10 sound device tree node

The comptible string is neither added by any LEDE patch nor exists in
in the kernel. Drop the sound node which was obviously added
accidentally with 9195d8da ("ramips: DTS rework").

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years agoramips: cleanup SPI flash device tree properties usage
Mathias Kresin [Thu, 2 Feb 2017 21:11:23 +0000 (22:11 +0100)]
ramips: cleanup SPI flash device tree properties usage

Use only the jedec,spi-nor compatible string. Everything else either
never worked or is only support to keep compatibility.

Remove the linux,modalias property. It is obsolete since kernel 4.4.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years agoramips: remove DT pcie nodes for GL-MT300A/N
Felix Fietkau [Wed, 1 Feb 2017 12:53:57 +0000 (13:53 +0100)]
ramips: remove DT pcie nodes for GL-MT300A/N

These devices don't have a secondary wifi chip

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years agorpcd: Explicitly link with lcrypt
Florian Fainelli [Sun, 1 Jan 2017 00:13:34 +0000 (16:13 -0800)]
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 agoramips: ZyXEL Keenetic Omni/Omni2: export gpio usb power
Vitaly Chekryzhev [Fri, 20 Jan 2017 13:03:15 +0000 (18:03 +0500)]
ramips: ZyXEL Keenetic Omni/Omni2: export gpio usb power

Export gpio usb to allow power management of USB port.

Signed-off-by: Vitaly Chekryzhev <13hakta@gmail.com>
7 years agoramips: ZyXEL Keenetic Viva: align factory images
Vitaly Chekryzhev [Fri, 20 Jan 2017 12:57:11 +0000 (17:57 +0500)]
ramips: ZyXEL Keenetic Viva: align factory images

ZyXEL web-flasher requires squashfs to be aligned to 64kb.

Signed-off-by: Vitaly Chekryzhev <13hakta@gmail.com>
7 years agoramips: ZyXEL Keenetic Viva: export gpio usb power
Vitaly Chekryzhev [Tue, 3 Jan 2017 18:18:55 +0000 (23:18 +0500)]
ramips: ZyXEL Keenetic Viva: export gpio usb power

Export gpio usb to allow power management of USB port.

Signed-off-by: Vitaly Chekryzhev <13hakta@gmail.com>
7 years agoramips: add ip17xx support to WLI-TX4-AG300N
Yo Abe [Thu, 26 Jan 2017 13:28:09 +0000 (22:28 +0900)]
ramips: add ip17xx support to WLI-TX4-AG300N

ramips/rt288x WLI-TX4-AG300N was missing support for its 100Mbit switch which
should be included by default.

Signed-off-by: Yo Abe <abe.geel@gmail.com>
[Jo-Philipp Wich: picked from OpenWrt PR#359, rewrap commit msg, fix Sob]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agoramips: fix EX2700 wireless mac
Joseph C. Lehner [Wed, 25 Jan 2017 16:57:56 +0000 (17:57 +0100)]
ramips: fix EX2700 wireless mac

On some EX2700 devices, the MAC address from the eeprom data differs
from the actual MAC address. Fix that, and cleanup the DTS file
while we're at it.

Signed-off-by: Joseph C. Lehner <joseph.c.lehner@gmail.com>
7 years agoramips: ZyXEL Keenetic series update wan mac
Vitaly Chekryzhev [Thu, 5 Jan 2017 11:25:59 +0000 (16:25 +0500)]
ramips: ZyXEL Keenetic series update wan mac

Signed-off-by: Vitaly Chekryzhev <13hakta@gmail.com>
7 years agoramips: ZyXEL Keenetic Omni align factory images
Vitaly Chekryzhev [Thu, 5 Jan 2017 11:23:07 +0000 (16:23 +0500)]
ramips: ZyXEL Keenetic Omni align factory images

ZyXEL web-flasher requires squashfs to be aligned to 64kb.

Signed-off-by: Vitaly Chekryzhev <13hakta@gmail.com>
7 years agoramips: correct keenetic-series switch index
Vitaly Chekryzhev [Sun, 1 Jan 2017 21:46:33 +0000 (02:46 +0500)]
ramips: correct keenetic-series switch index

Fix switch name typo

Signed-off-by: Vitaly Chekryzhev <13hakta@gmail.com>
7 years agoramips: add support for Netgear WN3000RPv3
Thibaut VARENE [Wed, 18 Jan 2017 10:34:56 +0000 (11:34 +0100)]
ramips: add support for Netgear WN3000RPv3

This patch adds support for the Netgear WN3000RPv3
http://www.netgear.com/support/product/wn3000rpv3.aspx

Specifications:
- SoC: MediaTek MT7620A (580MHz, ramips)
- RAM: 32MB DDR
- Storage: 8MB NOR SPI flash
- Wireless: builtin MT7620A, 2x2:2 with u.FL connectors
- Ethernet: 1x100M
- Serial: JP1 header, 57600-8N1
- Stock firmware based on OpenWRT Kamikaze

Like the EX2700, the bootloader expects a secondary image signature,
see https://forum.openwrt.org/viewtopic.php?pid=312577#p312577
This is why the same fakeroot image is used for the WN3000

Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
7 years agoramips: fix mac address of miwifi-mini
BangLang Huang [Wed, 18 Jan 2017 09:45:48 +0000 (17:45 +0800)]
ramips: fix mac address of miwifi-mini

For the miwifi-mini, the offset of ethernet mac should be 0x28
which you can easyily dump from 'Factory' partition.

Signed-off-by: BangLang Huang <banglang.huang@foxmail.com>
7 years agofeeds: add option to force feed update despite modified files
Jo-Philipp Wich [Tue, 14 Feb 2017 17:35:57 +0000 (18:35 +0100)]
feeds: add option to force feed update despite modified files

Implement a new flag "-f" for the feeds update command which causes the
script to fall back to a more agressive git update strategy in case there
are locally modified files in the feeds directory.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agoramips: Clean duplicated status property for Omega2 WMAC in dtsi
Furong Xu [Tue, 14 Feb 2017 09:25:08 +0000 (17:25 +0800)]
ramips: Clean duplicated status property for Omega2 WMAC in dtsi

At the tail of dtsi, wmac is enabled twice, clean the first one

Signed-off-by: Furong Xu <xfr@outlook.com>
7 years agoramips: fixed sms led polarity into dwr-512 DT
Giuseppe Lippolis [Mon, 13 Feb 2017 10:36:41 +0000 (11:36 +0100)]
ramips: fixed sms led polarity into dwr-512 DT

Signed-off-by: Giuseppe Lippolis <giu.lippolis@gmail.com>
7 years agoramips: WN3000RPv3: do not setup switch
Thibaut VARENE [Sun, 12 Feb 2017 16:11:08 +0000 (17:11 +0100)]
ramips: WN3000RPv3: do not setup switch

The WN3000RPv3 is a repeater with a single ethernet port. Setting up the
switch, even to disable it, is unnecessary and possibly confusing.

Configure LAN as eth0 instead.

Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
7 years agobusybox: revert accidential version bump
Jo-Philipp Wich [Thu, 27 Apr 2017 13:38:48 +0000 (15:38 +0200)]
busybox: revert accidential version bump

Due to an oversight during patch conflict resolution, the PKG_VERSION got
accidentially bumped instead of the PKG_RELEASE field.

Revert the bad version change as there exists no upstream 1.25.2 version.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agobusybox: nslookup_lede: mimic output format of old Busybox applet
Jo-Philipp Wich [Tue, 25 Apr 2017 12:21:08 +0000 (14:21 +0200)]
busybox: nslookup_lede: mimic output format of old Busybox applet

When invoking "nslookup_lede" with a domain argument and without explicit
query type, issue both A and AAAA queries and display the resulting IP
addresses in a numbered list style, similar to how the old BusyBox nslookup
used to output the records.

This is required for compatibility with certain scripts.

Ref: https://forum.lede-project.org/t/nslookup-ipv6-in-lede-17-01-1

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agobusybox: nslookup_lede: fix compatibility with v1.25
Jo-Philipp Wich [Tue, 25 Apr 2017 12:03:11 +0000 (14:03 +0200)]
busybox: nslookup_lede: fix compatibility with v1.25

The ":*" optstring syntax was only recently introduced with BusyBox v1.26,
older versions need a corresponding hint in the "opt_complementary" variable
to denote flag values that should be stored as llist entries.

Add the required opt_complementary entry to fix random SIGBUS, SIGILL or
SIGSEGV related crashes on BusyBox 1.25.x when attempting to use the "-q"
flag of the "nslookup_lede" applet.

Ref: https://forum.lede-project.org/t/nslookup-ipv6-in-lede-17-01-1

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agox86: enable 4G high memory support for generic (32bit) subtarget
Jo-Philipp Wich [Thu, 27 Apr 2017 13:26:48 +0000 (15:26 +0200)]
x86: enable 4G high memory support for generic (32bit) subtarget

This is required to fully support a number of 32bit x86 systems equipped
with more than one GB ram, e.g. certain Atom CPU machines.

Ref: https://forum.lede-project.org/t/17-01-1-x86-doesnt-detect-all-of-the-ram/3295

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agogeneric: keep module aliases inside .modinfo
Yousong Zhou [Wed, 11 Jan 2017 11:57:24 +0000 (19:57 +0800)]
generic: keep module aliases inside .modinfo

It seems module aliases are actually essential info.  E.g. other modules
may call xt_request_find_match(NFPROTO_IPV{4,6}, "hashlimit", 1) and the
kernel will request user mode modprobe helper for ipt_hashlimit and
ip6t_hashlimit respectively which are aliases of xt_hashlimit.ko

Compile-tested for armvirt, there is nearly no size impact.

Before

    -rw-r--r-- 1 yousong yousong     304 Jan 10 17:37 config.seed
    -rw-r--r-- 1 yousong yousong    1634 Jan 11 11:07 lede-armvirt-default.manifest
    -rw-r--r-- 1 yousong yousong 1533647 Jan 11 11:07 lede-armvirt-default-rootfs.tar.gz
    -rw-r--r-- 1 yousong yousong 1802711 Jan 11 11:07 lede-armvirt-root.ext4.gz
    -rw-r--r-- 1 yousong yousong 1544597 Jan 11 11:07 lede-armvirt-rootfs.cpio.gz
    -rw-r--r-- 1 yousong yousong 1174984 Jan 11 11:07 lede-armvirt-root.squashfs.gz
    -rwxr-xr-x 1 yousong yousong 1654712 Jan 11 11:07 lede-armvirt-zImage
    -rwxr-xr-x 1 yousong yousong 2738296 Jan 11 11:07 lede-armvirt-zImage-initramfs
    drwxr-xr-x 2 yousong yousong    4096 Jan 10 17:35 packages
    -rw-r--r-- 1 yousong yousong     739 Jan 10 17:37 sha256sums

After

    -rw-r--r-- 1 yousong yousong     304 Jan 10 17:37 config.seed
    -rw-r--r-- 1 yousong yousong    1634 Jan 11 11:10 lede-armvirt-default.manifest
    -rw-r--r-- 1 yousong yousong 1533646 Jan 11 11:10 lede-armvirt-default-rootfs.tar.gz
    -rw-r--r-- 1 yousong yousong 1802711 Jan 11 11:10 lede-armvirt-root.ext4.gz
    -rw-r--r-- 1 yousong yousong 1544593 Jan 11 11:10 lede-armvirt-rootfs.cpio.gz
    -rw-r--r-- 1 yousong yousong 1174984 Jan 11 11:10 lede-armvirt-root.squashfs.gz
    -rwxr-xr-x 1 yousong yousong 1654736 Jan 11 11:10 lede-armvirt-zImage
    -rwxr-xr-x 1 yousong yousong 2738144 Jan 11 11:10 lede-armvirt-zImage-initramfs
    drwxr-xr-x 2 yousong yousong    4096 Jan 10 17:35 packages
    -rw-r--r-- 1 yousong yousong     739 Jan 10 17:37 sha256sums

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
7 years agoubox: bump to version 2017-03-10
Yousong Zhou [Tue, 25 Apr 2017 12:26:38 +0000 (20:26 +0800)]
ubox: bump to version 2017-03-10

Fixes FS#684 with commit 21a4bd0

Changes since current version.  All changes except the ones prefixed
with asterisks are for bugfixes.  Module aliases awareness is expected
by the kernel to be a basic facility and is required for properly
initializing wireguard.

    16f7e16 syslog: remove unnecessary sizeof struct between messages
    21a4bd0 kmodloader: modprobe: return 0 for loaded modules
    3dc78a4 kmodloader: don't store aliases info in struct module
    c553354 cmake: fix typo
    8973576 kmodloader: fix not being able to find some modules
    fce9382 cmake: Check for getrandom system call
    ac2d43e kmodloader: support '-q' quiet option
   *f8d3d16 ubox: Add an option for more accurate timestamps in log
    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 variabled
    db070f1 ubox: Fix some memory leaks
    acc48b5 kmodloader: Fix typo in error message

Size comparison on x86_64 host

    function                                             old     new   delta
    main                                                2190    2344    +154
    scan_module_folder                                   665     793    +128
    alloc_module_node                                      -     113    +113
    .rodata                                              946    1036     +90
    alloc_module                                         202     245     +43
    free_modules                                          77     119     +42
    load_modprobe                                        209     237     +28
    scan_loaded_modules                                  241     265     +24
    avl_modcmp                                            45      67     +22
    insert_module                                        204     224     +20
    find_module                                           13      30     +17
    static.optind@@GLIBC_2                                 -       4      +4
    static.load_moddeps                                  118     117      -1
    scan_module_folders                                   55      54      -1
    ------------------------------------------------------------------------------
    (add/remove: 2/0 grow/shrink: 10/2 up/down: 685/-2)           Total: 683 bytes

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
7 years agokernel: use skb_cow_head() to deal with cloned skbs
Álvaro Fernández Rojas [Sun, 23 Apr 2017 11:55:03 +0000 (13:55 +0200)]
kernel: use skb_cow_head() to deal with cloned skbs

We need to ensure there is enough headroom to push extra header,
but we also need to check if we are allowed to change headers.

skb_cow_head() is the proper helper to deal with this.

Fixes Ethernet<->WiFi bridge for Raspberry Pi and probably other devices.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
7 years agoar71xx: fix minor syntax error in /lib/upgrade/platform.sh
Matthias Schiffer [Sat, 22 Apr 2017 16:56:25 +0000 (18:56 +0200)]
ar71xx: fix minor syntax error in /lib/upgrade/platform.sh

Fix a '==' that should be a '=' in a test condition. Busybox fortunately
doesn't care.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
7 years agoramips: update DEVICE_PACKAGES for Ubiquiti EdgeRouter X
Matthias Schiffer [Sat, 22 Apr 2017 16:54:07 +0000 (18:54 +0200)]
ramips: update DEVICE_PACKAGES for Ubiquiti EdgeRouter X

Fixes removal of unneeded kernel modules with per-device rootfs.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
7 years agoopenssl: Use mkhash for STAMP_CONFIGURED
Florian Fainelli [Wed, 1 Mar 2017 18:48:32 +0000 (10:48 -0800)]
openssl: Use mkhash for STAMP_CONFIGURED

The current way of creating a STAMP_CONFIGURED filename for OpenSSL can
lead to an extremely long filename that makes touch unable to create it,
and fail the build.

Use mkhash to produce a hash against OPENSSL_OPTIONS which creates a
shortert stamp file,

Fixes #572

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
7 years agobusybox: fix build of nslookup_lede applet without IPv6 (#728)
Jo-Philipp Wich [Fri, 21 Apr 2017 11:18:16 +0000 (13:18 +0200)]
busybox: fix build of nslookup_lede applet without IPv6 (#728)

Protect any IPv6 related with appropriate guards to fix compilation with
disabled IPv6 support in Busybox.

Fixes #728.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>