summaryrefslogtreecommitdiffstats
path: root/common/boot.c
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2016-08-24 12:22:40 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-09-22 11:44:23 +0200
commitcc532a3f733718526898c14f8137118b7d76a5bc (patch)
tree2addc58100c74b55f6477012f1d2f4df27de0c99 /common/boot.c
parent6d8beeaad1e1133ae48664223793394310b1db46 (diff)
downloadbarebox-cc532a3f733718526898c14f8137118b7d76a5bc.tar.gz
barebox-cc532a3f733718526898c14f8137118b7d76a5bc.tar.xz
boot: add framework for redundant boot scenarios
There are several use cases where a redundant Linux system is needed. The barebox bootchooser framework provides the building blocks to model different use cases without the need to start from the scratch over and over again. The bootchooser works on abstract boot targets, each with a set of properties and implements an algorithm which selects the highest priority target to boot. See the documentation contained in this patch for more information. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/boot.c')
-rw-r--r--common/boot.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/common/boot.c b/common/boot.c
index a971cb7a30..123b874b3c 100644
--- a/common/boot.c
+++ b/common/boot.c
@@ -10,6 +10,7 @@
*/
#include <environment.h>
+#include <bootchooser.h>
#include <globalvar.h>
#include <magicvar.h>
#include <watchdog.h>
@@ -274,6 +275,12 @@ int bootentry_create_from_name(struct bootentries *bootentries,
}
}
+ if (IS_ENABLED(CONFIG_BOOTCHOOSER) && !strcmp(name, "bootchooser")) {
+ ret = bootchooser_create_bootentry(bootentries);
+ if (ret > 0)
+ found += ret;
+ }
+
if (!found) {
char *path;