Commit Graph

79 Commits (4a6795409d1520fd3da3e909a8bcf9d7fd0927bb)

Author SHA1 Message Date
Felix Fietkau e90b695157 /lib/functions.sh: remove pi_include()
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 40403
10 years ago
Felix Fietkau 1d763171bf /lib/functions.sh: remove jffs2_ready()
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 40402
10 years ago
Felix Fietkau 0f2524f473 /lib/functions.sh: remove support for non-overlayfs overlay fopivot types
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 40401
10 years ago
John Crispin 834204bda6 base-files: fix mount-utils incompatibility
Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>

SVN-Revision: 39169
11 years ago
John Crispin 93e9a71538 base-files: allow users to delect debug level during boot
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 38909
11 years ago
Gabor Juhos b7914344ad base-files: add macaddr_canonicalize helper function
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>

SVN-Revision: 38803
11 years ago
Gabor Juhos 23cf426324 base-files: mtd_get_mac_ascii bugfix
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>

SVN-Revision: 38690
11 years ago
Gabor Juhos 8d55ea10ad base-files: add mtd_get_part_size helper
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 37475
11 years ago
John Crispin 43a3d87b83 package: fix insmod on install
the procd changes broke the postinst insmod.

Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 37015
11 years ago
John Crispin 4c43cacce0 base-files: module loading is now handled by ubox/kmodloader
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 37003
11 years ago
Gabor Juhos c4f14fab9b base-files: minor cosmetic corrections for functions.sh
- 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>

SVN-Revision: 35646
11 years ago
Gabor Juhos 5a8c63b47e base-files: add macaddr_{add,2bin,setbit_la} helpers
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 35614
11 years ago
Gabor Juhos 70d40b2ddd base-files: add mtd_get_mac_{ascii,binary} helpers
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 35612
11 years ago
Steven Barth f657787b52 base-files: Fix a typo in config_list_foreach
SVN-Revision: 34893
12 years ago
Mirko Vogt 4d4b2d3ced merge /lib/functions/boot.sh and /lib/functions.sh
SVN-Revision: 34794
12 years ago
Mirko Vogt 439a869090 Do not overload mount-call - trying to reduce confusion
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'.

SVN-Revision: 34792
12 years ago
Gabor Juhos 1552af3131 base-files: add mtd_find_chardev helper
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 34648
12 years ago
Mirko Vogt ee17703371 Revert "remove function find_mtd_part() from /lib/functions.sh"
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.

SVN-Revision: 34642
12 years ago
Mirko Vogt 1521cdda0f remove function find_mtd_part() from /lib/functions.sh
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.

SVN-Revision: 34641
12 years ago
Jo-Philipp Wich a044a43d06 base-files: make user_add() populate the shadow db as well
SVN-Revision: 32063
12 years ago
Felix Fietkau 3678ba60ca base-files: rename internal variables in config_foreach to make namespace conflicts more unlikely
SVN-Revision: 31431
12 years ago
Felix Fietkau 6f46704743 base-files: split service related functions off to /lib/functions/service.sh
SVN-Revision: 31042
12 years ago
Gabor Juhos 8ae051799a base-files: remove trailing whitespaces from lib/functions.sh
SVN-Revision: 30775
12 years ago
Nicolas Thill b49aed1520 package/base-files: enhance service functions
* allow matching process by name (useful for processes changing it)
 * check if first argument is executable
 * fix function name used in error messages

SVN-Revision: 28991
13 years ago
Nicolas Thill f371d516bf package/base-files: /lib/functions.sh: add {group,user}_{add,exists} functions
SVN-Revision: 28871
13 years ago
Nicolas Thill 62a2827ea7 package/base-files: /lib/functions.sh: let service_stop exit early if no matching process to stop where found
SVN-Revision: 28870
13 years ago
Nicolas Thill b7b56df707 package/base-files: enhance & cleanup service wrappers
* 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

SVN-Revision: 28865
13 years ago
Nicolas Thill d0659ce37e package/base-files: move service* functions from /etc/rc.common to /lib/functions.sh
SVN-Revision: 28864
13 years ago
Nicolas Thill b6aef59ea8 package/base-files: move /etc/functions.sh to /lib/functions.sh
SVN-Revision: 28857
13 years ago