Commit Graph

236 Commits (18dd10190370853c3efc10b33711313a3ecb9a09)

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
11 years ago
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
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
Hauke Mehrtens 0d82bbb1fb base-files: don't kill nas for sysupgrade
Signed-off-by: Nathan Hintz <nlhintz@hotmail.com>

SVN-Revision: 38766
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
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
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
Jo-Philipp Wich 55178554c2 base-files: reject invalid uci keys in network_get_device() and related procedures (#13886)
SVN-Revision: 37345
11 years ago
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
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
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
11 years ago
John Crispin e078f649b5 procd: make the preinit rules wildcard all buttons for failsafe
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 36896
11 years ago
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
11 years ago
Jo-Philipp Wich 026271d03c base-files: change network_find_wan() procedure to ignore default gateways in different routing tables
SVN-Revision: 36553
11 years ago
John Crispin c7c243669c sysupgrade: fixes broken pipe error during sysupgade
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 36548
11 years ago
John Crispin 831c7ea04f preinit: move cmdline failsafe= handling ot the generic code
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 36430
11 years ago
John Crispin 811d90ff40 mount_root: prepare base-files
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 36429
11 years ago
Steven Barth 4e8f7f37ed Change default IPv6 config to enable DHCPv6-PD
SVN-Revision: 36384
11 years ago
Steven Barth ea94d66b0f Adapt default network configuration for IPv6
SVN-Revision: 36278
11 years ago
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
11 years ago
John Crispin ada74b8732 sysupgrade was broken as procd was getting killed
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 36031
11 years ago
John Crispin f43b7934d2 make basefiles aware of procd
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 36003
11 years ago
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
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 231f8c2969 base-files: fix network_get_prefix6
SVN-Revision: 35300
11 years ago
Jo-Philipp Wich 1941fb309d base-files: network.sh: fix typo in previous commit
SVN-Revision: 35287
11 years ago
Jo-Philipp Wich 3b2db1838a base-files: network.sh: simplify network_get_prefix6()
SVN-Revision: 35286
11 years ago
Steven Barth 847cd984b9 base-files: add support for ipv6-prefixes in connection with netifd
SVN-Revision: 35168
12 years ago
Vasilis Tsiligiannis 674439299f base-files: Don't pass '--set-worker /lib/hotplug2/worker_fork.so' to hotplug2 (#12781)
SVN-Revision: 35095
12 years ago
Steven Barth f657787b52 base-files: Fix a typo in config_list_foreach
SVN-Revision: 34893
12 years ago
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
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
Jo-Philipp Wich 3339316fbe base-files: use json_is_a() in network.sh
SVN-Revision: 34733
12 years ago
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
12 years ago
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
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
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
12 years ago
Jo-Philipp Wich dac5ed38b6 base-files: remove route enabled check in lib/functions/network.sh after netifd bump
SVN-Revision: 33391
12 years ago
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
12 years ago
Jo-Philipp Wich ff3161a6c4 base-files: ensure that /sys is available during sysupgrade, some essential services like om-watchdog need it
SVN-Revision: 32587
12 years ago
Jo-Philipp Wich b2e5c5f82e base-files: implement network_get_dnsserver() and network_get_dnssearch() in /lib/functions/network.sh
SVN-Revision: 32531
12 years ago
Jo-Philipp Wich e654014352 base-files: only consider enabled default routes when finding the wan iface (#11774)
SVN-Revision: 32525
12 years ago
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
12 years ago
Jo-Philipp Wich 9869b4da3c base-files: implement network_defer_device() and network_ready_device() wrappers for upcoming netifd iface deferring support
SVN-Revision: 32106
12 years ago