Commit Graph

109 Commits (34bbbbf9c3b39e7b2d81df590aad5cdbd00280d6)

Author SHA1 Message Date
John Crispin 31eadd07f2 base-files: Fix switch settings for uci-defaults-new.sh.
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>

SVN-Revision: 43887
9 years ago
John Crispin 019ea725aa add "preinit_regular" diag.sh set_state argument
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>

SVN-Revision: 43715
10 years ago
John Crispin 20940138ac scripts: fix wrong usage of '==' operator
[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>

SVN-Revision: 42911
10 years ago
Steven Barth 14e6559eee base-files: add network_get_ipaddrs_all()
Return all IPv4 and IPv6 addresses.

Signed-off-by: Mathias Kresin <openwrt@kresin.me>

SVN-Revision: 42856
10 years ago
Steven Barth c118e5edf4 network: Unbind DHCPv6 from underlying interfaces
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>

SVN-Revision: 42848
10 years ago
Florian Fainelli bc96c49c67 base-files: add a protocol argument to ucidef_set_interface_raw
Add a third argument to ucidef_set_interface_raw, which is specifying
the protocol.

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

SVN-Revision: 42665
10 years ago
Luka Perkov a8b6ca8797 base-files: whitespace fixes
Signed-off-by: Luka Perkov <luka@openwrt.org>

SVN-Revision: 42542
10 years ago
John Crispin 562d9f9582 base-files: add a hardware detection layer
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>

SVN-Revision: 42185
10 years ago
Jo-Philipp Wich f63509ac89 base-files: /lib/functions/network.sh: fix network_get_ipaddr6
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>

SVN-Revision: 42139
10 years ago
Gabor Juhos 69abf630cf base-files: strip quotes from the MAC address in macaddr_canonicalize()
Extracted from http://patchwork.openwrt.org/patch/5716/

Signed-off-by: Forest Crossman <cyrozap@gmail.com>
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 41639
10 years ago
Jo-Philipp Wich 7eb721425e base-files: depend on jsonfilter and rewrite network.sh to use it
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>

SVN-Revision: 41281
10 years ago
John Crispin 37eb27e47d base-files: remove function service_kill
Function service_kill is deprecated and has no user, so remove it.

Signed-off-by: Zhao, Gang <gamerh2o@gmail.com>

SVN-Revision: 40912
10 years ago
Felix Fietkau bb240b50b6 base-files: enable force_link for lan by default
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>

SVN-Revision: 40773
10 years ago
Felix Fietkau dd58e15b84 base-files: add back missing function for find_mtd_part to /lib/functions.sh (fixes #15496)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 40426
10 years ago
Felix Fietkau 4a9ea80ef0 /lib/functions.sh: move rarely used mtd and macaddr related functions to /lib/functions/system.sh
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 40411
10 years ago
Felix Fietkau c27c5b9cbc /lib/functions.sh: move preinit related functions to /lib/functions/preinit.sh
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 40404
10 years ago
Luka Perkov d66d2ad104 base-files: add ucidef_add_switch_port function
Signed-off-by: Luka Perkov <luka@openwrt.org>

SVN-Revision: 39372
10 years ago
Jo-Philipp Wich fe230cac18 base-files: add network_get_protocol() to /lib/functions/network.sh
SVN-Revision: 39099
11 years ago
Luka Perkov 3ceb6b3274 base-files: fix whitespaces
Signed-off-by: Luka Perkov <luka@openwrt.org>

SVN-Revision: 39006
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
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
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
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
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
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
11 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
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 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
Gabor Juhos eca7502dfd base-files: add LED specific functions to /lib/functions/uci-defaults
SVN-Revision: 31991
12 years ago
Jo-Philipp Wich c11151bc70 base-files: add network_is_up()
SVN-Revision: 31978
12 years ago
Jo-Philipp Wich bf52cbf108 base-files: let network_get_device() return the l3 interface, introduce network_get_physdev() to obtain the underlying iface (if applicable)
SVN-Revision: 31960
12 years ago
Jo-Philipp Wich 8ef9450b37 base-files: add network_get_device() to network.sh
SVN-Revision: 31937
12 years ago
Jo-Philipp Wich f1d04190c5 base-files: introduce /lib/functions/network.sh This file will contain common procedures to deal with network interfaces. Initially provides network_get_ipaddr(), network_get_ipaddr6(), network_get_subnet() and network_get_subnet6() to determine the primary IP addresses or subnets of a given logical interface.
SVN-Revision: 31935
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 6c61d7cbf1 base-files: remove trailing whitespaces from lib/functions/boot.sh
SVN-Revision: 30776
12 years ago
Gabor Juhos 561f4d2840 base-files: add lib/functions/uci-defaults.sh
SVN-Revision: 29384
13 years ago
Felix Fietkau 66bcd1d049 base-files: add initial support for mounting overlayfs
SVN-Revision: 26207
13 years ago
Michael Büsch e6100a161b boot.sh: Tabs are used for indent. Also use tabs in jffs2_ready()
SVN-Revision: 25635
13 years ago
Michael Büsch 16a300ea66 base-files: Add "-o noatime" to mount wrapper
noatime is cheaper than default relatime.

SVN-Revision: 25634
13 years ago
Jo-Philipp Wich a8efa34da3 Fix permissions for /etc and other dirs after clean flash (#6039)
During the first OpenWrt boot after a clean flash (when the jffs2
partition is not yet initialized) tmpfs is used instead of the usual
jffs2 overlay filesystem.  If this tmpfs is mounted with default
options, all directories created there (/etc, /etc/config, other
subdirectories in /etc) get permissions 1777 by default, and these
permissions then persist in the created jffs2 at least until
subsequent sysupgrade.  Mounting tmpfs with mode=0755 fixes the
permission problem.

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>

SVN-Revision: 23906
14 years ago
Daniel Dickinson 18b473ca9b base/block-extroot, base/block-mount: Modified preinit and block-extroot and block-mount so that use of block-mount and block-extroot do not require that block-extroot, block-mount, nor the kernel modules they depend, on are required to included in the image. That is block-extroot and dependencies may now be installed as modules onto the jffs2 part of a squashfs system and it will work. In addition packages which are installed into the jffs2 of a squashfs system may now affect preinit, so long as they do not require execution of commands that occur before the merging of the jffs2 and built-in (squashfs) preinit scripts is done.
Thanks jow for the preinit merge stuff!

SVN-Revision: 23110
14 years ago
Daniel Dickinson 1385904dfa base-files: Add function pi_include the /lib/functions/boot.sh used by preinit, which safely sources files as well as working correctly whether the script using it is a package added to the jffs2 part of a squashfs or built into an image or on some other root filesystem.
SVN-Revision: 23099
14 years ago
Jo-Philipp Wich d6a142375b base-files: fix a preinit hang in jffs2_ready() when no rootfs_data partition is found (#7362)
SVN-Revision: 21511
14 years ago
Florian Fainelli 7af8ee0481 change from /jffs to /overlay, patch from Daniel Dickinson
SVN-Revision: 20356
14 years ago
Jo-Philipp Wich 1968fb8da3 base-files: force preinit to use busybox mount (#6797)
SVN-Revision: 20176
14 years ago
Felix Fietkau 9be4598569 add block-extroot, a package for using an external filesystem as rootfs (patch by cshore)
SVN-Revision: 19880
14 years ago
Felix Fietkau 56bc02a305 add preinit modularization work by Daniel Dickinson (cshore)
SVN-Revision: 19331
14 years ago