Commit graph

236 commits

Author SHA1 Message Date
John Crispin
93e9a71538 base-files: allow users to delect debug level during boot
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 38909
2013-11-25 08:34:55 +00:00
Felix Fietkau
ff17114ba1 ar71xx: Unifi AP Pro sysupgrade patch
The current implementation of mtd will not append the backup
file created by sysupgrade to the correct partition, as mtd will append
the data to first jffs2 partition it finds. As the kernel is also
stored on a jffs2 partition (which resides before the overlay
partition), the data will be appended to this partition.

To fix this problem, a new option

-s <number>             skip the first n bytes when appending data to the jffs2 partiton, defaults to "0"

is added to mtd.

Signed-off-by: Peter Wagner <tripolar@gmx.at>

SVN-Revision: 38807
2013-11-14 19:38:54 +00:00
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
2013-11-14 17:44:42 +00:00
Hauke Mehrtens
0d82bbb1fb base-files: don't kill nas for sysupgrade
Signed-off-by: Nathan Hintz <nlhintz@hotmail.com>

SVN-Revision: 38766
2013-11-11 22:12:58 +00:00
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
2013-11-08 12:16:21 +00:00
John Crispin
3e54dbbf60 base-files: be verbose when entering failsafe due to a button being pressed
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 37535
2013-07-25 20:28:36 +00:00
Gabor Juhos
8d55ea10ad base-files: add mtd_get_part_size helper
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 37475
2013-07-20 09:25:49 +00:00
Jo-Philipp Wich
55178554c2 base-files: reject invalid uci keys in network_get_device() and related procedures (#13886)
SVN-Revision: 37345
2013-07-15 13:42:58 +00:00
Felix Fietkau
b95bdc8ab5 kernel/base-files: clean up old code related to refreshing mtd partitions, it is no longer used anywhere
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 37282
2013-07-14 12:56:58 +00:00
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
2013-06-22 22:09:40 +00:00
John Crispin
4c43cacce0 base-files: module loading is now handled by ubox/kmodloader
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 37003
2013-06-21 16:53:59 +00:00
Jo-Philipp Wich
265a2deba3 base-files: network.sh: extend network_get_ipaddr6() / network_get_subnet6() to take ipv6-prefix-assignment into account, add further helper functions to fetch all ips of a given interface
SVN-Revision: 36942
2013-06-17 11:33:36 +00:00
John Crispin
e078f649b5 procd: make the preinit rules wildcard all buttons for failsafe
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 36896
2013-06-10 08:24:44 +00:00
John Crispin
5e45a68a4a base-files: fix failsafe via button press
entering failsafe by pressing a button during boot was broken for procd as init

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

SVN-Revision: 36891
2013-06-10 08:24:13 +00:00
Jo-Philipp Wich
026271d03c base-files: change network_find_wan() procedure to ignore default gateways in different routing tables
SVN-Revision: 36553
2013-05-06 09:33:56 +00:00
John Crispin
c7c243669c sysupgrade: fixes broken pipe error during sysupgade
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 36548
2013-05-05 12:41:42 +00:00
John Crispin
831c7ea04f preinit: move cmdline failsafe= handling ot the generic code
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 36430
2013-04-25 19:02:37 +00:00
John Crispin
811d90ff40 mount_root: prepare base-files
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 36429
2013-04-25 19:02:32 +00:00
Steven Barth
4e8f7f37ed Change default IPv6 config to enable DHCPv6-PD
SVN-Revision: 36384
2013-04-22 19:40:16 +00:00
Steven Barth
ea94d66b0f Adapt default network configuration for IPv6
SVN-Revision: 36278
2013-04-09 08:03:08 +00:00
Florian Fainelli
3810cc0f46 base-files: sysupgrade fail with eglibc
With eglibc, "ldd busybox" give us
    libcrypt.so.1 => /lib/libcrypt.so.1 (0x774be000)
    libm.so.6 => /lib/libm.so.6 (0x773e4000)
    libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x773c0000)
    libc.so.6 => /lib/libc.so.6 (0x77276000)
    /lib/ld.so.1 (0x774fe000)

Thus /lib/ld.so.1 is not printed by the libs fonction and isn't copied to the 'new' root before pivot root
libs() { ldd $* | awk '{print $3}'; }
https://dev.openwrt.org/browser/trunk/package/base-files/files/lib/upgrade/common.sh

With uclibc the last line of "ldd busybox" is
    ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x77ada000)

Don't know for musl!

This patch replace https://dev.openwrt.org/changeset/19167, as glibc is gone
The other way around is to rework libs()

Please apply the fix (mine or another) on trunk and AA
Might fix https://dev.openwrt.org/ticket/12273

Signed-off-by: Etienne CHAMPETIER <etienne.champetier@free.fr>
Signed-off-by: Florian Fainelli <florian@openwrt.org>

SVN-Revision: 36107
2013-03-22 10:06:06 +00:00
John Crispin
ada74b8732 sysupgrade was broken as procd was getting killed
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 36031
2013-03-14 18:43:58 +00:00
John Crispin
f43b7934d2 make basefiles aware of procd
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 36003
2013-03-13 18:11:19 +00:00
Gabor Juhos
6c627a266b base-files: introduce commonly used helper functions for setting leds
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>

