aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/lib/preinit/10_indicate_preinit
Commit message (Collapse)AuthorAgeFilesLines
* base-files: Do not break on non-eth portsOlliver Schinagl2023-05-091-2/+0
| | | | | | | | | | | | | | When using OpenWRT with DSA and 'lan' ports, we could get an empty `next_eth`. This is of course not desirable, as this causes `sh: out of range` errors when trying to determine which one would be greater. It turns out, that we don't even need this check at all because, when looking for all existin eth*s on a system, and take the highest index and then iterate a set of devices and rename to eth${highest_index+n}, it is guaranteed that there will be no conflict. Fixes: b688bf83f9d6 ("base-files: rename ethernet devs on known boards") Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
* base-files: rename ethernet devs on known boardsMartin Kennedy2022-09-101-0/+43
| | | | | | | | | | | | | | | | Some platforms lack an established way to name netdevs; for example, on x86, PCIe-based ethernet interfaces will be named starting from eth0 in the order they are probed. This is a problem for many devices supported explicitly by OpenWrt which have hard-wired, standalone or on-CPU NICs not supported by DSA (which is usually used to rename the ports based on their ostensible function). To fix this, add a mapping between ethernet device name and sysfs device path to board.json; this allows us to configure ethernet device names we know about for a given board so that they correspond to external labeling. Signed-off-by: Martin Kennedy <hurricos@gmail.com>
* base-files: bring up vlan interface tooLuiz Angelo Daros de Luca2021-06-221-0/+3
| | | | | | | Vlan subinterface was never brought up when using vlan-based preinit network. Tested forcing ifname="" before preinit_ip() on a Tp-Link Archer C5v4. Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
* base-files: failsafe: Remove the VLAN modifier from interface nameHauke Mehrtens2021-06-221-0/+2
| | | | | | | Some interfaces have a VLAN modifier like :t in lan1:t, this modifier should be removed from the interface before calling preinit_ip_config(). Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* base-files: failsafe: Fix IP configurationHauke Mehrtens2021-06-221-3/+9
| | | | | | | | | | | | | Adapt the preinit_config_board() to the board.json network changes. It now looks for the device and the ports variables to configure the LAN network. This works with swconfig configurations. Fixes: FS#3866 Fixes: d42640e389a8 ("base-files: use "ports" array in board.json network for bridges") Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Reviewed-by: Rafał Miłecki <rafal@milecki.pl>
* treewide: drop shebang from non-executable lib filesAdrian Schmutzler2021-01-291-1/+0
| | | | | | | | | | | | This drops the shebang from another bunch of files in various /lib folders, as these are sourced and the shebang is useless. Fix execute bit in one case, too. This should cover almost all trivial cases now, i.e. where /lib is actually used for library files. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* base-files: preinit: also config switch when no port roles definedChuanhong Guo2020-04-121-6/+7
| | | | | | | | | current preinit code in base-files doesn't config switch when there are no port roles defined. But this kind of configuration exists on single port devices where switch vlan is simply disabled. configure reset and enable_vlan property when a switch node exist. Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
* merge: base: update base-files and basic configZoltan HERPAI2017-12-081-1/+1
| | | | Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
* base-files: drop unused preinit_echo functionRafał Miłecki2017-08-091-5/+0
| | | | | | It isn't used for years since the old 99_10_run_init has been dropped. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* base-files: don't setup network in preinit if failsafe is disabledRafał Miłecki2017-08-091-1/+4
| | | | | | | | | | | | With failsafe disabled there is no point in early network setup. We don't send announcement over UDP and there is no way to ssh to the device. A side effect of this is avoiding a possibly incorrect network config (only with failsafe disabled). This problem is related to possible changes made by user in /etc/config/network. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* base-files: board.json's switch reset means existence, not argumentJonas Gorski2017-06-111-1/+4
| | | | | | | Don't pass the value unconditionally to swconfig as a parameter but instead only call reset if it is 1. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
* base-files: set pi_ifname in board.d case to fix deconfigJonas Gorski2016-08-141-1/+3
| | | | | | | | Due to an empty pi_ifname in the generic failsafe setup, the deconfig never removed the failsafe networking interface, causing broken networking later on. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
* base-files: configure switch in failsafeJonas Gorski2016-08-131-2/+46
| | | | | | | Also configure the switch based on the failsafe config, and create the failsafe interface as tagged if necessary. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
* base-files: allow failsafe to configure vlansJonas Gorski2016-08-131-3/+29
| | | | | | | In preparation of properly setting up vlans and switches, add support for configuring failsafe on a vlan tagged interface. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
* base-files: add preinit ifname detection based on board.jsonJonas Gorski2016-08-131-0/+29
| | | | | | Make use of the existing board.d to autodetect lan ifname in a generic way. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
* base-files: split out preinit interface configJonas Gorski2016-08-131-4/+10
| | | | | | | Move preinit interface and ip config to its own function to allow calling it from more than one place. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
* branding: add LEDE brandingJohn Crispin2016-03-241-1/+1
| | | | Signed-off-by: John Crispin <blogic@openwrt.org>
* base-files: add /etc/iproute2/rt_tables, replace ifconfig-usageSteven Barth2015-09-081-2/+4
| | | | | | Signed-off-by: Steven Barth <steven@midlink.org> SVN-Revision: 46830
* add "preinit_regular" diag.sh set_state argumentJohn Crispin2014-12-151-5/+1
| | | | | | | | | | | | 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
* packages: fix typo in OpenWrt nameJohn Crispin2014-12-071-1/+1
| | | | | | Signed-off-by: Cezary Jackiewicz <cezary.jackiewicz@gmail.com> SVN-Revision: 43542
* base-files: fix whitespacesLuka Perkov2013-12-091-23/+22
| | | | | | Signed-off-by: Luka Perkov <luka@openwrt.org> SVN-Revision: 39006
* make basefiles aware of procdJohn Crispin2013-03-131-1/+0
| | | | | | Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 36003
* base-files: use a natural mount syntaxFlorian Fainelli2012-11-231-1/+0
| | | | | | | | | | 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
* base-files: preinit: get rid of /dev/null redirections and use grep -q where ↵Jo-Philipp Wich2010-02-011-3/+3
| | | | | | applicable SVN-Revision: 19478
* add preinit modularization work by Daniel Dickinson (cshore)Felix Fietkau2010-01-251-0/+52
SVN-Revision: 19331