commands: boot: create boot entries on demand
We currently create all boot entries before attempting boot. This is
less than optimal, because this may involve probing devices that won't
be used for actual boot.

Fix this by not creating boot entries till the previous boot argument
(command line argument or boot.default word) was found to be unbootable.

This means that "boot mmc1 mmc0" will now not touch mmc0 if mmc1 had a
bootable entry. This is only done when no menu or list was requested.

As the boot entries are in a linked list, the allocation done for each
boot argument could be omitted, but as the saving from skipping an
allocation is easily dwarfed by the boot medium access, we just
reallocate and enjoy the improved code clarity.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent 4c368ee commit e43eed6606e44574d665b3338b701da1035c504e
@Ahmad Fatoum Ahmad Fatoum authored on 12 Feb 2020
Sascha Hauer committed on 14 Feb 2020
Showing 1 changed file
View
commands/boot.c