summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorPatrice Chotard <patrice.chotard@st.com>2019-04-11 11:13:13 +0200
committerTom Rini <trini@konsulko.com>2019-04-26 17:51:51 -0400
commitee8a4a3f9de011de306238a124680e9511c7a5f5 (patch)
treee1e3762d7285c5fc416bd6ddc0b2684b6391800f /cmd
parent9bdfe290e9796dcbb87e3a079730391886a0099d (diff)
cmd: pxe: Display splashscreen from extlinux.conf input
The objective is to provide a simple way to retrieve a BMP file, and display it as splashscreen, from extlinux.conf file input. For this, we take example on https://www.syslinux.org/wiki/ index.php?title=Menu#The_advanced_menu_system and more particularly on MENU BACKGROUND chapter. For this, add "menu background" support in pxe command. As example, extlinux.conf content will look like: # Generic Distro Configuration file generated by OpenEmbedded menu title Select the boot mode TIMEOUT 20 menu background ../splash.bmp DEFAULT stm32mp157c-ev1-sdcard LABEL stm32mp157c-ev1-sdcard KERNEL /uImage FDT /stm32mp157c-ev1.dtb APPEND root=/dev/mmcblk0p6 rootwait rw earlyprintk console=ttySTM0,115200 Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/pxe.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/cmd/pxe.c b/cmd/pxe.c
index 274555319b..e77770237c 100644
--- a/cmd/pxe.c
+++ b/cmd/pxe.c
@@ -8,11 +8,13 @@
#include <command.h>
#include <malloc.h>
#include <mapmem.h>
+#include <lcd.h>
#include <linux/string.h>
#include <linux/ctype.h>
#include <errno.h>
#include <linux/list.h>
#include <fs.h>
+#include <splash.h>
#include <asm/io.h>
#include "menu.h"
@@ -488,6 +490,7 @@ struct pxe_label {
*
* title - the name of the menu as given by a 'menu title' line.
* default_label - the name of the default label, if any.
+ * bmp - the bmp file name which is displayed in background
* timeout - time in tenths of a second to wait for a user key-press before
* booting the default label.
* prompt - if 0, don't prompt for a choice unless the timeout period is
@@ -498,6 +501,7 @@ struct pxe_label {
struct pxe_menu {
char *title;
char *default_label;
+ char *bmp;
int timeout;
int prompt;
struct list_head labels;
@@ -850,6 +854,7 @@ enum token_type {
T_FDTDIR,
T_ONTIMEOUT,
T_IPAPPEND,
+ T_BACKGROUND,
T_INVALID
};
@@ -883,6 +888,7 @@ static const struct token keywords[] = {
{"fdtdir", T_FDTDIR},
{"ontimeout", T_ONTIMEOUT,},
{"ipappend", T_IPAPPEND,},
+ {"background", T_BACKGROUND,},
{NULL, T_INVALID}
};
@@ -1160,6 +1166,10 @@ static int parse_menu(cmd_tbl_t *cmdtp, char **c, struct pxe_menu *cfg,
nest_level + 1);
break;
+ case T_BACKGROUND:
+ err = parse_sliteral(c, &cfg->bmp);
+ break;
+
default:
printf("Ignoring malformed menu command: %.*s\n",
(int)(*c - s), s);
@@ -1574,6 +1584,20 @@ static void handle_pxe_menu(cmd_tbl_t *cmdtp, struct pxe_menu *cfg)
struct menu *m;
int err;
+#ifdef CONFIG_CMD_BMP
+ /* display BMP if available */
+ if (cfg->bmp) {
+ if (get_relfile(cmdtp, cfg->bmp, load_addr)) {
+ run_command("cls", 0);
+ bmp_display(load_addr,
+ BMP_ALIGN_CENTER, BMP_ALIGN_CENTER);
+ } else {
+ printf("Skipping background bmp %s for failure\n",
+ cfg->bmp);
+ }
+ }
+#endif
+
m = pxe_menu_to_menu(cfg);
if (!m)
return;