aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/lib/functions
Commit message (Collapse)AuthorAgeFilesLines
* 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> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47671 3c298f89-4303-0410-b956-a3cf2f4a3e73
* 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> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47660 3c298f89-4303-0410-b956-a3cf2f4a3e73
* 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> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47658 3c298f89-4303-0410-b956-a3cf2f4a3e73
* 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> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47655 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: uci-defaults-new: properly quote variablesJo-Philipp Wich2015-11-261-95/+95
| | | | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47652 3c298f89-4303-0410-b956-a3cf2f4a3e73
* 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> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47645 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: uci-defaults-new: whitespace cleanupJo-Philipp Wich2015-11-251-11/+11
| | | | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47644 3c298f89-4303-0410-b956-a3cf2f4a3e73
* 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> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47643 3c298f89-4303-0410-b956-a3cf2f4a3e73
* 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> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47638 3c298f89-4303-0410-b956-a3cf2f4a3e73
* 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> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47015 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: allow setting ide-disk led triggerJonas Gorski2015-09-041-0/+16
| | | | | | Signed-off-by: Jonas Gorski <jogo@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@46794 3c298f89-4303-0410-b956-a3cf2f4a3e73
* 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> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@46341 3c298f89-4303-0410-b956-a3cf2f4a3e73
* 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> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@46271 3c298f89-4303-0410-b956-a3cf2f4a3e73
* uci-defaults: add ucidef_set_led_mmcJohn Crispin2015-02-141-0/+17
| | | | | | Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@44446 3c298f89-4303-0410-b956-a3cf2f4a3e73
* 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> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@44056 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: Add ucidef_set_led_timer to uci-defaults.shJohn Crispin2015-01-171-0/+20
| | | | | | Signed-off-by: Gerald Kerma <dreagle@doukki.net> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@44000 3c298f89-4303-0410-b956-a3cf2f4a3e73
* 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> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@43887 3c298f89-4303-0410-b956-a3cf2f4a3e73
* 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> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@43715 3c298f89-4303-0410-b956-a3cf2f4a3e73
* 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> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42911 3c298f89-4303-0410-b956-a3cf2f4a3e73
* 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> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42856 3c298f89-4303-0410-b956-a3cf2f4a3e73
* 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> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42848 3c298f89-4303-0410-b956-a3cf2f4a3e73
* 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> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42665 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: whitespace fixesLuka Perkov2014-09-142-6/+6
| | | | | | Signed-off-by: Luka Perkov <luka@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42542 3c298f89-4303-0410-b956-a3cf2f4a3e73
* 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> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42185 3c298f89-4303-0410-b956-a3cf2f4a3e73
* 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> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42139 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: strip quotes from the MAC address in macaddr_canonicalize()Gabor Juhos2014-07-141-0/+1
| | | | | | | | | Extracted from http://patchwork.openwrt.org/patch/5716/ Signed-off-by: Forest Crossman <cyrozap@gmail.com> Signed-off-by: Gabor Juhos <juhosg@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@41639 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: depend on jsonfilter and rewrite network.sh to use itJo-Philipp Wich2014-06-191-318/+125
| | | | | | | | | | | Switches /lib/functions/network.sh from jshn based json parsing to jsonfilter expression while keeping the existing api. Expensive methods like "network_find_wan" are up to 20x faster now. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@41281 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: remove function service_killJohn Crispin2014-06-021-23/+0
| | | | | | | | Function service_kill is deprecated and has no user, so remove it. Signed-off-by: Zhao, Gang <gamerh2o@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40912 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: enable force_link for lan by defaultFelix Fietkau2014-05-161-0/+1
| | | | | | | | | This allows services to bind to it at boot time instead of waiting for a cable to be plugged in Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40773 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: add back missing function for find_mtd_part to /lib/functions.sh ↵Felix Fietkau2014-04-081-7/+0
| | | | | | | | (fixes #15496) Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40426 3c298f89-4303-0410-b956-a3cf2f4a3e73
* /lib/functions.sh: move rarely used mtd and macaddr related functions to ↵Felix Fietkau2014-04-071-0/+118
| | | | | | | | /lib/functions/system.sh Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40411 3c298f89-4303-0410-b956-a3cf2f4a3e73
* /lib/functions.sh: move preinit related functions to /lib/functions/preinit.shFelix Fietkau2014-04-071-0/+87
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40404 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] base-files: add ucidef_add_switch_port functionLuka Perkov2014-01-231-0/+10
| | | | | | Signed-off-by: Luka Perkov <luka@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39372 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: add network_get_protocol() to /lib/functions/network.shJo-Philipp Wich2013-12-161-2/+7
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39099 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] base-files: fix whitespacesLuka Perkov2013-12-092-30/+27
| | | | | | Signed-off-by: Luka Perkov <luka@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39006 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: reject invalid uci keys in network_get_device() and related ↵Jo-Philipp Wich2013-07-151-0/+4
| | | | | | procedures (#13886) git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37345 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: network.sh: extend network_get_ipaddr6() / network_get_subnet6() ↵Jo-Philipp Wich2013-06-171-43/+107
| | | | | | to take ipv6-prefix-assignment into account, add further helper functions to fetch all ips of a given interface git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36942 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: change network_find_wan() procedure to ignore default gateways ↵Jo-Philipp Wich2013-05-061-10/+14
| | | | | | in different routing tables git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36553 3c298f89-4303-0410-b956-a3cf2f4a3e73
* Change default IPv6 config to enable DHCPv6-PDSteven Barth2013-04-221-1/+1
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36384 3c298f89-4303-0410-b956-a3cf2f4a3e73
* Adapt default network configuration for IPv6Steven Barth2013-04-091-0/+6
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36278 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: introduce commonly used helper functions for setting ledsGabor Juhos2013-02-181-0/+68
| | | | | | | | | | | | | | | | | | Currently, most platforms define such helpers in their own diag.sh implementation with almost identical code. By factoring out the common ground it's possible to simplify maintainability and homogenize the haptics over multiple platforms (so far as is reasonably practicable, in a next step). [juhosg: - fix led_set_attr parameters in led_timer - add led_morse and status_led_set_morse helpers - add status_led_blink_{preinit,failsafe} helpers] Signed-off-by: Michael Heimpold <mhei@heimpold.de> Signed-off-by: Gabor Juhos <juhosg@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35648 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: fix network_get_prefix6Steven Barth2013-01-221-1/+1
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35300 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: network.sh: fix typo in previous commitJo-Philipp Wich2013-01-211-1/+1
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35287 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: network.sh: simplify network_get_prefix6()Jo-Philipp Wich2013-01-211-7/+4
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35286 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: add support for ipv6-prefixes in connection with netifdSteven Barth2013-01-151-0/+30
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35168 3c298f89-4303-0410-b956-a3cf2f4a3e73
* merge /lib/functions/boot.sh and /lib/functions.shMirko Vogt2012-12-191-146/+0
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34794 3c298f89-4303-0410-b956-a3cf2f4a3e73
* Do not overload mount-call - trying to reduce confusionMirko Vogt2012-12-191-15/+11
| | | | | | | | | | | The behaviour of calling 'mount' differed depending on whether it called the busybox-mount, the mount of util-linux, the mount defined in /lib/functions.sh and /lib/functions/boot.sh /etc/preinit even included /lib/functions.sh and /lib/functions/boot.sh, both re-defining 'mount'. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34792 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: use json_is_a() in network.shJo-Philipp Wich2012-12-171-7/+7
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34733 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: rework cache handling in network.sh to keep the entire parsed ↵Jo-Philipp Wich2012-12-161-129/+159
| | | | | | ifstatus, use jshn namespaces to support using it concurrently with other jshn users git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34725 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: various enhancements to network.shJo-Philipp Wich2012-12-161-30/+153
| | | | | | | | | | | - support reading inactive gateways and DNS information in network_get_gateway(), network_get_dnsserver() and network_get_dnssearch() by passing "true" as optional last argument - internally cache fetched values to speed up subsequent accesses to the same data, introduce network_flush_cache() to clear them - add some inline function documentation git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34722 3c298f89-4303-0410-b956-a3cf2f4a3e73