Discussion:
Bootchooser - remaining_attempts
Çağlar Kilimci
2017-07-05 12:36:46 UTC
Permalink
Hi all,

I am using barebox 2017.03.0 and my bootchooser variables are:
bootchooser.last_chosen: 2
bootchooser.retry: true
bootchooser.system1.boot: system1
bootchooser.system1.default_attempts: 99
bootchooser.system1.default_priority: 16
bootchooser.system1.priority: 20
bootchooser.system1.remaining_attempts: 5
bootchooser.system2.boot: system2
bootchooser.system2.default_attempts: 9
bootchooser.system2.default_priority: 15
bootchooser.system2.priority: 10
bootchooser.system2.remaining_attempts: 3
bootchooser.targets: system1 system2

And "global.bootchooser.reset_attempts" is empty. I assume counters
will never be reset as written in [1].

So, here is the case that I think it has a problem. system1 has a
problem that does not boot. Bootchooser tries system1 and fails a few
times and then chooses system2. After successful boot of system2,
"bootchooser.system1.remaining_attempts" is still 5. Every boot
sequence bootchooser tries system1 and fails and then system2 is
chosen. If I understand correctly from the documentation, it should be
0 and disabled and will never try at all. Right?

Secondly, There is a bug: if bootchooser.system1.remaining_attempts is
big enough like 10, bootchooser tries to boot system1 as usual and
fails as usual again but it could not boot system2. I am sending the
log below, as a summary "could not open /boot/barebox.env: error 24":
booting 'system1'
sorry, no nested mounts
mount: Device or resource busy
could not open /mnt/rootfs1/boot/zImage: No such file or directory
Booting 'system1' failed: No such file or directory
booting 'system1' failed: No such file or directory
could not open /boot/barebox.env: error 24
Nothing bootable found on 'system2'
Nothing bootable found on 'system2'
Nothing bootable found on 'system2'
bootchooser: No valid targets found:
system1
id: 1
priority: 20
default_priority: 16
remaining attempts: 0
default attempts: 99
boot: 'system1'
disabled due to remaining attempts = 0
system2
id: 2
priority: 10
default_priority: 15
remaining attempts: 0
default attempts: 9
boot: 'system2'
disabled due to remaining attempts = 0
booting 'bootchooser' failed: No such file or directory


[1] http://barebox.org/doc/latest/user/bootchooser.html?highlight=reset_attempts

Sincerely,
--
Çağlar Kilimci
Çağlar Kilimci
2017-07-10 06:48:01 UTC
Permalink
Hello everyone,

I am still producing the same problem with
"global.bootchooser.reset_attempts". I would appreciate any ideas.

Sincerely,
Post by Çağlar Kilimci
Hi all,
bootchooser.last_chosen: 2
bootchooser.retry: true
bootchooser.system1.boot: system1
bootchooser.system1.default_attempts: 99
bootchooser.system1.default_priority: 16
bootchooser.system1.priority: 20
bootchooser.system1.remaining_attempts: 5
bootchooser.system2.boot: system2
bootchooser.system2.default_attempts: 9
bootchooser.system2.default_priority: 15
bootchooser.system2.priority: 10
bootchooser.system2.remaining_attempts: 3
bootchooser.targets: system1 system2
And "global.bootchooser.reset_attempts" is empty. I assume counters
will never be reset as written in [1].
So, here is the case that I think it has a problem. system1 has a
problem that does not boot. Bootchooser tries system1 and fails a few
times and then chooses system2. After successful boot of system2,
"bootchooser.system1.remaining_attempts" is still 5. Every boot
sequence bootchooser tries system1 and fails and then system2 is
chosen. If I understand correctly from the documentation, it should be
0 and disabled and will never try at all. Right?
Secondly, There is a bug: if bootchooser.system1.remaining_attempts is
big enough like 10, bootchooser tries to boot system1 as usual and
fails as usual again but it could not boot system2. I am sending the
booting 'system1'
sorry, no nested mounts
mount: Device or resource busy
could not open /mnt/rootfs1/boot/zImage: No such file or directory
Booting 'system1' failed: No such file or directory
booting 'system1' failed: No such file or directory
could not open /boot/barebox.env: error 24
Nothing bootable found on 'system2'
Nothing bootable found on 'system2'
Nothing bootable found on 'system2'
system1
id: 1
priority: 20
default_priority: 16
remaining attempts: 0
default attempts: 99
boot: 'system1'
disabled due to remaining attempts = 0
system2
id: 2
priority: 10
default_priority: 15
remaining attempts: 0
default attempts: 9
boot: 'system2'
disabled due to remaining attempts = 0
booting 'bootchooser' failed: No such file or directory
[1] http://barebox.org/doc/latest/user/bootchooser.html?highlight=reset_attempts
Sincerely,
--
Çağlar Kilimci
--
Çağlar Kilimci
Martin Hollingsworth
2017-07-11 09:45:27 UTC
Permalink
Hello Caglar,
I am no expert in bootchooser, but I am currently implementing it on an imx6 board using barebox 2017-3.

