aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/lib/functions.sh
Commit message (Collapse)AuthorAgeFilesLines
* base-files: define yes/no as valid boolean optionsLuka Perkov2014-06-291-2/+2
| | | | | | | | | ubox validate_data defines yes/no as valid boolean options, do the same in config_get_bool too. Signed-off-by: Luka Perkov <luka@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@41405 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: add back missing function for find_mtd_part to /lib/functions.sh ↵Felix Fietkau2014-04-081-0/+7
| | | | | | | | (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: remove config_rename()Felix Fietkau2014-04-071-18/+0
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40412 3c298f89-4303-0410-b956-a3cf2f4a3e73
* /lib/functions.sh: move rarely used mtd and macaddr related functions to ↵Felix Fietkau2014-04-071-137/+0
| | | | | | | | /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: remove jffs2_mark_erase()Felix Fietkau2014-04-071-9/+0
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40410 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: remove config_clear() and list_remove()Felix Fietkau2014-04-071-28/+0
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40409 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: move uci_apply_defaults() to /etc/init.d/bootFelix Fietkau2014-04-071-11/+0
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40408 3c298f89-4303-0410-b956-a3cf2f4a3e73
* /lib/functions.sh: remove hotplug_dev()Felix Fietkau2014-04-071-4/+0
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40406 3c298f89-4303-0410-b956-a3cf2f4a3e73
* /lib/functions.sh: remove strtok()Felix Fietkau2014-04-071-26/+0
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40405 3c298f89-4303-0410-b956-a3cf2f4a3e73
* /lib/functions.sh: move preinit related functions to /lib/functions/preinit.shFelix Fietkau2014-04-071-85/+0
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40404 3c298f89-4303-0410-b956-a3cf2f4a3e73
* /lib/functions.sh: remove pi_include()Felix Fietkau2014-04-071-24/+0
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40403 3c298f89-4303-0410-b956-a3cf2f4a3e73
* /lib/functions.sh: remove jffs2_ready()Felix Fietkau2014-04-071-7/+0
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40402 3c298f89-4303-0410-b956-a3cf2f4a3e73
* /lib/functions.sh: remove support for non-overlayfs overlay fopivot typesFelix Fietkau2014-04-071-44/+2
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40401 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: fix mount-utils incompatibilityJohn Crispin2013-12-271-11/+11
| | | | | | Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39169 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: allow users to delect debug level during bootJohn Crispin2013-11-251-0/+20
| | | | | | Signed-off-by: John Crispin <blogic@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@38909 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: add macaddr_canonicalize helper functionGabor Juhos2013-11-141-1/+34
| | | | | | | | | | | | | | | | | | | | | | | | In commit r38690, the MAC address canonicalization has been converted to use 'tr' instead of 'printf'. This only works if with MAC addresses which uses the 'xx:xx:xx:xx:xx:xx' format. However on some boards, the MAC addresses are stored in different format in the mtd partition. Some vendors are using hyphens or dots as separators instead of colons. Also the leading zeroes may be missing from the individual octets or those are replaced with spaces. Add a new function which can be used to convert these into the 'xx:xx:xx:xx:xx:xx' format. Also update the 'mtd_get_mac_ascii' function to use the new helper. The helper function is based on this code: http://isquared.nl/blog/2010/08/11/Bash-function-to-canonicalize-MAC-addresses/ Signed-off-by: Gabor Juhos <juhosg@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@38803 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: mtd_get_mac_ascii bugfixGabor Juhos2013-11-081-4/+3
| | | | | | | | | | | | | | | | The mtd_get_mac_ascii utility function was broken. This fixes it. - Remove the superfluous include of /lib/functions.sh. The function is already in that file so it is pointless, - only use a variable if the whole key word matches, - don't try to process the MAC address if it is empty, - use 'tr' to canonicalize the MAC address, Signed-off-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us> [juhosg: add more fixes, update commit message] Signed-off-by: Gabor Juhos <juhosg@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@38690 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: add mtd_get_part_size helperGabor Juhos2013-07-201-0/+12
| | | | | | Signed-off-by: Gabor Juhos <juhosg@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37475 3c298f89-4303-0410-b956-a3cf2f4a3e73
* package: fix insmod on installJohn Crispin2013-06-221-0/+7
| | | | | | | | the procd changes broke the postinst insmod. Signed-off-by: John Crispin <blogic@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37015 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: module loading is now handled by ubox/kmodloaderJohn Crispin2013-06-211-7/+0
| | | | | | Signed-off-by: John Crispin <blogic@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37003 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: minor cosmetic corrections for functions.shGabor Juhos2013-02-171-6/+3
| | | | | | | | | | | | | - update copyright header - remove superfluous shebang left-over from changeset 34794 - unify function declaration [juhosg: keep Vertical Communications' copyright notice] 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@35646 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: add macaddr_{add,2bin,setbit_la} helpersGabor Juhos2013-02-161-0/+24
| | | | | | Signed-off-by: Gabor Juhos <juhosg@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35614 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: add mtd_get_mac_{ascii,binary} helpersGabor Juhos2013-02-161-0/+34
| | | | | | Signed-off-by: Gabor Juhos <juhosg@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35612 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: Fix a typo in config_list_foreachSteven Barth2012-12-271-1/+1
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34893 3c298f89-4303-0410-b956-a3cf2f4a3e73
* merge /lib/functions/boot.sh and /lib/functions.shMirko Vogt2012-12-191-0/+137
| | | | 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-3/+0
| | | | | | | | | | | 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: add mtd_find_chardev helperGabor Juhos2012-12-121-3/+17
| | | | | | Signed-off-by: Gabor Juhos <juhosg@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34648 3c298f89-4303-0410-b956-a3cf2f4a3e73
* Revert "remove function find_mtd_part() from /lib/functions.sh"Mirko Vogt2012-12-121-0/+9
| | | | | | | | | Reverting commit 34641. Function find_mtd_part() is needed by some scripts deployed for certain targets but not including boot.sh after all. Still, all this certainly needs some love. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34642 3c298f89-4303-0410-b956-a3cf2f4a3e73
* remove function find_mtd_part() from /lib/functions.shMirko Vogt2012-12-121-9/+0
| | | | | | | | | Since all scripts using this function include /lib/functions/boot.sh - where this function is defined as well - it can be dropped from /lib/functions.sh. Also avoids further confusion about this function being declared and defined in two different places. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34641 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] base-files: make user_add() populate the shadow db as wellJo-Philipp Wich2012-06-051-0/+1
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@32063 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: rename internal variables in config_foreach to make namespace ↵Felix Fietkau2012-04-211-4/+4
| | | | | | conflicts more unlikely git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31431 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: split service related functions off to /lib/functions/service.shFelix Fietkau2012-03-201-128/+0
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31042 3c298f89-4303-0410-b956-a3cf2f4a3e73
* base-files: remove trailing whitespaces from lib/functions.shGabor Juhos2012-03-021-10/+10
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@30775 3c298f89-4303-0410-b956-a3cf2f4a3e73
* package/base-files: enhance service functionsNicolas Thill2011-11-121-13/+27
| | | | | | | | * allow matching process by name (useful for processes changing it) * check if first argument is executable * fix function name used in error messages git-svn-id: svn://svn.openwrt.org/openwrt/trunk@28991 3c298f89-4303-0410-b956-a3cf2f4a3e73
* package/base-files: /lib/functions.sh: add {group,user}_{add,exists} functionsNicolas Thill2011-11-091-0/+37
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@28871 3c298f89-4303-0410-b956-a3cf2f4a3e73
* package/base-files: /lib/functions.sh: let service_stop exit early if no ↵Nicolas Thill2011-11-081-1/+1
| | | | | | matching process to stop where found git-svn-id: svn://svn.openwrt.org/openwrt/trunk@28870 3c298f89-4303-0410-b956-a3cf2f4a3e73
* package/base-files: enhance & cleanup service wrappersNicolas Thill2011-11-081-26/+40
| | | | | | | | | * add service_check function for checking if a process is alive * add service_signal for sending arbitrary signals to a process * change service_stop to send a TERM signal first, wait for the process to die and send a KILL signal if it doen't * have service_kill print a warning on STDERR stating it has been deprecated git-svn-id: svn://svn.openwrt.org/openwrt/trunk@28865 3c298f89-4303-0410-b956-a3cf2f4a3e73
* package/base-files: move service* functions from /etc/rc.common to ↵Nicolas Thill2011-11-081-0/+82
| | | | | | /lib/functions.sh git-svn-id: svn://svn.openwrt.org/openwrt/trunk@28864 3c298f89-4303-0410-b956-a3cf2f4a3e73
* package/base-files: move /etc/functions.sh to /lib/functions.shNicolas Thill2011-11-081-0/+320
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@28857 3c298f89-4303-0410-b956-a3cf2f4a3e73