Commit Graph

77 Commits (34bbbbf9c3b39e7b2d81df590aad5cdbd00280d6)

Author SHA1 Message Date
Zoltan HERPAI 34bbbbf9c3 merge: base: update base-files and basic config
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
6 years ago
Hans Dedecker 400c5f03c3 base-files: fix wan6 interface config generation for pppoe
Setting ipv6 to auto in case of a pppoe interface will trigger the
creation of a dynamic wan_6 interface meaning two IPv6 interfaces
(wan6 and wan_6) will be active on top of the pppoe interface.
This leads to unpredictable behavior in the network; therefore set
ipv6 to 1 which will prevent the dynamic creation of the wan_6
interface.
Further alias the wan6 interface on top of the wan interface for pppoe
as the wan6 interface can only be started when the link local address is
ready. In case of pppoe the link local address is negotiated during the
Internet Protocol Control Protocol when the PPP link is setup meaning
all the IP address info is only available when the wan interface is up.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
7 years ago
Yousong Zhou 034bed3707 base-files: uppercase default hostname: LEDE
The name will appear in shell prompt and LuCI page title.  Uppercase
letters seem to be more vigorous

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
7 years ago
Julian Labus b0ac825884 base-files: Changed UCI variable name for GPIO value from 'default' to 'value'
This changes the UCI variable for the GPIO value from system.$cfg.default back
to system.$cfg.value as it was before the change from uci-defaults [1] to board.d.
/etc/init.d/gpio_switch [2] still expects the value to be in system.$cfg.value.

[1] d65916047b/package/base-files/files/lib/functions/uci-defaults.sh (L197)
[2] https://github.com/lede-project/source/blob/master/package/base-files/files/etc/init.d/gpio_switch#L17

Signed-off-by: Julian Labus <julian@labus-online.de>
7 years ago
Rafał Miłecki 2187f57db6 base-files: add ucidef_set_led_usbport for full usbport support
This helper allows using usbport trigger directly. It requires usbport
compatible syntax and supports specifying multiple USB ports, e.g.:
ucidef_set_led_usbport "usb" "USB" "devicename:colour:function" "usb1-port1" "usb2-port1"

This adds a proper object to the board.json, e.g.
"usb": {
	"name": "USB",
	"type": "usbport",
	"sysfs": "devicename:colour:function",
	"ports": [
		"usb1-port1",
		"usb2-port1"
	]
}
and supports translating it into uci section.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
8 years ago
Koen Vandeputte 0f27096100 base-files: also generate configs when current is empty (FS#193)
Before a configuration is generated, an empty file is created to store
it in. (required by UCI)

If something happens during config generation
(power cut, interruption, ..) an empty file exists and it is never
regenerated again, causing some daemons to fail starting
(NTPD, logread, ..)

Fix this by also generating new configs if a critical file
is empty.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
8 years ago
Jonas Gorski 780ccbf9f1 base-files: board_detect: allow specifying the generated file
Allow passing a filename to change the location of the generated
board.json.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
8 years ago
Jonas Gorski e934a129f0 base-files: let config_generate call board_detect
Instead of board_detect generating the config as a side effect, let
config_generate call board_detect as needed.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
8 years ago
Etienne CHAMPETIER 3946a55291 base-files: seed /dev/urandom
This commit:
1) seed /dev/urandom with the saved seeds as early as possible
   (see /lib/preinit/81_urandom_seed)
2) save a seed at /etc/urandom.seed if it doesn't exists
3) save a new seed each boot at "system.@system[0].urandom_seed"
   (see /etc/init.d/urandom_seed)

We use getrandom() so we are sure /dev/urandom pool is initialized

Seed size is 512 bytes (ie /proc/sys/kernel/random/poolsize / 8)
it's the same size as in ubuntu 14.04 and all systemd systems

Seeding /dev/urandom doesn't change entropy estimation, so we still have
"random: ubus urandom read with 4 bits of entropy available"
messages in the logs, but we can now ignore them if
after "urandom-seed: Seeding with ..." message