Regarding the first issue. These are my settings, with them target A is successfully disabled after 5 attempts and never automatically enabled again.
I set the "default_xxx" values within the config-board script of my barebox default-environment. I do not set the current values (like "A.remaining_attempts") within the environment. They are generated on the first execution of bootchooser and stored within the nv variables. Do you maybe accidentally overwrite the current values on startup with some script from the environment? (happened to me ^^^).
Have you tried explicitly configuring global.bootchooser.reset_attempts='' as empty, instead of not defining it?

<<< from: config-board <<<<<<
# General bootchooser settings
global.bootchooser.disable_on_zero_attempts=0
global.bootchooser.default_attempts=5
global.bootchooser.default_priority=1
global.bootchooser.reset_attempts=''
global.bootchooser.reset_priorities=''
global.bootchooser.retry=1
global.bootchooser.targets="A B"

# Slot "A" default configuration
nv bootchooser.A.boot=A
nv bootchooser.A.default_attempts=5
nv bootchooser.A.default_priority=10

# Slot "B" default configuration
nv bootchooser.B.boot=B
nv bootchooser.B.default_attempts=1
nv bootchooser.B.default_priority=5
<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Regards,
Martin Hollingsworth
Çağlar Kilimci
2017-07-12 07:08:16 UTC
Permalink
Hello Martin,

Firstly, thank you for your reply.

2017-07-11 12:45 GMT+03:00 Martin Hollingsworth
Post by Martin Hollingsworth
Hello Caglar,
I am no expert in bootchooser, but I am currently implementing it on an imx6 board using barebox 2017-3.
Regarding the first issue. These are my settings, with them target A is successfully disabled after 5 attempts and never automatically enabled again.
I set the "default_xxx" values within the config-board script of my barebox default-environment. I do not set the current values (like "A.remaining_attempts") within the environment. They are generated on the first execution of bootchooser and stored within the nv variables. Do you maybe accidentally overwrite the current values on startup with some script from the environment? (happened to me ^^^).
Have you tried explicitly configuring global.bootchooser.reset_attempts='' as empty, instead of not defining it?
Actually, no. I did not intentionally set reset_attempts as an empty
string. As your recommend, while setting it as an empty string, I saw
that each boot time I am setting bootchooser variable from the state
framework:

nv bootchooser.system1.boot=$state.bootchooser.system1.boot
nv bootchooser.system1.default_attempts=$state.bootchooser.system1.default_attempts
nv bootchooser.system1.remaining_attempts=$state.bootchooser.system1.remaining_attempts
nv bootchooser.system1.default_priority=$state.bootchooser.system1.default_priority
nv bootchooser.system1.priority=$state.bootchooser.system1.priority

nv bootchooser.system2.boot=$state.bootchooser.system2.boot
nv bootchooser.system2.default_attempts=$state.bootchooser.system2.default_attempts
nv bootchooser.system2.remaining_attempts=$state.bootchooser.system2.remaining_attempts
nv bootchooser.system2.default_priority=$state.bootchooser.system2.default_priority
nv bootchooser.system2.priority=$state.bootchooser.system2.priority

I am now decreasing 1 from the state each boot time. After enough
unsuccessful attempts, it is disabled and never enabled again.

Thanks again.

Best Regards,
--
Çağlar Kilimci
B Gol
2017-07-11 10:48:33 UTC
Permalink
According to the following passage of the documentation, I suggest you check and see if the "global.system.reset" is causing the problem.

power-on: The remaining_attempts counters of all enabled targets are reset after a power-on reset ($global.system.reset="POR"). This means after a power cycle all targets will be tried again for the configured number of retries
all-zero: The remaining_attempts counters of all enabled targets are reset when none of them has any remaining_attempts left.

_______________________________________________

barebox mailing list

***@lists.infradead.org

http://lists.infradead.org/mailman/listinfo/barebox
Loading...