Autoboot when idling at prompt possible?
Konstantin Kletschke
konstantin.kletschke at inside-m2m.de
Fri Mar 17 10:35:27 PDT 2023
Dear Ahmad,
thanks for your kind support.
On Thu, Mar 16, 2023 at 01:51:39PM +0100, Ahmad Fatoum wrote:
> If you keep ctrl+c pressed during boot, you may abort before init runs,
> even if global.autboot_timeout=0.
Interesting, I double checked "my" barebox for this feature, nice to
know.
> You can enable watchdog before init runs, e.g. in your board code, let's
> say with a timeout of 2 minutes. If you have reason to use the shell, you
> run wd -x manually or set global.autoboot=abort and reset.
This sounds neat and not over complicated. Nice Idea, to have a watchdog
enabled at barebox level, why not. The manual required "wd -x" is fine.
I have a beaglebone board, added CONFIG_WATCHDOG and manual enabling
watchdog via "wd 120" and disabling vie "wd -x" works fine. Now I wonder
how to enable at boot up.
Something like
--- a/arch/arm/boards/beaglebone/board.c
+++ b/arch/arm/boards/beaglebone/board.c
@@ -25,6 +25,8 @@
#include <linux/err.h>
#include <mach/bbu.h>
+#include <watchdog.h>
+
#include "beaglebone.h"
static int beaglebone_coredevice_init(void)
@@ -84,6 +86,9 @@ static int beaglebone_devices_init(void)
if (IS_ENABLED(CONFIG_SHELL_NONE))
return am33xx_of_register_bootdevice();
+ struct watchdog *wd = watchdog_get_default();
+ watchdog_set_timeout(wd, 120);
+
return 0;
}
coredevice_initcall(beaglebone_devices_init);
?
I can't test at the moment because I am remote and cant handle a abused
crashing barebox at the moment. It compiles, though!
The passwort entry approach is kinda neat to, I will investigate this
feature too.
Kind Regards
Konstantin
--
INSIDE M2M GmbH
Konstantin Kletschke
Berenbosteler Straße 76 B
30823 Garbsen
Telefon: +49 (0) 5137 90950136
Mobil: +49 (0) 151 15256238
Fax: +49 (0) 5137 9095010
konstantin.kletschke at inside-m2m.de
http://www.inside-m2m.de
Geschäftsführung: Michael Emmert, Derek Uhlig
HRB: 111204, AG Hannover
More information about the barebox
mailing list