summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2022-09-16 08:32:41 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-09-22 11:31:07 +0200
commit19eabb0a16b5e2435afc4dd16718fef1cc08b6fd (patch)
tree628194f2eeae209d2e2f3dd9f21ac171b974fd4f /common
parent8fcd6851baa3a9f4c1b74bd8cf1ad784e02e6794 (diff)
downloadbarebox-19eabb0a16b5e2435afc4dd16718fef1cc08b6fd.tar.gz
barebox-19eabb0a16b5e2435afc4dd16718fef1cc08b6fd.tar.xz
net: Bring up all interfaces when going interactive
So far we only bring up network interfaces when we actually need them. This means we could be idling in the shell for long and once the user decides to do networking he has to wait for the link to be established. We can do better: Before going interactive bring up all known network interfaces which makes the links established when the user needs them. To implement this we have to rework carrier checking a bit, because otherwise barebox would wait for the links to be established before continuing. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r--common/startup.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/startup.c b/common/startup.c
index f53b73f81a..f96cff4142 100644
--- a/common/startup.c
+++ b/common/startup.c
@@ -37,6 +37,7 @@
#include <linux/ctype.h>
#include <watchdog.h>
#include <glob.h>
+#include <net.h>
#include <bselftest.h>
extern initcall_t __barebox_initcalls_start[], __barebox_early_initcalls_end[],
@@ -307,6 +308,9 @@ static int run_init(void)
if (autoboot == AUTOBOOT_BOOT)
run_command("boot");
+ if (IS_ENABLED(CONFIG_NET))
+ eth_open_all();
+
if (autoboot == AUTOBOOT_MENU)
run_command(MENUFILE);