1 From e8688b7a6586cc634cef130b199d6c6b04422b21 Mon Sep 17 00:00:00 2001
2 From: Marc Andre Tanner <mat@brain-dump.org>
3 Date: Wed, 2 Dec 2009 01:27:59 +0100
4 Subject: [PATCH 1/3] Add functionality to load a specific kernel upon button press
6 Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>
9 src/phase2.c | 10 +++++++++-
10 2 files changed, 13 insertions(+), 1 deletions(-)
12 diff --git a/include/qi.h b/include/qi.h
13 index b99695d..62130e3 100644
16 @@ -45,6 +45,7 @@ enum filesystem {
18 UI_ACTION_ADD_DEBUG = (1 << 0),
19 UI_ACTION_SKIPKERNEL = (1 << 1),
20 + UI_ACTION_UI_KERNEL = (1 << 2),
24 @@ -110,6 +111,9 @@ struct board_api {
25 void (*set_ui_indication)(enum ui_indication);
27 struct kernel_source kernel_source[8];
28 + /* index into the array above, if this is != 0 then the corresponding
29 + * kernel will be loaded upon the UI_ACTION_UI_KERNEL event */
33 /* this is the board we are running on */
34 diff --git a/src/phase2.c b/src/phase2.c
35 index 4a7ff18..6889503 100644
38 @@ -469,8 +469,16 @@ void bootloader_second_phase(void)
39 /* we try the possible kernels for this board in order */
41 for (this_kernel = this_board->kernel_source; this_kernel->name;
44 + if (this_board->kernel_ui && this_board->get_ui_keys &&
45 + this_board->get_ui_keys() & UI_ACTION_UI_KERNEL) {
46 + this_kernel = &this_board->kernel_source[this_board->kernel_ui];
48 + puts("Failed to boot UI Kernel\n");
54 /* none of the kernels worked out */