Saving a new seed on each boot is disabled by default to avoid too much
writes without user consent

v2: log preinit messages to /dev/kmsg
v3: use non generic function name for logging, as /lib/preinit/ files
    are all sourced together in /etc/preinit
v4: after a lot of discussion on the ML, use a uci config param
v5: config param is now the path of the seed

Signed-off-by: Etienne CHAMPETIER <champetier.etienne@gmail.com>
Acked-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Jo-Philipp Wich 8d51706616 base-files: use LEDE NTP vendor pool
The vendor NTP pool for the LEDE project got approved, so switch to it now.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Hannu Nyman df7581e4c0 base-files: increase default system log size to 64 kB
Increase the default system log buffer size
from 16 kB (built-in default in ubox logd)
to 64 kB by setting the option in /etc/config/system.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
8 years ago
Felix Fietkau d6ad9d3e9c base-files: fix /bin/config_generate breakage
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Jo-Philipp Wich b98f78b1c1 base-files: rework config generation logic
Now that config_generate is able to generate the entire /etc/config/system
from scratch we can apply the same logic as used for /etc/config/network;
when the configuration file exists already then do not do anything, else
generate it from the values provided by /etc/board.json .

In order to facilitate that move the file existance checking inside
/bin/config_generate and call it unconditionally from /bin/board_detect.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Jo-Philipp Wich 07f03d0833 base-files: support port_state LED types in board.d
Add support for handling port_state LEDs as used by ADM5120.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Jo-Philipp Wich 528b8f6f93 base-files: support hostname and ntp servers through board.d
Add support for specifying hostname and NTP servers via /etc/board.d/ scripts.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Vittorio Gambaletta (VittGam) 40f933d7ff base-files: Fix config_generate when there are no switch VLANs or ports configured in board.json.
The json_select call fails when there are no roles or ports objects in board.json. "json_select .." must not be executed after failing.

This fixes for example LEDs not being set up in /etc/config/system.

Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net>
8 years ago
John Crispin 528ffec3cd base-files: remove ununsed login.sh
Signed-off-by: John Crispin <john@phrozen.org>
8 years ago
Hauke Mehrtens ea6d36111b base-files: allow to set arbitrary ip address and netmask
Signed-off-by: Roman Yeryomin <roman@advem.lv>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

SVN-Revision: 49179
8 years ago
Felix Fietkau 956794c2e9 base-files: change type of adsl and vdsl to dsl only
Instead of having two different types adsl and vdsl just create one dsl
type. This way we can use the same luci code for adsl and vdsl and the
config parameters are not so different.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

SVN-Revision: 48944
8 years ago
Jo-Philipp Wich eced3b3a35 base-files: support passing mode to ucidef_set_led_netdev()
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 48806
8 years ago
Felix Fietkau 285d9e364e base-files: add support for speed mask to switch config init scripts
This patch adds extra parameter to switch LED trigger initialization
functions.  New functionality maintains backward compatibility, so
calling functions without setting new speed_mask parameter works
as expected.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>

SVN-Revision: 48776
8 years ago
John Crispin c0c3f2d4c9 leds: support oneshot as well as timer triggers
oneshot and timer have the same configuration options, just a different
trigger name.

Signed-off-by: Karl Palsson <karlp@etactica.com>

SVN-Revision: 48770
8 years ago
Felix Fietkau f70c8ba198 base-files: set mac address in default network config via device sections
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 48646
8 years ago
Jo-Philipp Wich 08078df83d board.d: add support for gpio_switch sections
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47762
9 years ago
Jo-Philipp Wich 6c8daa6ba3 base-files: board.d: support dsl modems, atm bridges and pppoe protocol
This adds support for specifying the dsl modem, atm bridge configs and setting
the pppoe protocol for wan.

