aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/lib/functions
Commit message (Collapse)AuthorAgeFilesLines
* base-files: add ucidef_set_led_usbport for full usbport supportRafał Miłecki2016-10-221-0/+24
| | | | | | | | | | | | | | | | | | | | This helper allows using usbport trigger directly. It requires usbport compatible syntax and supports specifying multiple USB ports, e.g.: ucidef_set_led_usbport "usb" "USB" "devicename:colour:function" "usb1-port1" "usb2-port1" This adds a proper object to the board.json, e.g. "usb": { "name": "USB", "type": "usbport", "sysfs": "devicename:colour:function", "ports": [ "usb1-port1", "usb2-port1" ] } and supports translating it into uci section. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* base-files: board_detect: allow specifying the generated fileJonas Gorski2016-08-131-2/+0
| | | | | | | Allow passing a filename to change the location of the generated board.json. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
* kernel: remove unused morse led trigger driverFelix Fietkau2016-08-041-11/+0
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* base-files: support port_state LED types in board.dJo-Philipp Wich2016-06-081-0/+19
| | | | | | Add support for handling port_state LEDs as used by ADM5120. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* base-files: add function ucidef_set_interface_raw to enable default ↵John Crispin2016-03-101-0/+6
| | | | | | | | configuration on interfaces other than lan and wan. Signed-off-by: Micke Prag <micke.prag@telldus.se> SVN-Revision: 48976
* lantiq: do not set default firmware fileFelix Fietkau2016-03-071-4/+2
| | | | | | | | | We are now shipping a DSL firmware, do not set it by default to some file name. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> SVN-Revision: 48941
* base-files: support passing mode to ucidef_set_led_netdev()Jo-Philipp Wich2016-02-261-0/+2
| | | | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 48806
* base-files: add support for speed mask to switch config init scriptsFelix Fietkau2016-02-251-0/+2
| | | | | | | | | | | This patch adds extra parameter to switch LED trigger initialization functions. New functionality maintains backward compatibility, so calling functions without setting new speed_mask parameter works as expected. Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl> SVN-Revision: 48776
* leds: support oneshot as well as timer triggersJohn Crispin2016-02-251-4/+13
| | | | | | | | | oneshot and timer have the same configuration options, just a different trigger name. Signed-off-by: Karl Palsson <karlp@etactica.com> SVN-Revision: 48770
* base-files: cleanup mtd_get_mac_binary hexdumpFelix Fietkau2015-12-191-1/+1
| | | | | | | | | Remove usage of dd, as per request from Yousong Zhou. <https://lists.openwrt.org/pipermail/openwrt-devel/2015-December/037743.html> Signed-off-by: Chris R Blake <chrisrblake93@gmail.com> SVN-Revision: 47949
* ar71xx: scan nand ubi partition for ath9k eeprom filesFelix Fietkau2015-12-191-0/+17
| | | | | | | | | | The MR18 stores the ath9k eeprom values on the NAND. This patch makes it possible to retrieve the images from there. Signed-off-by: Chris R Blake <chrisrblake93@gmail.com> SVN-Revision: 47948
* all: drop old uci-defaults.shJo-Philipp Wich2015-12-112-864/+519
| | | | | | | | | Replace former uci-defaults.sh implementation with the uci-defaults-new.sh one and update all users accordingly. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 47867
* board.d: add support for gpio_switch sectionsJo-Philipp Wich2015-12-041-0/+15
| | | | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 47762
* base-files: board.d: auto-set model id and name if /tmp/sysinfo is availableJo-Philipp Wich2015-12-041-0/+10
| | | | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 47752
* base-files: board.d: support dsl modems, atm bridges and pppoe protocolJo-Philipp Wich2015-12-041-1/+47
| | | | | | | | | | | This adds support for specifying the dsl modem, atm bridge configs and setting the pppoe protocol for wan. These additions are required to port the Lantiq target to board.d. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 47750
* all: remove dummy ucidef_set_interface_loopback() from board.dJo-Philipp Wich2015-12-031-6/+0
| | | | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 47744
* base-files: board.d: support specifiying the protocol of lan and wanJo-Philipp Wich2015-12-031-10/+26
| | | | | | | | | Some boards, e.g. the Sheeva Plug, require the lan interface to be set to DHCP instead of a static address, therfore support that. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 47732
* base-files: board.d: support timer ledsJo-Philipp Wich2015-12-031-0/+20
| | | | | | | | Add ucidef_set_led_timer() and handling for it to config_generate. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 47731
* base-files: board.d: support ide ledsJo-Philipp Wich2015-12-031-0/+16
| | | | | | | | Add ucidef_set_led_ide() to define "ide-disk" triggered leds. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 47729
* base-files: uci-defaults-new.sh: fix for handling multiple ifnamesJo-Philipp Wich2015-12-031-4/+4
| | | | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 47728
* board.d: merge ucidef_add_switch() and ucidef_add_switch_ports()Jo-Philipp Wich2015-12-031-60/+50
| | | | | | | | | | | | This changes uci-defaults-new.sh, config_generate and all relevant board.d files in order combine ucidef_add_switch() and ucidef_add_switch_ports() into a single function. Also removes now superfluous enable and reset arguments. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 47721
* base-files: uci-defaults-new: remove reset/enable args of ucidef_add_switch()Jo-Philipp Wich2015-12-031-14/+12
| | | | | | | | | | | | | | | Out of 69 switch definitions, only 3 pass something different than "1" as values for reset and enable, with one of those three being invalid. This change ... * removes the reset and enable arguments from ucidef_add_switch() * unconditionally writes reset:1 and enable:1 to JSON * converts the three users of nonstandard values to ucidef_add_switch_attr() Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 47720
* base-files: uci-defaults-new, config_generate: refactor code and drop old vlansJo-Philipp Wich2015-12-031-50/+108
| | | | | | | | | | | | | | | Remove support for now unused ucidef_add_switch_vlan(), move port->vlan and vlan->interfaces conversion to uci-defaults-new.sh and massively simplify config_generate. This change prepares the following upcoming steps: * Eliminate use of ucidef_set_interface_lan_wan() for switch only devices * Merge ucidef_add_switch() with ucidef_add_switch_ports() Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 47719
* base-files: uci-defaults-new, config_generate: allow force tagged cpu portsJo-Philipp Wich2015-11-301-2/+8
| | | | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 47679
* base-files: uci-defaults-new: fix unquoted variablesJo-Philipp Wich2015-11-301-5/+5
| | | | | | | | | | Properly quote variables in ucidef_set_interface_lan() and ucidef_set_interface_lan(), otherwise interfaces with multiple devices are not properly written into the configuration. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 47673
* base-files: uci-defaults-new: add board id and name helpersJo-Philipp Wich2015-11-301-0/+12
| | | | | | | | | Add ucidef_set_board_id() and ucidef_set_model_name() procedures to store model information in the board.json file. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 47671
* base-files: uci-defaults-new, config_generate: support for gpio ledsJo-Philipp Wich2015-11-261-0/+21
| | | | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 47660
* base-files: uci-defaults-new: remove ucidef_set_led_interface()Jo-Philipp Wich2015-11-261-16/+0
| | | | | | | | | The only user was the hg255d board and config_generate did not even emit proper uci for it. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 47658
* base-files: uci-defaults-new: fix storing rssi leds and triggers in board.jsonJo-Philipp Wich2015-11-261-7/+6
| | | | | | | | | Remove extra nesting of rssi leds in the led object and move rssi monitor declaration to its own object. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 47655
* base-files: uci-defaults-new: properly quote variablesJo-Philipp Wich2015-11-261-95/+95
| | | | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 47652
* base-files: uci-defaults-new: add ucidef_add_switch_port_attr() helperJo-Philipp Wich2015-11-251-0/+36
| | | | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 47645
* base-files: uci-defaults-new: whitespace cleanupJo-Philipp Wich2015-11-251-11/+11
| | | | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 47644
* base-files: uci-defaults-new: don't store switch attr numbers as stringsJo-Philipp Wich2015-11-251-3/+6
| | | | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 47643
* base-files: add ucidef_set_interface_wan() and ucidef_add_switch_ports()Jo-Philipp Wich2015-11-241-0/+50
| | | | | | | | | Add further helper functions to uci-defaults-new.sh for easier declarations of complex switch layouts. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 47638
* base-files: fix ramoverlay function with kernels 3.18+Felix Fietkau2015-09-211-4/+5
| | | | | | | | | | | Even though there are not many users left within the OpenWrt tree it seems this function broke during the kernel 3.18 transition. Fix it by providing a workdir as required by overlayfs. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> SVN-Revision: 47015
* base-files: allow setting ide-disk led triggerJonas Gorski2015-09-041-0/+16
| | | | | | Signed-off-by: Jonas Gorski <jogo@openwrt.org> SVN-Revision: 46794
* base-files: added option to configure the gpio led trigger in uci-defaultsJohn Crispin2015-07-141-0/+20
| | | | | | Signed-off-by: Günther Kelleter <guenther.kelleter@devolo.de> SVN-Revision: 46341
* base-files: implemented basic GPIO controlJohn Crispin2015-07-081-0/+24
| | | | | | | | | | Internal GPIO pins are used for PoE passthrough setups in multi-port routers. This patch implemnets control over this hardware feature for Ubiquiti Nanostations and TP-Link CPE510. Signed-off-by: Lars Kruse <lists@sumpfralle.de> SVN-Revision: 46271
* uci-defaults: add ucidef_set_led_mmcJohn Crispin2015-02-141-0/+17
| | | | | | Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> SVN-Revision: 44446
* base-files: Use 200ms LED timing as before for the new phase preinit_regular.John Crispin2015-01-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This restores normal pre-r43715 200ms blink-period for the System LED we're all accustomed to see while our OpenWrt routers are booting. Failsafe possibility will now be signalled with a new 100ms blinking, which is easily recognizable from the normal 200ms booting. So no existing user will be scared by a new 500ms LED pattern, since such a slow pattern could easily be mistaken for something wrong... I was like "ok why my router is collapsing now, is this a bad flash, a kernel panic, or what else" when I've seen it for the first time ;) Sorry for not having explained myself better in v1 of this patch. Original: Preinit, failsafe is possible: 200ms Preinit, failsafe not possible anymore, booting normally: 200ms Failsafe entered: 50ms Now (after preinit_regular has been introduced): Preinit, failsafe is possible: 200ms Preinit, failsafe not possible anymore, booting normally: 500ms *here is the "offending" change* Failsafe entered: 50ms With my proposed patch: Preinit, failsafe is possible: 100ms *indicate this condition with a new timing, that prompts the user to press the key if they want to start failsafe* Preinit, failsafe not possible anymore, booting normally: 200ms *keep this as before* Failsafe entered: 50ms Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net> SVN-Revision: 44056
* base-files: Add ucidef_set_led_timer to uci-defaults.shJohn Crispin2015-01-171-0/+20
| | | | | | Signed-off-by: Gerald Kerma <dreagle@doukki.net> SVN-Revision: 44000
* base-files: Fix switch settings for uci-defaults-new.sh.John Crispin2015-01-081-2/+2
| | | | | | | | The enable and reset settings need to be added even when they're false. This is true at least for 'enable', that seems to default to true otherwise. Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net> SVN-Revision: 43887
* add "preinit_regular" diag.sh set_state argumentJohn Crispin2014-12-151-0/+4
| | | | | | | | | | | | This new argument is used right after starting regular preinit (which happens if failsafe wasn't triggered). The main purpose of "preinit" argument is to indicate that failsafe can be triggered, however we were missing a way to inform user that we don't wait for a trigger anymore. With this change it's clear when failsafe mode can be triggered. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 43715
* scripts: fix wrong usage of '==' operatorJohn Crispin2014-10-142-2/+2
| | | | | | | | | | | | | | [base-files] shell-scripting: fix wrong usage of '==' operator normally the '==' is used for invoking a regex parser and is a bashism. all of the fixes just want to compare a string. the used busybox-ash will silently "ignore" this mistake, but make it portable/clean at least. this patch does not change the behavior/logic of the scripts. Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com> SVN-Revision: 42911
* base-files: add network_get_ipaddrs_all()Steven Barth2014-10-091-0/+23
| | | | | | | | Return all IPv4 and IPv6 addresses. Signed-off-by: Mathias Kresin <openwrt@kresin.me> SVN-Revision: 42856
* network: Unbind DHCPv6 from underlying interfacesSteven Barth2014-10-081-1/+1
| | | | | | | | | This allows IPv6 to set up without IPv4 being up thus IPv6-only or IPv6+DS-Lite working with the default config. Signed-off-by: Steven Barth <steven@midlink.org> SVN-Revision: 42848
* base-files: add a protocol argument to ucidef_set_interface_rawFlorian Fainelli2014-09-251-1/+2
| | | | | | | | | Add a third argument to ucidef_set_interface_raw, which is specifying the protocol. Signed-off-by: Florian Fainelli <florian@openwrt.org> SVN-Revision: 42665
* base-files: whitespace fixesLuka Perkov2014-09-142-6/+6
| | | | | | Signed-off-by: Luka Perkov <luka@openwrt.org> SVN-Revision: 42542
* base-files: add a hardware detection layerJohn Crispin2014-08-181-0/+302
| | | | | | | | | | this allows targets to use the new uci-default helper which will generate a file called /etc/board.json. a tool called /bin/config_generate can then be used to generate the default uci settings. Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 42185
* base-files: /lib/functions/network.sh: fix network_get_ipaddr6Jo-Philipp Wich2014-08-111-1/+12
| | | | | | | | | | | | When looking for the first ipaddr also consider the current prefix just like network_get_ipaddrs6 does. If ipv6-address was empty the function did not return the first ipaddr even if the list was non-empty. fixes commit 83e9122f88a002871d5cdf421cf6aa6052b7e006 Signed-off-by: Henning Schild <henning@hennsch.de> SVN-Revision: 42139