SVN-Revision: 35648
2013-02-18 09:56:23 +00:00
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
2013-02-17 21:47:03 +00:00
Gabor Juhos
5a8c63b47e base-files: add macaddr_{add,2bin,setbit_la} helpers
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 35614
2013-02-16 11:50:22 +00:00
Gabor Juhos
70d40b2ddd base-files: add mtd_get_mac_{ascii,binary} helpers
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 35612
2013-02-16 11:50:19 +00:00
Steven Barth
231f8c2969 base-files: fix network_get_prefix6
SVN-Revision: 35300
2013-01-22 16:47:16 +00:00
Jo-Philipp Wich
1941fb309d base-files: network.sh: fix typo in previous commit
SVN-Revision: 35287
2013-01-21 19:02:38 +00:00
Jo-Philipp Wich
3b2db1838a base-files: network.sh: simplify network_get_prefix6()
SVN-Revision: 35286
2013-01-21 18:54:58 +00:00
Steven Barth
847cd984b9 base-files: add support for ipv6-prefixes in connection with netifd
SVN-Revision: 35168
2013-01-15 13:07:51 +00:00
Vasilis Tsiligiannis
674439299f base-files: Don't pass '--set-worker /lib/hotplug2/worker_fork.so' to hotplug2 (#12781)
SVN-Revision: 35095
2013-01-11 13:20:51 +00:00
Steven Barth
f657787b52 base-files: Fix a typo in config_list_foreach
SVN-Revision: 34893
2012-12-27 14:10:01 +00:00
Mirko Vogt
4cca5cd4fd hot-fix nameclash in sysupgrade: rename pivot() to supivot() in sysupgrade
Sysupgrade defines its very own pivot() function.
Prior merging boot.sh and functions.sh sysupgrade just included boot.sh,
now it includes functions.sh which defines pivot() as well, however
slightly different which causes sysupgrade to fail.

This is a hot-fix to unbreak sysupgrade, however those two pivot()
functions should actually get merged.

SVN-Revision: 34815
2012-12-21 12:10:21 +00:00
Mirko Vogt
4d4b2d3ced merge /lib/functions/boot.sh and /lib/functions.sh
SVN-Revision: 34794
2012-12-19 16:07:53 +00:00
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
2012-12-19 16:07:46 +00:00
Jo-Philipp Wich
3339316fbe base-files: use json_is_a() in network.sh
SVN-Revision: 34733
2012-12-17 13:07:42 +00:00
Jo-Philipp Wich
17acf9bf27 base-files: rework cache handling in network.sh to keep the entire parsed ifstatus, use jshn namespaces to support using it concurrently with other jshn users
SVN-Revision: 34725
2012-12-16 20:17:18 +00:00
Jo-Philipp Wich
1600ba99e4 base-files: various enhancements to network.sh
- 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

SVN-Revision: 34722
2012-12-16 18:22:02 +00:00
Gabor Juhos
1552af3131 base-files: add mtd_find_chardev helper
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 34648
2012-12-12 16:49:50 +00:00
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
2012-12-12 13:41:56 +00:00
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
2012-12-12 12:38:31 +00:00
Florian Fainelli
5ae2524d3a base-files: use a natural mount syntax
Busybox built against musl-libc will choke on these otherwise, besides that
it is more natural to use the filesystem type, then options, then name, then
mountpoint.

Signed-off-by: Florian Fainelli <florian@openwrt.org>

SVN-Revision: 34308
2012-11-23 20:02:02 +00:00
Jo-Philipp Wich
dac5ed38b6 base-files: remove route enabled check in lib/functions/network.sh after netifd bump
SVN-Revision: 33391
2012-09-13 08:47:10 +00:00
Gabor Juhos
ca857b7a50 base-files: uci-defaults for rssileds
Adds capability to add uci-defaults defining RSSI LEDs

Signed-off-by: Daniel Golle <dgolle@allnet.de>

SVN-Revision: 33164
2012-08-13 14:01:37 +00:00
Jo-Philipp Wich
ff3161a6c4 base-files: ensure that /sys is available during sysupgrade, some essential services like om-watchdog need it
SVN-Revision: 32587
2012-07-03 15:43:43 +00:00
Jo-Philipp Wich
b2e5c5f82e base-files: implement network_get_dnsserver() and network_get_dnssearch() in /lib/functions/network.sh
SVN-Revision: 32531
2012-06-29 19:04:11 +00:00
Jo-Philipp Wich
e654014352 base-files: only consider enabled default routes when finding the wan iface (#11774)
SVN-Revision: 32525
2012-06-29 11:58:35 +00:00
Jo-Philipp Wich
57a7257569 base-files: implement network_get_gateway(), network_get_gateway6(), network_find_wan() and network_find_wan6() in /lib/functions/network.sh
SVN-Revision: 32397
2012-06-17 11:50:50 +00:00
Jo-Philipp Wich
9869b4da3c base-files: implement network_defer_device() and network_ready_device() wrappers for upcoming netifd iface deferring support
SVN-Revision: 32106
2012-06-07 14:55:26 +00:00