mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* Autoboot when idling at prompt possible?
@ 2023-03-16 12:34 Konstantin Kletschke
  2023-03-16 12:51 ` Ahmad Fatoum
  0 siblings, 1 reply; 3+ messages in thread
From: Konstantin Kletschke @ 2023-03-16 12:34 UTC (permalink / raw)
  To: barebox

Hi there,

in order to get the booting more robust I already changed
autoboot_abort_key from "any" to "ctrl-c".

We wan't to keep the autoboot_timeout to be able to access the
bootloader prompt manually or with install tools more reliably to a non
zero positive value. I.e. enter prompt with timeout greater than zero
still should be possible.

Is there a mechanism already implemented or thinkable to be added as a
command, which boots when the prompt is idling for a couple of minutes?
Lets say the bootloader caught ctrl-c by accident (free serial pins in
headless encasing in rough EMV environment) and idles there
for years...

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@inside-m2m.de
http://www.inside-m2m.de 

Geschäftsführung: Michael Emmert, Derek Uhlig
HRB: 111204, AG Hannover




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Autoboot when idling at prompt possible?
  2023-03-16 12:34 Autoboot when idling at prompt possible? Konstantin Kletschke
@ 2023-03-16 12:51 ` Ahmad Fatoum
  2023-03-17 17:35   ` Konstantin Kletschke
  0 siblings, 1 reply; 3+ messages in thread
From: Ahmad Fatoum @ 2023-03-16 12:51 UTC (permalink / raw)
  To: Konstantin Kletschke, barebox

Hello Konstantin,

On 16.03.23 13:34, Konstantin Kletschke wrote:
> Hi there,
> 
> in order to get the booting more robust I already changed
> autoboot_abort_key from "any" to "ctrl-c".
> 
> We wan't to keep the autoboot_timeout to be able to access the
> bootloader prompt manually or with install tools more reliably to a non
> zero positive value. I.e. enter prompt with timeout greater than zero
> still should be possible.

If you keep ctrl+c pressed during boot, you may abort before init runs,
even if global.autboot_timeout=0.

> Is there a mechanism already implemented or thinkable to be added as a
> command, which boots when the prompt is idling for a couple of minutes?
> Lets say the bootloader caught ctrl-c by accident (free serial pins in
> headless encasing in rough EMV environment) and idles there
> for years...

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.

You may need to enable watchdog poller support if you have a watchdog timer
that can't be disabled and you want for barebox to periodically poll it
instead.

This is readily possible. You can still set a shorter boot watchdog timeout
with global.boot.watchdog_timeout. Other possibilities:

 - Allow entering bootloader shell only after systemctl reboot loader
   (See barebox reboot mode documentation)

 - Add option to have barebox password login at most increase countdown,
   but not abort it. Users must then enter full password within specified
   time or system autoboots

Cheers,
Ahmad

> 
> Kind Regards
> Konstantin
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Autoboot when idling at prompt possible?
  2023-03-16 12:51 ` Ahmad Fatoum
@ 2023-03-17 17:35   ` Konstantin Kletschke
  0 siblings, 0 replies; 3+ messages in thread
From: Konstantin Kletschke @ 2023-03-17 17:35 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

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@inside-m2m.de
http://www.inside-m2m.de 

Geschäftsführung: Michael Emmert, Derek Uhlig
HRB: 111204, AG Hannover




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-03-17 17:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-16 12:34 Autoboot when idling at prompt possible? Konstantin Kletschke
2023-03-16 12:51 ` Ahmad Fatoum
2023-03-17 17:35   ` Konstantin Kletschke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox