diff options
author | Erwan Velu <erwan.velu@free.fr> | 2009-11-20 22:00:50 +0100 |
---|---|---|
committer | Erwan Velu <erwan.velu@free.fr> | 2009-11-20 22:00:50 +0100 |
commit | f0b40f9bcf9630de643691de835d18e4e22c2093 (patch) | |
tree | 548fde34342dedbb81df6301ea09c2b6e61bc34c | |
parent | e9af8d807c3ab7b1a880bb307454481fd9a7150e (diff) | |
download | syslinux-f0b40f9bcf9630de643691de835d18e4e22c2093.tar.gz |
hdt: Adding background image for the CLI
Impact: Visual
The cli now features a background image when started in vesa mode
-rw-r--r-- | com32/hdt/Makefile | 5 | ||||
-rw-r--r-- | com32/hdt/art/backgnd.png | bin | 0 -> 10155 bytes | |||
-rw-r--r-- | com32/hdt/hdt-common.c | 20 | ||||
-rw-r--r-- | com32/hdt/hdt-common.h | 7 | ||||
-rw-r--r-- | com32/hdt/hdt.c | 20 |
5 files changed, 37 insertions, 15 deletions
diff --git a/com32/hdt/Makefile b/com32/hdt/Makefile index abe21f5f..48519805 100644 --- a/com32/hdt/Makefile +++ b/com32/hdt/Makefile @@ -37,7 +37,8 @@ ISOLINUX_DIR ?= isolinux FLOPPY_DIR ?= floppy PCI_IDS_FILE ?= $(PWD)/$(FLOPPY_DIR)/pci.ids GZ_PCI_IDS_FILE ?= $(PCI_IDS_FILE).gz -REBOOT_COM32 ?= $(com32)/modules/reboot.c32 +REBOOT_COM32 ?= $(com32)/modules/reboot.c32 +ART_DIR ?= art/ all: $(MODULES) $(TESTFILES) @@ -56,6 +57,7 @@ hdt.img: hdt.c32 $(FLOPPY_DIR)/hdt.cfg $(FLOPPY_DIR)/mtools.conf $(topdir)/mtool MTOOLSRC=$(PWD)/$(FLOPPY_DIR)/mtools.conf $(MCOPY) $(REBOOT_COM32) a: @ [ -f $(GZ_PCI_IDS_FILE) ] && MTOOLSRC=$(PWD)/$(FLOPPY_DIR)/mtools.conf $(MCOPY) $(GZ_PCI_IDS_FILE) a:pci.ids || printf "\nThe $(GZ_PCI_IDS_FILE) file is missing and can be downloaded from http://pciids.sourceforge.net and gzipped in\nthe ./com32/hdt/$(FLOPPY_DIR) directory of the extracted Syslinux source.\n\n" MTOOLSRC=$(PWD)/$(FLOPPY_DIR)/mtools.conf $(MCOPY) $(FLOPPY_DIR)/hdt.cfg a:syslinux.cfg + MTOOLSRC=$(PWD)/$(FLOPPY_DIR)/mtools.conf $(MCOPY) $(ART_DIR)/* a: hdt.img.gz: hdt.img rm -rf hdt.img.gz @@ -69,6 +71,7 @@ hdt.iso: hdt.c32 $(topdir)/core/isolinux.bin $(FLOPPY_DIR)/hdt.cfg cp $(FLOPPY_DIR)/hdt.cfg $(ISO_DIR)/$(ISOLINUX_DIR)/isolinux.cfg cp hdt.c32 $(ISO_DIR)/$(ISOLINUX_DIR) cp $(REBOOT_COM32) $(ISO_DIR)/$(ISOLINUX_DIR) + cp -av $(ART_DIR)/* $(ISO_DIR)/$(ISOLINUX_DIR) -[ ! -f $(GZ_PCI_IDS_FILE) ] && cp /usr/share/hwdata/pci.ids $(PCI_IDS_FILE) && $(GZIP) $(PCI_IDS_FILE) -[ ! -f $(GZ_PCI_IDS_FILE) ] && cp /usr/share/pci.ids $(PCI_IDS_FILE) && $(GZIP) $(PCI_IDS_FILE) -[ -f $(MODULES_ALIAS_FILE) ] && cp $(MODULES_ALIAS_FILE) $(ISO_DIR)/$(ISOLINUX_DIR)\ diff --git a/com32/hdt/art/backgnd.png b/com32/hdt/art/backgnd.png Binary files differnew file mode 100644 index 00000000..a51efeb0 --- /dev/null +++ b/com32/hdt/art/backgnd.png diff --git a/com32/hdt/hdt-common.c b/com32/hdt/hdt-common.c index cdcd6954..01ef8b1f 100644 --- a/com32/hdt/hdt-common.c +++ b/com32/hdt/hdt-common.c @@ -37,12 +37,12 @@ #include <disk/mbrs.h> /* ISOlinux requires a 8.3 format */ -void convert_isolinux_filename(char *filename, struct s_hardware *hardware) { +void *convert_isolinux_filename(char *filename, struct s_hardware *hardware) { /* Exit if we are not running ISOLINUX */ if (hardware->sv->filesystem != SYSLINUX_FS_ISOLINUX) return; /* Searching the dot */ char *dot=strchr(filename,'.'); - /* Exiting if not dot exists in that string */ + /* Exiting if no dot exists in that string */ if (dot==NULL) return; /* Exiting if the extension is 3 char or less */ if (strlen(dot)<=4) return; @@ -640,3 +640,19 @@ char *del_multi_spaces(char *p) { void reset_more_printf() { display_line_nb=0; } + +int draw_background(const char *what) +{ + if (!what) + return vesacon_default_background(); + else + return vesacon_load_background(what); +} + +void init_console() { + if (vesamode) { + openconsole(&dev_rawcon_r, &dev_vesaserial_w); + draw_background(CLI_BACKGROUND); + } + else console_ansi_raw(); +} diff --git a/com32/hdt/hdt-common.h b/com32/hdt/hdt-common.h index cd1dc3ca..b231ad70 100644 --- a/com32/hdt/hdt-common.h +++ b/com32/hdt/hdt-common.h @@ -30,6 +30,9 @@ #define DEFINE_HDT_COMMON_H #include <stdio.h> #include <syslinux/pxe.h> +#include <console.h> +#include <consoles.h> +#include <syslinux/vesacon.h> #include "sys/pci.h" #include <disk/bootloaders.h> @@ -66,6 +69,9 @@ /* The char that surround the list of commands */ #define AUTO_DELIMITER "'" +/* Graphic to load in background when using the vesa mode */ +#define CLI_BACKGROUND "backgnd.png" + /* Defines if the cli is quiet*/ bool quiet; @@ -206,4 +212,5 @@ void detect_syslinux(struct s_hardware *hardware); void detect_parameters(const int argc, const char *argv[], struct s_hardware *hardware); int detect_vesa(struct s_hardware *hardware); +void init_console(); #endif diff --git a/com32/hdt/hdt.c b/com32/hdt/hdt.c index 6daf3ae4..73cd8903 100644 --- a/com32/hdt/hdt.c +++ b/com32/hdt/hdt.c @@ -33,9 +33,6 @@ */ #include <stdio.h> -#include <console.h> -#include <consoles.h> -#include <syslinux/vesacon.h> #include "hdt.h" #include "hdt-cli.h" #include "hdt-menu.h" @@ -56,23 +53,22 @@ int main(const int argc, const char *argv[]) snprintf(version_string, sizeof version_string, "%s %s (%s)", PRODUCT_NAME,VERSION, CODENAME); - /* Detecting parameters */ - detect_parameters(argc, argv, &hardware); - - /* Opening the Syslinux console */ - if (vesamode) openconsole(&dev_rawcon_r, &dev_vesaserial_w); - else console_ansi_raw(); - /* Cleaning structures */ init_hardware(&hardware); /* Detecting Syslinux version */ detect_syslinux(&hardware); - + + /* Detecting parameters */ + detect_parameters(argc, argv, &hardware); + + /* Opening the Syslinux console */ + init_console(); + /* Clear the screen and reset position of the cursor */ clear_screen(); printf("\033[1;1H"); - + printf("%s\n", version_string); if ((arg = find_argument(argv + 1, "nomenu")) || (find_argument(argv+1,"auto"))) |