These additions are required to port the Lantiq target to board.d.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47750
9 years ago
Jo-Philipp Wich f611358870 base-files: board.d: support specifiying the protocol of lan and wan
Some boards, e.g. the Sheeva Plug, require the lan interface to be set
to DHCP instead of a static address, therfore support that.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47732
9 years ago
Jo-Philipp Wich ac9bed4bc0 base-files: board.d: support timer leds
Add ucidef_set_led_timer() and handling for it to config_generate.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47731
9 years ago
Jo-Philipp Wich 80f767d093 base-files: uci-defaults-new, config_generate: refactor code and drop old vlans
Remove support for now unused ucidef_add_switch_vlan(), move port->vlan and
vlan->interfaces conversion to uci-defaults-new.sh and massively simplify
config_generate.

This change prepares the following upcoming steps:

 * Eliminate use of ucidef_set_interface_lan_wan() for switch only devices
 * Merge ucidef_add_switch() with ucidef_add_switch_ports()

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47719
9 years ago
Jo-Philipp Wich 1871619e72 base-files: config_generate: add missing chunks of force tag support
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47718
9 years ago
Jo-Philipp Wich 73a4e0334c base-files: uci-defaults-new, config_generate: allow force tagged cpu ports
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47679
9 years ago
Jo-Philipp Wich a826098e2b base-files: uci-defaults-new: only emit force_link for additional ifaces
Only se4t the force_link property for non-lan, non-wan ifaces as it is
unnecessary in the default cases.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47675
9 years ago
Jo-Philipp Wich 0e0119b6f0 base-files: uci-defaults-new, config_generate: support for gpio leds
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47660
9 years ago
Jo-Philipp Wich aa4c5fd2b0 base-files: config_generate: regroup led generator code
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47659
9 years ago
Jo-Philipp Wich 8b9e839955 base-files: uci-defaults-new: remove ucidef_set_led_interface()
The only user was the hg255d board and config_generate did not even emit
proper uci for it.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47658
9 years ago
Jo-Philipp Wich 972d3de148 base-files: config_generate: support rssi leds
Add support for emitting rssi monitor and led configuration sections.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47656
9 years ago
Jo-Philipp Wich 92d414eb07 base-files: config_generate: reformat for better readability and quote variables
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47654
9 years ago
Jo-Philipp Wich a466bfe8f4 base-files: config_generate: handle switch port attributes and better group json_select
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47648
9 years ago
Jo-Philipp Wich 97baeb2fa4 base-files: config_generate: do not remove previously generated interfaces
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47647
9 years ago
Jo-Philipp Wich 63c2111e86 base-files: config_generate: properly handle multiple switches
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47646
9 years ago
Jo-Philipp Wich 2d5dbf9b47 base-files: config_generate: support autogenerating vlans
Add support for generating vlans solely from the port layout description
given through ucidef_add_switch_ports().

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47639
9 years ago
Jo-Philipp Wich 6d3901bf76 base-files: config_generate: honour port_mask property (#20963)
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47609
9 years ago
Steven Barth d196b1fc2e Disable telnet in favor of passwordless SSH
This enables passworldless login for root via SSH whenever no root
password is set (e.g. after reset, flashing without keeping config
or in failsafe) and removes telnet support alltogether.

Signed-off-by: Steven Barth <steven@midlink.org>

SVN-Revision: 46809
9 years ago
John Crispin 5a6433cc6c base-files: config_generate did not handle setups with more than 1 switch properly
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 43088
10 years ago
Felix Fietkau 99a651fd50 base-files: fix telnet login on musl
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 43006
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
John Crispin 2d286dad6e base-files: properly generate the ula
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 42261
10 years ago
John Crispin 9ba6cd186a base-files: fix inverse logic in board_detect script
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 42220
10 years ago
John Crispin db6a292d4c base-files: wan6 should reference wan intead of referencing itself.
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 42199
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 ef0ce72b39 base-files: ipcalc.sh: support bit length as netmask parameter
SVN-Revision: 39100
11 years ago