SHA256
1
0
forked from pool/syslinux

- update to version 4.03

* Major code base changes; all filesystem rewritten in C.
    This work was done primarily by Liu Aleaxander (Yuanhan Liu).
  * Better support for booting from MBRs which don't pass
    handover information.
  * EXTLINUX: Try to be smarter about finding the partition
    offset.
  * chain.c32: support chainloading Dell Real Mode Kernel (Gene
    Cumm).
  * chain.c32: fix booting in CHS mode.
  * Fix the -s option to the syslinux/extlinux installer (Arwin
    Vosselman).
  * isohybrid: fix padding of large images (PJ Pandit).
  * SYSLINUX: correctly handle the case where the -d option is
    specified with a non-absolute path, i.e. "syslinux -d
    syslinux" instead of "syslinux -d /syslinux".
  * ISOLINUX: recognize the directory names /boot/syslinux and
    /syslinux, and the filename syslinux.cfg in addition to the
    isolinux-specific names.  Thus, "syslinux.cfg" is now a
    generic name, whereas "isolinux.cfg" or "extlinux.conf" is
    specific to different derivative.
  * chain.c32: support setting alternate config filename for
    stage2 of GRUB Legacy (Gert Hulselmans).
  * whichsys.c32: execute specific command, based on Syslinux
    bootloader variant (Gert Hulselmans).
  * lua.c32: a lot of new bindings added to the "syslinux"
    namespace: VESA, PCI, DMI, kernel loading (Marcel Ritter).
  * btrfs: print a comprehensive error message if compressed or
    encrypted files are encountered (neither is currently

OBS-URL: https://build.opensuse.org/package/show/system:install:head/syslinux?expand=0&rev=25
This commit is contained in:
Steffen Winterfeldt 2011-04-18 16:02:08 +00:00 committed by Git OBS Bridge
parent c059874482
commit 645ce1e6ec
13 changed files with 233 additions and 3782 deletions

View File

@ -1,4 +1,4 @@
gfxboot is now loaded via a COM module. If you used a line like
gfxboot is now loaded via a COM32 module. If you used a line like
gfxboot bootlogo
@ -6,7 +6,7 @@ before in isolinux.cfg or syslinux.cfg, change this to
ui gfxboot bootlogo
and add /usr/share/syslinux/gfxboot.com to your boot directory (the one
and add /usr/share/syslinux/gfxboot.c32 to your boot directory (the one
where the config file is).
You can also use

View File

@ -26,14 +26,21 @@ open F, $file or die "$file: $!\n";
sysread F, $file_buf, -s($file);
close F;
die "$file: is not isolinux\n" unless (length $file_buf > (8 << 10)) && ($file_buf =~ m#(/boot(/[\x20-\xff]*)\x00*)\x00isolinux.cfg\x00#s);
if((length $file_buf > (8 << 10)) && ($file_buf =~ m#(/boot(/[\x20-\xff]*)\x00*)\x00isolinux.cfg\x00#s)) {
$format = 1;
}
elsif((length $file_buf > (8 << 10)) && ($file_buf =~ m#(/boot(/[\x20-\xff]*)\x00*)\x00/boot/syslinux\x00#s)) {
$format = 2;
}
die "$file: is not isolinux\n" unless $format;
$start = length $`;
$base_buf = $1;
$old_base = $2;
if(defined $opt_base) {
($base = $opt_base) =~ s#^/*##;;
($base = $opt_base) =~ s#^/*##;
$base = "/boot/$base";
die "$opt_base: file name too long\n" if length($base) > length($base_buf);

View File

@ -1,686 +0,0 @@
From b6b0153590283ea5c19973837b2978710f170b29 Mon Sep 17 00:00:00 2001
From: Steffen Winterfeldt <wfeldt@opensuse.org>
Date: Tue, 13 Apr 2010 17:38:39 +0200
Subject: [PATCH 1/4] support MENU LABEL statement
Signed-off-by: Steffen Winterfeldt <wfeldt@opensuse.org>
---
com32/gfxboot/gfxboot.c | 49 +++++++++++++++++++++++++++++++++++++---------
1 files changed, 39 insertions(+), 10 deletions(-)
diff --git a/com32/gfxboot/gfxboot.c b/com32/gfxboot/gfxboot.c
index bfdd8cc..e0ff8f5 100644
--- a/com32/gfxboot/gfxboot.c
+++ b/com32/gfxboot/gfxboot.c
@@ -165,7 +165,7 @@ void gfx_done(void);
int gfx_input(void);
ssize_t save_read(int fd, void *buf, size_t size);
void *load_one(char *file, ssize_t *file_size);
-void boot(void);
+void boot(int index);
void boot_entry(menu_t *menu_ptr, char *arg);
@@ -234,7 +234,7 @@ int main(int argc, char **argv)
}
// does not return if it succeeds
- boot();
+ boot(menu_index);
}
if(argc > 2) show_message(argv[2]);
@@ -374,6 +374,20 @@ int read_config_file(void)
(menu_ptr ?: menu_default)->ipappend = strdup(t);
continue;
}
+
+ if(!strcmp(s, "menu") && menu_ptr) {
+ s = skip_spaces(t);
+ t = skip_nonspaces(s);
+ if(*t) *t++ = 0;
+ t = skip_spaces(t);
+
+ if(!strcmp(s, "label")) {
+ menu_ptr->label = strdup(t);
+ u = strlen(t);
+ if(u > label_size) label_size = u;
+ continue;
+ }
+ }
}
fclose(f);
@@ -686,20 +700,35 @@ void *load_one(char *file, ssize_t *file_size)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// Locate menu entry and boot.
+// Boot menu entry.
//
-void boot(void)
+// cmdline can optionally start with label string.
+//
+void boot(int index)
{
- char *label, *arg, *s;
+ char *arg;
menu_t *menu_ptr;
+ int label_len;
+
+ for(menu_ptr = menu; menu_ptr; menu_ptr = menu_ptr->next, index--) {
+ if(!index) break;
+ }
+
+ // invalid index or menu entry
+ if(!menu_ptr || !menu_ptr->label) return;
- label = skip_spaces(cmdline);
- arg = skip_spaces(s = skip_nonspaces(label));
- *s = 0;
+ arg = skip_spaces(cmdline);
+ label_len = strlen(menu_ptr->label);
- for(menu_ptr = menu; menu_ptr; menu_ptr = menu_ptr->next) {
- if(menu_ptr->label && !strcmp(menu_ptr->label, label)) break;
+ // if it does not start with label string, skip first word
+ if(strncmp(arg, menu_ptr->label, label_len)) {
+ arg = skip_nonspaces(arg);
}
+ else {
+ arg += label_len;
+ }
+
+ arg = skip_spaces(arg);
boot_entry(menu_ptr, arg);
}
--
1.6.4.2
From 190f963602576b46ef3b01543f5a586bea84156c Mon Sep 17 00:00:00 2001
From: Steffen Winterfeldt <wfeldt@opensuse.org>
Date: Tue, 13 Apr 2010 17:39:46 +0200
Subject: [PATCH 2/4] make config statements case-insensitive
Signed-off-by: Steffen Winterfeldt <wfeldt@opensuse.org>
---
com32/gfxboot/gfxboot.c | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/com32/gfxboot/gfxboot.c b/com32/gfxboot/gfxboot.c
index e0ff8f5..c300dcb 100644
--- a/com32/gfxboot/gfxboot.c
+++ b/com32/gfxboot/gfxboot.c
@@ -321,19 +321,19 @@ int read_config_file(void)
if(*t) *t++ = 0;
t = skip_spaces(t);
- if(!strcmp(s, "timeout")) {
+ if(!strcasecmp(s, "timeout")) {
timeout = atoi(t);
continue;
}
- if(!strcmp(s, "default")) {
+ if(!strcasecmp(s, "default")) {
menu_default->label = strdup(t);
u = strlen(t);
if(u > label_size) label_size = u;
continue;
}
- if(!strcmp(s, "label")) {
+ if(!strcasecmp(s, "label")) {
menu_ptr = *menu_next = calloc(1, sizeof **menu_next);
menu_next = &menu_ptr->next;
menu_idx++;
@@ -343,45 +343,45 @@ int read_config_file(void)
continue;
}
- if(!strcmp(s, "kernel") && menu_ptr) {
+ if(!strcasecmp(s, "kernel") && menu_ptr) {
menu_ptr->kernel = strdup(t);
continue;
}
- if(!strcmp(s, "linux") && menu_ptr) {
+ if(!strcasecmp(s, "linux") && menu_ptr) {
menu_ptr->linux = strdup(t);
continue;
}
- if(!strcmp(s, "localboot") && menu_ptr) {
+ if(!strcasecmp(s, "localboot") && menu_ptr) {
menu_ptr->localboot = strdup(t);
continue;
}
- if(!strcmp(s, "initrd") && menu_ptr) {
+ if(!strcasecmp(s, "initrd") && menu_ptr) {
menu_ptr->initrd = strdup(t);
continue;
}
- if(!strcmp(s, "append")) {
+ if(!strcasecmp(s, "append")) {
(menu_ptr ?: menu_default)->append = strdup(t);
u = strlen(t);
if(u > append_size) append_size = u;
continue;
}
- if(!strcmp(s, "ipappend")) {
+ if(!strcasecmp(s, "ipappend")) {
(menu_ptr ?: menu_default)->ipappend = strdup(t);
continue;
}
- if(!strcmp(s, "menu") && menu_ptr) {
+ if(!strcasecmp(s, "menu") && menu_ptr) {
s = skip_spaces(t);
t = skip_nonspaces(s);
if(*t) *t++ = 0;
t = skip_spaces(t);
- if(!strcmp(s, "label")) {
+ if(!strcasecmp(s, "label")) {
menu_ptr->label = strdup(t);
u = strlen(t);
if(u > label_size) label_size = u;
--
1.6.4.2
From 0c511ba970405ea54c8fd6c351f20137966b5e89 Mon Sep 17 00:00:00 2001
From: Steffen Winterfeldt <wfeldt@opensuse.org>
Date: Tue, 13 Apr 2010 17:42:12 +0200
Subject: [PATCH 3/4] handle IPAPPEND
Signed-off-by: Steffen Winterfeldt <wfeldt@opensuse.org>
---
com32/gfxboot/gfxboot.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/com32/gfxboot/gfxboot.c b/com32/gfxboot/gfxboot.c
index c300dcb..daf0056 100644
--- a/com32/gfxboot/gfxboot.c
+++ b/com32/gfxboot/gfxboot.c
@@ -709,6 +709,8 @@ void boot(int index)
char *arg;
menu_t *menu_ptr;
int label_len;
+ unsigned u, ipapp;
+ const struct syslinux_ipappend_strings *ipappend;
for(menu_ptr = menu; menu_ptr; menu_ptr = menu_ptr->next, index--) {
if(!index) break;
@@ -730,6 +732,16 @@ void boot(int index)
arg = skip_spaces(arg);
+ // handle IPAPPEND
+ if(menu_ptr->ipappend && (ipapp = atoi(menu_ptr->ipappend))) {
+ ipappend = syslinux_ipappend_strings();
+ for(u = 0; u < ipappend->count; u++) {
+ if((ipapp & (1 << u)) && ipappend->ptr[u]) {
+ sprintf(arg + strlen(arg), " %s", ipappend->ptr[u]);
+ }
+ }
+ }
+
boot_entry(menu_ptr, arg);
}
--
1.6.4.2
From 9a0a0e2307ffa0140fe6ea4a31c2f4040176513d Mon Sep 17 00:00:00 2001
From: Steffen Winterfeldt <wfeldt@opensuse.org>
Date: Tue, 13 Apr 2010 17:42:44 +0200
Subject: [PATCH 4/4] turn off graphics before starting kernel
Signed-off-by: Steffen Winterfeldt <wfeldt@opensuse.org>
---
com32/gfxboot/gfxboot.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/com32/gfxboot/gfxboot.c b/com32/gfxboot/gfxboot.c
index daf0056..96aadd8 100644
--- a/com32/gfxboot/gfxboot.c
+++ b/com32/gfxboot/gfxboot.c
@@ -848,6 +848,8 @@ void boot_entry(menu_t *menu_ptr, char *arg)
__farcall(gfx.code_seg, gfx.jmp_table[GFX_CB_PROGRESS_DONE], &r, &r);
+ gfx_done();
+
syslinux_boot_linux(kernel, kernel_size, initrd, arg);
}
--
1.6.4.2
From 6d89bc005f25b923728822706bf508ea7ebc1714 Mon Sep 17 00:00:00 2001
From: Steffen Winterfeldt <wfeldt@opensuse.org>
Date: Wed, 14 Apr 2010 17:43:16 +0200
Subject: [PATCH] fix localboot
Signed-off-by: Steffen Winterfeldt <wfeldt@opensuse.org>
---
com32/gfxboot/gfxboot.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/com32/gfxboot/gfxboot.c b/com32/gfxboot/gfxboot.c
index 96aadd8..3460c18 100644
--- a/com32/gfxboot/gfxboot.c
+++ b/com32/gfxboot/gfxboot.c
@@ -766,7 +766,7 @@ void boot_entry(menu_t *menu_ptr, char *arg)
if(menu_ptr->localboot) {
gfx_done();
- syslinux_local_boot(atoi(arg));
+ syslinux_local_boot(strtol(menu_ptr->localboot, NULL, 0));
return;
}
--
1.6.4.2
From 19dfdc33016f69e7d20f6c8eda9eb420b91577f9 Mon Sep 17 00:00:00 2001
From: Steffen Winterfeldt <wfeldt@opensuse.org>
Date: Fri, 16 Apr 2010 13:18:46 +0200
Subject: [PATCH] better error handling
Signed-off-by: Steffen Winterfeldt <wfeldt@opensuse.org>
---
com32/gfxboot/gfxboot.c | 118 +++++++++++++++++++++++++++++++++++++---------
1 files changed, 95 insertions(+), 23 deletions(-)
diff --git a/com32/gfxboot/gfxboot.c b/com32/gfxboot/gfxboot.c
index 3460c18..c5112f4 100644
--- a/com32/gfxboot/gfxboot.c
+++ b/com32/gfxboot/gfxboot.c
@@ -118,6 +118,7 @@ typedef struct menu_s {
struct menu_s *next;
char *label;
char *kernel;
+ char *alt_kernel;
char *linux;
char *localboot;
char *initrd;
@@ -149,6 +150,9 @@ char cmdline[MAX_CMDLINE_LEN];
void *save_buf;
unsigned save_buf_size;
+// progress bar is visible
+unsigned progress_active;
+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void show_message(char *file);
@@ -163,6 +167,10 @@ int gfx_init(char *file);
int gfx_menu_init(void);
void gfx_done(void);
int gfx_input(void);
+void gfx_infobox(int type, char *str1, char *str2);
+void gfx_progress_init(ssize_t kernel_size, char *label);
+void gfx_progress_update(ssize_t size);
+void gfx_progress_done(void);
ssize_t save_read(int fd, void *buf, size_t size);
void *load_one(char *file, ssize_t *file_size);
void boot(int index);
@@ -486,6 +494,8 @@ int gfx_init(char *file)
void *lowmem = lowmem_buf;
unsigned lowmem_size = lowmem_buf_size;
+ progress_active = 0;
+
printf("Loading %s...\n", file);
if(loadfile(file, &archive, &archive_size)) return 1;
@@ -603,6 +613,8 @@ void gfx_done(void)
{
com32sys_t r;
+ gfx_progress_done();
+
__farcall(gfx.code_seg, gfx.jmp_table[GFX_CB_DONE], &r, &r);
}
@@ -631,6 +643,61 @@ int gfx_input(void)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+void gfx_infobox(int type, char *str1, char *str2)
+{
+ com32sys_t r;
+
+ r.eax.l = type;
+ r.esi.l = (uint32_t) str1;
+ r.edi.l = (uint32_t) str2;
+ __farcall(gfx.code_seg, gfx.jmp_table[GFX_CB_INFOBOX_INIT], &r, &r);
+ r.edi.l = r.eax.l = 0;
+ __farcall(gfx.code_seg, gfx.jmp_table[GFX_CB_INPUT], &r, &r);
+ __farcall(gfx.code_seg, gfx.jmp_table[GFX_CB_INFOBOX_DONE], &r, &r);
+}
+
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+void gfx_progress_init(ssize_t kernel_size, char *label)
+{
+ com32sys_t r;
+
+ if(!progress_active) {
+ r.eax.l = kernel_size >> gfx_config.sector_shift; // in sectors
+ r.esi.l = (uint32_t) label;
+ __farcall(gfx.code_seg, gfx.jmp_table[GFX_CB_PROGRESS_INIT], &r, &r);
+ }
+
+ progress_active = 1;
+}
+
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+void gfx_progress_update(ssize_t advance)
+{
+ com32sys_t r;
+
+ if(progress_active) {
+ r.eax.l = advance >> gfx_config.sector_shift; // in sectors
+ __farcall(gfx.code_seg, gfx.jmp_table[GFX_CB_PROGRESS_UPDATE], &r, &r);
+ }
+}
+
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+void gfx_progress_done(void)
+{
+ com32sys_t r;
+
+ if(progress_active) {
+ __farcall(gfx.code_seg, gfx.jmp_table[GFX_CB_PROGRESS_DONE], &r, &r);
+ }
+
+ progress_active = 0;
+}
+
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Like read(2) but preserve bounce buffer.
//
ssize_t save_read(int fd, void *buf, size_t size)
@@ -652,14 +719,16 @@ void *load_one(char *file, ssize_t *file_size)
{
int fd;
void *buf = NULL;
+ char *str;
struct stat sbuf;
ssize_t size = 0, cur, i;
- com32sys_t r;
*file_size = 0;
if((fd = open(file, O_RDONLY)) == -1) {
- printf("%s: file not found\n", file);
+ asprintf(&str, "%s: file not found", file);
+ gfx_infobox(0, str, NULL);
+ free(str);
return buf;
}
@@ -671,23 +740,26 @@ void *load_one(char *file, ssize_t *file_size)
buf = malloc(size);
for(i = 1, cur = 0 ; cur < size && i > 0; cur += i) {
i = save_read(fd, buf + cur, CHUNK_SIZE);
- r.eax.l = i >> gfx_config.sector_shift;
- __farcall(gfx.code_seg, gfx.jmp_table[GFX_CB_PROGRESS_UPDATE], &r, &r);
+ if(i == -1) break;
+ gfx_progress_update(i);
}
}
else {
do {
buf = realloc(buf, size + CHUNK_SIZE);
i = save_read(fd, buf + size, CHUNK_SIZE);
+ if(i == -1) break;
size += i;
- r.eax.l = i >> gfx_config.sector_shift;
- __farcall(gfx.code_seg, gfx.jmp_table[GFX_CB_PROGRESS_UPDATE], &r, &r);
+ gfx_progress_update(i);
} while(i > 0);
}
close(fd);
if(i == -1) {
+ asprintf(&str, "%s: read error @ %d", file, size);
+ gfx_infobox(0, str, NULL);
+ free(str);
free(buf);
buf = NULL;
size = 0;
@@ -706,10 +778,10 @@ void *load_one(char *file, ssize_t *file_size)
//
void boot(int index)
{
- char *arg;
+ char *arg, *alt_kernel;
menu_t *menu_ptr;
- int label_len;
- unsigned u, ipapp;
+ int i, label_len;
+ unsigned ipapp;
const struct syslinux_ipappend_strings *ipappend;
for(menu_ptr = menu; menu_ptr; menu_ptr = menu_ptr->next, index--) {
@@ -722,9 +794,12 @@ void boot(int index)
arg = skip_spaces(cmdline);
label_len = strlen(menu_ptr->label);
- // if it does not start with label string, skip first word
+ // if it does not start with label string, assume first word is kernel name
if(strncmp(arg, menu_ptr->label, label_len)) {
+ alt_kernel = arg;
arg = skip_nonspaces(arg);
+ if(*arg) *arg++ = 0;
+ if(*alt_kernel) menu_ptr->alt_kernel = alt_kernel;
}
else {
arg += label_len;
@@ -735,14 +810,16 @@ void boot(int index)
// handle IPAPPEND
if(menu_ptr->ipappend && (ipapp = atoi(menu_ptr->ipappend))) {
ipappend = syslinux_ipappend_strings();
- for(u = 0; u < ipappend->count; u++) {
- if((ipapp & (1 << u)) && ipappend->ptr[u]) {
- sprintf(arg + strlen(arg), " %s", ipappend->ptr[u]);
+ for(i = 0; i < ipappend->count; i++) {
+ if((ipapp & (1 << i)) && ipappend->ptr[i]) {
+ sprintf(arg + strlen(arg), " %s", ipappend->ptr[i]);
}
}
}
boot_entry(menu_ptr, arg);
+
+ gfx_progress_done();
}
@@ -759,7 +836,6 @@ void boot_entry(menu_t *menu_ptr, char *arg)
char *file, *cmd_buf;
int fd;
struct stat sbuf;
- com32sys_t r;
char *s, *s0, *t, *initrd_arg;
if(!menu_ptr) return;
@@ -771,7 +847,8 @@ void boot_entry(menu_t *menu_ptr, char *arg)
return;
}
- file = menu_ptr->kernel;
+ file = menu_ptr->alt_kernel;
+ if(!file) file = menu_ptr->kernel;
if(!file) file = menu_ptr->linux;
if(!file) {
gfx_done();
@@ -782,21 +859,18 @@ void boot_entry(menu_t *menu_ptr, char *arg)
// first, load kernel
- r.eax.l = 0; // kernel size in sectors
+ kernel_size = 0;
if((fd = open(file, O_RDONLY)) >= 0) {
- if(!fstat(fd, &sbuf) && S_ISREG(sbuf.st_mode)) r.eax.l = sbuf.st_size >> gfx_config.sector_shift;
+ if(!fstat(fd, &sbuf) && S_ISREG(sbuf.st_mode)) kernel_size = sbuf.st_size;
close(fd);
}
- r.esi.l = (uint32_t) file;
- __farcall(gfx.code_seg, gfx.jmp_table[GFX_CB_PROGRESS_INIT], &r, &r);
+ gfx_progress_init(kernel_size, file);
kernel = load_one(file, &kernel_size);
if(!kernel) {
- gfx_done();
- printf("%s: read error\n", file);
return;
}
@@ -846,8 +920,6 @@ void boot_entry(menu_t *menu_ptr, char *arg)
free(s0);
- __farcall(gfx.code_seg, gfx.jmp_table[GFX_CB_PROGRESS_DONE], &r, &r);
-
gfx_done();
syslinux_boot_linux(kernel, kernel_size, initrd, arg);
--
1.6.4.2
From bf3fd44448fb81ac481a2a1ac6d90f5a27e4d1de Mon Sep 17 00:00:00 2001
From: Steffen Winterfeldt <wfeldt@opensuse.org>
Date: Mon, 19 Apr 2010 15:17:57 +0200
Subject: [PATCH] fix menu label handling
Signed-off-by: Steffen Winterfeldt <wfeldt@opensuse.org>
---
com32/gfxboot/gfxboot.c | 48 +++++++++++++++++++++++++++-------------------
1 files changed, 28 insertions(+), 20 deletions(-)
diff --git a/com32/gfxboot/gfxboot.c b/com32/gfxboot/gfxboot.c
index c5112f4..a6c95fe 100644
--- a/com32/gfxboot/gfxboot.c
+++ b/com32/gfxboot/gfxboot.c
@@ -116,14 +116,15 @@ typedef struct __attribute__ ((packed)) {
// menu description
typedef struct menu_s {
struct menu_s *next;
- char *label;
- char *kernel;
- char *alt_kernel;
- char *linux;
- char *localboot;
- char *initrd;
- char *append;
- char *ipappend;
+ char *label; // config entry name
+ char *menu_label; // text to show in boot menu
+ char *kernel; // name of program to load
+ char *alt_kernel; // alternative name in case user has replaced it
+ char *linux; // de facto an alias for 'kernel'
+ char *localboot; // boot from local disk
+ char *initrd; // initrd as separate line (instead of as part of 'append')
+ char *append; // kernel args
+ char *ipappend; // append special pxelinux args (see doc)
} menu_t;
@@ -345,7 +346,7 @@ int read_config_file(void)
menu_ptr = *menu_next = calloc(1, sizeof **menu_next);
menu_next = &menu_ptr->next;
menu_idx++;
- menu_ptr->label = strdup(t);
+ menu_ptr->label = menu_ptr->menu_label = strdup(t);
u = strlen(t);
if(u > label_size) label_size = u;
continue;
@@ -390,7 +391,7 @@ int read_config_file(void)
t = skip_spaces(t);
if(!strcasecmp(s, "label")) {
- menu_ptr->label = strdup(t);
+ menu_ptr->menu_label = strdup(t);
u = strlen(t);
if(u > label_size) label_size = u;
continue;
@@ -404,15 +405,22 @@ int read_config_file(void)
label_size++;
append_size++;
- gfx_menu.entries = menu_idx;
- gfx_menu.label_size = label_size;
- gfx_menu.arg_size = append_size;
+ // ensure we have a default entry
+ if(!menu_default->label) menu_default->label = menu->label;
- gfx_menu.default_entry = menu_default->label;
- if(!gfx_menu.default_entry && menu) {
- gfx_menu.default_entry = menu->label;
+ if(menu_default->label) {
+ for(menu_ptr = menu; menu_ptr; menu_ptr = menu_ptr->next) {
+ if(!strcmp(menu_default->label, menu_ptr->label)) {
+ menu_default->menu_label = menu_ptr->menu_label;
+ break;
+ }
+ }
}
+ gfx_menu.entries = menu_idx;
+ gfx_menu.label_size = label_size;
+ gfx_menu.arg_size = append_size;
+ gfx_menu.default_entry = menu_default->menu_label;
gfx_menu.label_list = calloc(menu_idx, label_size);
gfx_menu.arg_list = calloc(menu_idx, append_size);
@@ -420,7 +428,7 @@ int read_config_file(void)
if(!menu_ptr->append) menu_ptr->append = menu_default->append;
if(!menu_ptr->ipappend) menu_ptr->ipappend = menu_default->ipappend;
- if(menu_ptr->label) strcpy(gfx_menu.label_list + u * label_size, menu_ptr->label);
+ if(menu_ptr->menu_label) strcpy(gfx_menu.label_list + u * label_size, menu_ptr->menu_label);
if(menu_ptr->append) strcpy(gfx_menu.arg_list + u * append_size, menu_ptr->append);
}
@@ -789,13 +797,13 @@ void boot(int index)
}
// invalid index or menu entry
- if(!menu_ptr || !menu_ptr->label) return;
+ if(!menu_ptr || !menu_ptr->menu_label) return;
arg = skip_spaces(cmdline);
- label_len = strlen(menu_ptr->label);
+ label_len = strlen(menu_ptr->menu_label);
// if it does not start with label string, assume first word is kernel name
- if(strncmp(arg, menu_ptr->label, label_len)) {
+ if(strncmp(arg, menu_ptr->menu_label, label_len)) {
alt_kernel = arg;
arg = skip_nonspaces(arg);
if(*arg) *arg++ = 0;
--
1.6.4.2

View File

@ -1,57 +0,0 @@
diff --git a/core/keywords b/core/keywords
index c289ae2..b7d4c4b 100644
--- a/core/keywords
+++ b/core/keywords
@@ -6,6 +6,7 @@ initrd
config
default
ui
+gfxboot
display
font
implicit
diff --git a/core/keywords.inc b/core/keywords.inc
index d0f7db3..fc00ad7 100644
--- a/core/keywords.inc
+++ b/core/keywords.inc
@@ -91,6 +91,7 @@ keywd_table:
keyword f0, pc_filename, FKeyN(10)
keyword f11, pc_filename, FKeyN(11)
keyword f12, pc_filename, FKeyN(12)
+ keyword gfxboot, pc_gfxboot
%if IS_PXELINUX
keyword ipappend, pc_ipappend
%endif
diff --git a/core/parseconfig.inc b/core/parseconfig.inc
index 65d71c9..2302536 100644
--- a/core/parseconfig.inc
+++ b/core/parseconfig.inc
@@ -30,6 +30,20 @@ pc_default: cmp ax,[DefaultLevel]
ret
;
+; "gfxboot" command; Shorthand for "ui gfxboot.com"
+;
+pc_gfxboot:
+ mov ax,2
+ mov [DefaultLevel],ax ; Setup UI mode
+ mov si,gfxboot_cmd
+ mov di,default_cmd
+ call strcpy
+ dec di
+ call getline
+ mov byte [di-1],0 ; null-terminate
+ ret
+
+;
; "ontimeout" command
;
pc_ontimeout: mov di,Ontimeout
@@ -439,6 +453,7 @@ commit_vk:
section .data
vk_overflow_msg db 'Out of memory parsing config file', CR, LF, 0
SerialNotice db 1 ; Only print this once
+gfxboot_cmd db 'gfxboot.com ', 0
section .bss
alignb 4

File diff suppressed because it is too large Load Diff

View File

@ -1,180 +0,0 @@
diff --git a/Makefile b/Makefile
index 2393faa..c7daebb 100644
--- a/Makefile
+++ b/Makefile
@@ -68,7 +68,7 @@ INSTALL_SBIN = extlinux/extlinux
# Things to install in /usr/lib/syslinux
INSTALL_AUX = core/pxelinux.0 gpxe/gpxelinux.0 core/isolinux.bin \
core/isolinux-debug.bin \
- dos/syslinux.com win32/syslinux.exe \
+ dos/syslinux.com \
mbr/*.bin $(MODULES)
INSTALL_AUX_OPT = win32/syslinux.exe
diff --git a/core/Makefile b/core/Makefile
index 65418c4..fbb38b5 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -66,6 +66,7 @@ kwdhash.gen: keywords genhash.pl
iso%.bin: iso%.elf checksumiso.pl
$(OBJCOPY) -O binary $< $@
$(PERL) checksumiso.pl $@
+ -./add_crc $@
# Standard rule for {ldlinux,pxelinux,extlinux}.bin
%.bin: %.elf
diff --git a/core/add_crc b/core/add_crc
new file mode 100644
index 0000000..0da2307
--- /dev/null
+++ b/core/add_crc
@@ -0,0 +1,57 @@
+#! /usr/bin/perl
+
+use integer;
+
+# for isolinux
+#
+# Ensure checksum over (first sector - 64 bytes) [internally: FirstSecSum]
+# is 0 by adjusting the variable csum_value.
+#
+# Though isolinux checks the integrity with a separate checksum after all
+# data has been loaded this does not help with BIOSes that don't get even
+# the first 2k right. Hence this additional check. :-(
+#
+
+$file = shift;
+$list = "$file";
+$list =~ s/\.bin$/.lsr/;
+
+open F, $list;
+
+while(<F>) {
+ if(/^\s*\d+\s*(\S+)\s*0+\s*(\<\d+\>\s*)?csum_value\s*dd\s*0/) {
+ $ofs = hex $1;
+ }
+}
+close F;
+
+die "oops 1\n" unless $ofs && !($ofs & 3);
+
+# print "$ofs\n";
+
+open F, $file or die "$file: $!\n";
+
+$file_size = -s $file;
+
+sysread F, $buf, $file_size;
+
+close F;
+
+die "oops 1\n" if $file_size != length($buf);
+
+@x = unpack "V512", $buf;
+
+for ($sum = 0, $i = 16; $i < 512; $i++) {
+ $sum += $x[$i];
+}
+
+# printf "0x%08x\n", $sum;
+
+$ns = pack "V", -$sum;
+
+substr($buf, $ofs, 4) = $ns;
+
+open F, ">$file" or die "$file: $!\n";
+
+syswrite F, $buf;
+
diff --git a/core/isolinux.asm b/core/isolinux.asm
index 54f2e19..72be12a 100644
--- a/core/isolinux.asm
+++ b/core/isolinux.asm
@@ -308,6 +308,22 @@ initial_csum: xor edi,edi
mov [FirstSecSum],edi
mov [DriveNumber],dl
+
+ ; check whether the BIOS did load us correctly
+ cmp dl,80h ; some BIOSes try to do floppy emulation...
+ jb bios_err
+ cmp dword [FirstSecSum], byte 0
+ jmp bios_ok ; ##############
+ jz bios_ok
+bios_err:
+ mov si,broken_bios_msg
+ call writemsg
+ jmp short $
+broken_bios_msg db 13, 10, 'Cannot boot from this CD. Please try a BIOS update.', 13, 10, 0
+ align 4
+csum_value dd 0
+bios_ok:
+
%ifdef DEBUG_MESSAGES
mov si,startup_msg
call writemsg
@@ -336,6 +352,9 @@ initial_csum: xor edi,edi
cmp word [BIOSType],bios_cdrom
jne found_drive ; If so, no spec packet...
+%if 0
+ ; Some BIOSes don't like that call.
+
; Now figure out what we're actually doing
; Note: use passed-in DL value rather than 7Fh because
; at least some BIOSes will get the wrong value otherwise
@@ -356,6 +375,8 @@ initial_csum: xor edi,edi
call crlf
%endif
+%endif
+
found_drive:
; Alright, we have found the drive. Now, try to find the
; boot file itself. If we have a boot info table, life is
@@ -480,6 +501,9 @@ integrity_ok:
%endif
jmp all_read ; Jump to main code
+%if 0
+ ; doesn't work anyway, see above
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Start of BrokenAwardHack --- 10-nov-2002 Knut_Petersen@t-online.de
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -671,6 +695,7 @@ spec_query_failed:
mov si,trysbm_msg
call writemsg
jmp .found_drive ; Pray that this works...
+%endif
fatal_error:
mov si,nothing_msg
@@ -936,8 +961,18 @@ maxtrans:
getlinsec_cdrom:
mov si,dapa ; Load up the DAPA
mov [si+4],bx
- mov [si+6],es
mov [si+8],eax
+
+ ; seems that some BIOSes have problems if the target
+ ; segment is 0 (don't ask); to avoid this, we normalize
+ ; the buffer address here
+ ; -> seen on Acer TravelMate C102Ti
+ and word [si+4],0fh
+ mov ax,es
+ shr bx,4
+ add ax,bx
+ mov [si+6],ax
+
.loop:
push bp ; Sectors left
cmp bp,[MaxTransferCD]
@@ -1770,6 +1805,7 @@ default_str db 'default', 0
default_len equ ($-default_str)
boot_dir db '/boot' ; /boot/isolinux
isolinux_dir db '/isolinux', 0
+zb 64
config_name db 'isolinux.cfg', 0
err_disk_image db 'Cannot load disk image (invalid file)?', CR, LF, 0

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:82a8d2a242f869cb4c34b3a074871f472762343e1879a4dca23d7ce5c4dcd06d
size 3735823

45
syslinux-4.03-cwd.diff Normal file
View File

@ -0,0 +1,45 @@
diff --git a/com32/gfxboot/gfxboot.c b/com32/gfxboot/gfxboot.c
index 2323f8e..8cace82 100644
--- a/com32/gfxboot/gfxboot.c
+++ b/com32/gfxboot/gfxboot.c
@@ -100,6 +100,8 @@ typedef struct __attribute__ ((packed)) {
// 0: GFX_CB_MENU_INIT accepts 32 bit addresses
// 1: knows about xmem_start, xmem_end
uint16_t reserved_1; // 62:
+ uint32_t gfxboot_cwd; // 64: if set, points to current gfxboot working directory relative
+ // to syslinux working directory
} gfx_config_t;
@@ -185,6 +187,7 @@ int main(int argc, char **argv)
{
int menu_index;
const union syslinux_derivative_info *sdi;
+ char working_dir[256];
openconsole(&dev_stdcon_r, &dev_stdcon_w);
@@ -228,6 +231,10 @@ int main(int argc, char **argv)
return 0;
}
+ if(getcwd(working_dir, sizeof working_dir)) {
+ gfx_config.gfxboot_cwd = (uint32_t) working_dir;
+ }
+
if(gfx_init(argv[1])) {
printf("Error setting up gfxboot\n");
if(argc > 2) show_message(argv[2]);
@@ -815,6 +822,12 @@ void boot(int index)
int i, label_len;
unsigned ipapp;
const struct syslinux_ipappend_strings *ipappend;
+ char *gfxboot_cwd = (char *) gfx_config.gfxboot_cwd;
+
+ if(gfxboot_cwd) {
+ chdir(gfxboot_cwd);
+ gfx_config.gfxboot_cwd = 0;
+ }
for(menu_ptr = menu; menu_ptr; menu_ptr = menu_ptr->next, index--) {
if(!index) break;

View File

@ -0,0 +1,38 @@
diff --git a/core/fs/iso9660/iso9660.c b/core/fs/iso9660/iso9660.c
index 46f5f17..70c6910 100644
--- a/core/fs/iso9660/iso9660.c
+++ b/core/fs/iso9660/iso9660.c
@@ -275,14 +275,25 @@ static int iso_readdir(struct file *file, struct dirent *dirent)
/* Load the config file, return 1 if failed, or 0 */
static int iso_load_config(void)
{
- static const char *search_directories[] = {
- "/boot/isolinux",
- "/isolinux",
- "/boot/syslinux",
- "/syslinux",
- "/",
- NULL
- };
+ /*
+ * Put search_directories[] to different section so it
+ * won't be compressed (and we can patch it later).
+ */
+ __asm__(
+ ".section .data16\n"
+ ".s1: .ascii \"/boot\"\n"
+ ".s2: .string \"/isolinux\"\n"
+ ".fill 64, 1, 0\n"
+ ".s3: .ascii \"/boot\"\n"
+ ".s4: .string \"/syslinux\"\n"
+ ".s5: .string \"/\"\n"
+ ".align 4\n"
+ "search_directories:\n"
+ ".long .s1, .s2, .s3, .s4, .s5, 0\n"
+ ".text\n"
+ );
+ extern const char *search_directories[];
+
static const char *filenames[] = {
"isolinux.cfg",
"syslinux.cfg",

13
syslinux-4.03-lua.diff Normal file
View File

@ -0,0 +1,13 @@
diff --git a/com32/lua/src/syslinux.c b/com32/lua/src/syslinux.c
index fa54d7f..a744e17 100644
--- a/com32/lua/src/syslinux.c
+++ b/com32/lua/src/syslinux.c
@@ -385,7 +385,7 @@ static int sl_initramfs_add_file(lua_State * L)
size_t file_len = 0;
if (initramfs_add_file(initramfs, file_data, file_len, file_len,
- "/testfile1", 0, 0755))
+ "/testfile1", 0, 0755));
return 0;
}

3
syslinux-4.03.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c65567e324f9d1f7f794ae8f9578a0292bbd47d7b8d895a004d2f0152d0bda38
size 4381187

View File

@ -1,3 +1,121 @@
-------------------------------------------------------------------
Mon Apr 18 17:35:01 CEST 2011 - snwint@suse.de
- update to version 4.03
* Major code base changes; all filesystem rewritten in C.
This work was done primarily by Liu Aleaxander (Yuanhan Liu).
* Better support for booting from MBRs which don't pass
handover information.
* EXTLINUX: Try to be smarter about finding the partition
offset.
* chain.c32: support chainloading Dell Real Mode Kernel (Gene
Cumm).
* chain.c32: fix booting in CHS mode.
* Fix the -s option to the syslinux/extlinux installer (Arwin
Vosselman).
* isohybrid: fix padding of large images (PJ Pandit).
* SYSLINUX: correctly handle the case where the -d option is
specified with a non-absolute path, i.e. "syslinux -d
syslinux" instead of "syslinux -d /syslinux".
* ISOLINUX: recognize the directory names /boot/syslinux and
/syslinux, and the filename syslinux.cfg in addition to the
isolinux-specific names. Thus, "syslinux.cfg" is now a
generic name, whereas "isolinux.cfg" or "extlinux.conf" is
specific to different derivative.
* chain.c32: support setting alternate config filename for
stage2 of GRUB Legacy (Gert Hulselmans).
* whichsys.c32: execute specific command, based on Syslinux
bootloader variant (Gert Hulselmans).
* lua.c32: a lot of new bindings added to the "syslinux"
namespace: VESA, PCI, DMI, kernel loading (Marcel Ritter).
* btrfs: print a comprehensive error message if compressed or
encrypted files are encountered (neither is currently
supported.)
* SYSLINUX: mtools installer: honor TMPDIR, error out on disk
full.
* Handle fallbacks from EDD to CHS, to deal with systems which
announce EDD support but don't actually have it.
* SYSLINUX: the mtools, DOS and win32 installers now use the new
command line options.
* PXELINUX: fix the use of IP addresses in TFTP :: or tftp://
host syntax.
* SYSLINUX: experimental Win64 installer (syslinux64.exe).
* ISOLINUX: fix initialization on systems which don't zero
low memory.
* SYSLINUX/EXTLINUX: fix handing of disk read retries in
EDD mode.
* ISOLINUX: change the initialization sequence to avoid
problems with certain (old) BIOSes. Special thanks to
Helmut Hullen for invaluable debugging support.
* ifplop.c32: new module which detects if the PLoP Boot Loader
already has booted a CDROM or USB drive (Gert Hulselmans).
* Correct a severe memory overwrite bug, triggered primarily
when selecting a very long command line in the menu system.
* lua.c32: Lua script interpreter, currently experimental
(Alexey Zaytsev, Marcel Ritter, Geert Stappers).
* PXELINUX: new option IPAPPEND 4 to append the system UUID to
the kernel command line.
* PXELINUX: display BOOTIF and SYSUUID at startup time, and
when Ctrl-N is pressed on the command line.
* EXTLINUX: btrfs and ext4 support. btrfs support was done by
Alek Du of Intel.
* EXTLINUX is no longer a separate derivative; extlinux and
syslinux both install the same loader (ldlinux.sys); for the
Linux-based installers the extlinux binary is used for a
mounted filesystem; the syslinux binary for an unmounted
filesystem.
* When loading a new configuration file with the CONFIG
command, one can now also specify a new current directory
with an APPEND statement.
* Full ADV support for Syslinux, to boot-once and MENU SAVE
works.
* Full support of GPT-partitioned disks, including disks
and/or parititions larger than 2 TiB (if supported by BIOS.)
* The GPT handover protocol adjusted to the current T13
committee draft; see doc/gpt.txt.
* HDT: code cleanup, small bugfixes
* The "linux" syslinux installer (syslinux-nomtools) now has a
command-line syntax closer to the extlinux installer. The
mtools, dos and win32 installers will get this new syntax
eventually, but it is not implemented yet.
* chain.c32: support booting GPT partitions by index, GUID, label.
* chain.c32: support booting the Syslinux partition with "fs".
* chain.c32: implement gpt.txt hand-over protocol.
* chain.c32: support for chainloading Grub stage 2.
* PXELINUX: TFTP URL syntax (tftp://) supported even when not
running gPXE/gpxelinux.
* New ls.c32 module to display the contents of the disk from
the command line, and pwd.c32 to display the current
directory.
* rosh.c32 (read only shell) updated and hopefully usable.
* PXELINUX: Support "localboot -1", just like the other
derivatives.
* gfxboot.com removed in favor of gfxboot.c32.
* New MENU HELP statement to display fullscreen help text as a
result of a menu selection.
* memdiskfind utility that can be used with the phram driver
in the Linux kernel to mount a memdisk.
* ifcpu.c32: Adding usage when no parameters are given,
adding PAE support.
* ifcpu.c32, ifcpu64.c32: handle more than one argument per
target.
* isohybrid: C version which does not require Perl.
* New command MENU IMMEDIATE to permit hotkeys to activate
immediately without needing Enter.
* mdiskchk.com supports a --no-sequential (or -n) option to
suppress the classic all-drive-probing heuristic. Useful
on BIOSes who crash/hang when certain drive numbers are
probed.
* ElTorito.Sys DOS driver now scans drive numbers upwards
instead of downwards, in order to avoid a fairly common
bug on some BIOSes where probing drive 0xFF causes a
failure.
-------------------------------------------------------------------
Tue Apr 27 17:33:10 CEST 2010 - snwint@suse.de
- drop obsolete gfxboot.com
-------------------------------------------------------------------
Mon Apr 19 15:41:01 CEST 2010 - snwint@suse.de

View File

@ -26,15 +26,14 @@ Group: System/Boot
Requires: mtools
AutoReqProv: on
Summary: Boot Loader for Linux
Version: 3.86
Release: 3
Version: 4.03
Release: 4
Source: %{name}-%{version}.tar.bz2
Source1: isolinux-config
Source2: README.gfxboot
Patch0: %{name}-%{version}-gfxboot.diff
Patch1: %{name}-%{version}-suse.diff
Patch2: %{name}-%{version}-compat.diff
Patch3: %{name}-%{version}-com32.diff
Patch0: %{name}-%{version}-iso9660.diff
Patch1: %{name}-%{version}-cwd.diff
Patch2: %{name}-%{version}-lua.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@ -54,12 +53,10 @@ Authors:
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%build
cp %{SOURCE2} .
export CFLAGS="$RPM_OPT_FLAGS"
chmod +x core/add_crc
make spotless
make