From 3a7f525b20930d98edcabc99b8cd91036b77d323 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Fri, 5 Jan 2007 21:37:17 -0800 Subject: comboot.doc: for function 0009h, clarify ES:DI = PXE parameter structure Apparently "data buffer" was misinterpreted by some readers. ES:DI points to the parameter structure, which may point to other buffer(s). --- comboot.doc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comboot.doc b/comboot.doc index 58549e65..e7627793 100644 --- a/comboot.doc +++ b/comboot.doc @@ -340,7 +340,7 @@ AX=0009h [2.00] Call PXE Stack [PXELINUX ONLY] Input: AX 0009h BX PXE function number - ES:DI PXE data buffer + ES:DI PXE parameter structure buffer Output: AX PXE return status code Invoke an arbitrary PXE stack function. On SYSLINUX/ISOLINUX, -- cgit v1.2.1 From 0219b5688e5ca5a370e11021298e48e1ea7344b4 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 23 Jan 2007 22:20:54 -0800 Subject: Fix segment register confusion in mangle_name --- isolinux.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/isolinux.asm b/isolinux.asm index fd7cb75a..27d0b8c1 100644 --- a/isolinux.asm +++ b/isolinux.asm @@ -1391,9 +1391,9 @@ mangle_name: .mn_end: cmp bx,di ; At the beginning of the buffer? jbe .mn_zero - cmp byte [di-1],'.' ; Terminal dot? + cmp byte [es:di-1],'.' ; Terminal dot? je .mn_kill - cmp byte [di-1],'/' ; Terminal slash? + cmp byte [es:di-1],'/' ; Terminal slash? jne .mn_zero .mn_kill: dec di ; If so, remove it inc cx -- cgit v1.2.1 From 68eefb79e2cbb590ebf958dd0c50ce00b941abd2 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 23 Jan 2007 22:26:06 -0800 Subject: Support subdirectories in the FAT version of SYSLINUX --- ldlinux.asm | 338 ++++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 226 insertions(+), 112 deletions(-) diff --git a/ldlinux.asm b/ldlinux.asm index b5a9ebf6..733f2ec9 100644 --- a/ldlinux.asm +++ b/ldlinux.asm @@ -11,7 +11,7 @@ ; from MS-LOSS, and can be especially useful in conjunction with the ; umsdos filesystem. ; -; Copyright (C) 1994-2005 H. Peter Anvin +; Copyright (C) 1994-2007 H. Peter Anvin ; ; This program is free software; you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by @@ -30,9 +30,9 @@ ; Some semi-configurable constants... change on your own risk. ; my_id equ syslinux_id -FILENAME_MAX_LG2 equ 4 ; log2(Max filename size Including final null) -FILENAME_MAX equ 11 ; Max mangled filename size -NULLFILE equ ' ' ; First char space == null filename +FILENAME_MAX_LG2 equ 6 ; log2(Max filename size Including final null) +FILENAME_MAX equ (1< Current directory sector + mov si,di +.findend: + lodsb + cmp al,' ' + jbe .endpath + cmp al,'/' + jne .findend +.endpath: + xchg si,di + pop eax ; Current directory sector + + mov [PrevDir],eax ; Remember last directory searched + + push di + call mangle_dos_name ; MangledBuf <- component + call search_dos_dir + pop di + jz .notfound ; Pathname component missing + + cmp byte [di-1],'/' ; Do we expect a directory + je .isdir + + ; Otherwise, it should be a file +.isfile: + test dl,18h ; Subdirectory|Volume Label + jnz .badfile ; If not a file, it's a bad thing + + ; SI and EAX are already set + mov edx,eax + shr edx,16 ; Old 16-bit remnant... + and eax,eax ; EAX != 0 + jz .badfile + ret ; Done! + + ; If we expected a directory, it better be one... +.isdir: + test dl,10h ; Subdirectory + jz .badfile + + xor eax,eax + xchg eax,[si+file_sector] ; Get sector number and free file structure + jmp .pathwalk ; Walk the next bit of the path + +.badfile: + xor eax,eax + mov [si],eax ; Free file structure + +.notfound: + xor eax,eax + xor dx,dx + ret + + section .bss + alignb 4 +CurrentDir resd 1 ; Current directory +PrevDir resd 1 ; Last scanned directory + + section .text + ; ; ; kaboom2: once everything is loaded, replace the part of kaboom @@ -1056,115 +1157,138 @@ kaboom2: .norge: jmp short .norge ; If int 19h returned; this is the end ; -; mangle_name: Mangle a DOS filename pointed to by DS:SI into a buffer pointed -; to by ES:DI; ends on encountering any whitespace +; mangle_name: Mangle a filename pointed to by DS:SI into a buffer pointed +; to by ES:DI; ends on encountering any whitespace. +; +; This verifies that a filename is < FILENAME_MAX characters, +; doesn't contain whitespace, zero-pads the output buffer, +; and removes trailing dots and redundant slashes, plus changes +; backslashes to forward slashes, +; so "repe cmpsb" can do a compare, and the path-searching routine +; gets a bit of an easier job. +; ; - mangle_name: + push bx + xor ax,ax + mov cx,FILENAME_MAX-1 + mov bx,di + +.mn_loop: + lodsb + cmp al,' ' ; If control or space, end + jna .mn_end + cmp al,'\' ; Backslash? + jne .mn_not_bs + mov al,'/' ; Change to forward slash +.mn_not_bs: + cmp al,ah ; Repeated slash? + je .mn_skip + xor ah,ah + cmp al,'/' + jne .mn_ok + mov ah,al +.mn_ok stosb +.mn_skip: loop .mn_loop +.mn_end: + cmp bx,di ; At the beginning of the buffer? + jbe .mn_zero + cmp byte [es:di-1],'.' ; Terminal dot? + je .mn_kill + cmp byte [es:di-1],'/' ; Terminal slash? + jne .mn_zero +.mn_kill: dec di ; If so, remove it + inc cx + jmp short .mn_end +.mn_zero: + inc cx ; At least one null byte + xor ax,ax ; Zero-fill name + rep stosb + pop bx + ret ; Done + +; +; unmangle_name: Does the opposite of mangle_name; converts a DOS-mangled +; filename to the conventional representation. This is needed +; for the BOOT_IMAGE= parameter for the kernel. +; NOTE: A 13-byte buffer is mandatory, even if the string is +; known to be shorter. +; +; DS:SI -> input mangled file name +; ES:DI -> output buffer +; +; On return, DI points to the first byte after the output name, +; which is set to a null byte. +; +unmangle_name: call strcpy + dec di ; Point to final null byte + ret + +; +; mangle_dos_name: +; Mangle a DOS filename component pointed to by DS:SI +; into [MangledBuf]; ends on encountering any whitespace or slash. +; Assumes CS == DS == ES. +; + +mangle_dos_name: + pusha + mov di,MangledBuf + mov cx,11 ; # of bytes to write -mn_loop: +.loop: lodsb cmp al,' ' ; If control or space, end - jna mn_end + jna .end + cmp al,'/' ; Slash, too + je .end cmp al,'.' ; Period -> space-fill - je mn_is_period + je .is_period cmp al,'a' - jb mn_not_lower + jb .not_lower cmp al,'z' - ja mn_not_uslower + ja .not_uslower sub al,020h - jmp short mn_not_lower -mn_is_period: mov al,' ' ; We need to space-fill -mn_period_loop: cmp cx,3 ; If <= 3 characters left - jbe mn_loop ; Just ignore it + jmp short .not_lower +.is_period: mov al,' ' ; We need to space-fill +.period_loop: cmp cx,3 ; If <= 3 characters left + jbe .loop ; Just ignore it stosb ; Otherwise, write a period - loop mn_period_loop ; Dec CX and (always) jump -mn_not_uslower: cmp al,ucase_low - jb mn_not_lower + loop .period_loop ; Dec CX and (always) jump +.not_uslower: cmp al,ucase_low + jb .not_lower cmp al,ucase_high - ja mn_not_lower + ja .not_lower mov bx,ucase_tab-ucase_low - cs xlatb -mn_not_lower: stosb - loop mn_loop ; Don't continue if too long -mn_end: + xlatb +.not_lower: stosb + loop .loop ; Don't continue if too long +.end: mov al,' ' ; Space-fill name rep stosb ; Doesn't do anything if CX=0 + popa ret ; Done + section .bss +MangledBuf resb 11 + + section .text ; -; Upper-case table for extended characters; this is technically code page 865, +; Case tables for extended characters; this is technically code page 865, ; but code page 437 users will probably not miss not being able to use the ; cent sign in kernel images too much :-) ; ; The table only covers the range 129 to 164; the rest we can deal with. ; + section .data + ucase_low equ 129 ucase_high equ 164 ucase_tab db 154, 144, 'A', 142, 'A', 143, 128, 'EEEIII' db 142, 143, 144, 146, 146, 'O', 153, 'OUUY', 153, 154 db 157, 156, 157, 158, 159, 'AIOU', 165 -; -; unmangle_name: Does the opposite of mangle_name; converts a DOS-mangled -; filename to the conventional representation. This is needed -; for the BOOT_IMAGE= parameter for the kernel. -; NOTE: A 13-byte buffer is mandatory, even if the string is -; known to be shorter. -; -; DS:SI -> input mangled file name -; ES:DI -> output buffer -; -; On return, DI points to the first byte after the output name, -; which is set to a null byte. -; -unmangle_name: - push si ; Save pointer to original name - mov cx,8 - mov bp,di -un_copy_body: lodsb - call lower_case - stosb - cmp al,' ' - jbe un_cb_space - mov bp,di ; Position of last nonblank+1 -un_cb_space: loop un_copy_body - mov di,bp - mov al,'.' ; Don't save - stosb - mov cx,3 -un_copy_ext: lodsb - call lower_case - stosb - cmp al,' ' - jbe un_ce_space - mov bp,di -un_ce_space: loop un_copy_ext - mov di,bp - mov byte [es:di], 0 - pop si - ret - -; -; lower_case: Lower case a character in AL -; -lower_case: - cmp al,'A' - jb lc_ret - cmp al,'Z' - ja lc_1 - or al,20h - ret -lc_1: cmp al,lcase_low - jb lc_ret - cmp al,lcase_high - ja lc_ret - push bx - mov bx,lcase_tab-lcase_low - cs xlatb - pop bx -lc_ret: ret - + section .text ; ; getfssec_edx: Get multiple sectors from a file ; @@ -1423,16 +1547,6 @@ getfatsector: ; ----------------------------------------------------------------------------- section .data -; -; Lower-case table for codepage 865 -; -lcase_low equ 128 -lcase_high equ 165 -lcase_tab db 135, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138 - db 139, 140, 141, 132, 134, 130, 145, 145, 147, 148, 149 - db 150, 151, 152, 148, 129, 155, 156, 155, 158, 159, 160 - db 161, 162, 163, 164, 164 - copyright_str db ' Copyright (C) 1994-', year, ' H. Peter Anvin' db CR, LF, 0 boot_prompt db 'boot: ', 0 @@ -1469,11 +1583,11 @@ aborted_msg db ' aborted.' ; Fall through to crlf_msg! crlf_msg db CR, LF null_msg db 0 crff_msg db CR, FF, 0 -syslinux_cfg db 'SYSLINUXCFG' ; Mangled form -ConfigName db 'syslinux.cfg',0 ; Unmangled form -%if IS_MDSLINUX -manifest db 'MANIFEST ' -%endif +syslinux_cfg1 db '/boot' ; /boot/syslinux/syslinux.cfg +syslinux_cfg2 db '/syslinux' ; /syslinux/syslinux.cfg +syslinux_cfg3 db '/' ; /syslinux.cfg +ConfigName db 'syslinux.cfg', 0 ; syslinux.cfg + ; ; Command line options we'd like to take a look at ; -- cgit v1.2.1 From f21c3a2133d97329522569b674627f0773384c22 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 23 Jan 2007 22:26:38 -0800 Subject: DOS FAT installer: support installing ldlinux.sys in a subdirectory --- dos/syslinux.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 71 insertions(+), 3 deletions(-) diff --git a/dos/syslinux.c b/dos/syslinux.c index f3b08367..e4066ca5 100644 --- a/dos/syslinux.c +++ b/dos/syslinux.c @@ -36,7 +36,7 @@ uint16_t dos_version; void __attribute__((noreturn)) usage(void) { - puts("Usage: syslinux [-sfma] : [bootsecfile]\n"); + puts("Usage: syslinux [-sfma][-d directory] : [bootsecfile]\n"); exit(1); } @@ -51,6 +51,13 @@ void __attribute__((noreturn)) die(const char *msg) exit(1); } +void warning(const char *msg) +{ + puts("syslinux: warning: "); + puts(msg); + putchar('\n'); +} + /* * read/write wrapper functions */ @@ -63,7 +70,7 @@ int creat(const char *filename, int mode) rv = 0x3C00; asm volatile("int $0x21 ; setc %0" - : "=abcdm" (err), "+a" (rv) + : "=bcdm" (err), "+a" (rv) : "c" (mode), "d" (filename)); if ( err ) { dprintf("rv = %d\n", rv); @@ -87,6 +94,26 @@ void close(int fd) and we really don't care... */ } +int rename(const char *oldname, const char *newname) +{ + uint16_t rv = 0x5600; /* Also support 43FFh? */ + uint8_t err; + + dprintf("rename(\"%s\", \"%s\")\n", oldname, newname); + + asm volatile("int $0x21 ; setc %0" + : "=bcdm" (err), "+a" (rv) + : "d" (oldname), "D" (newname)); + + if ( err ) { + dprintf("rv = %d\n", rv); + warning("cannot move ldlinux.sys"); + return rv; + } + + return 0; +} + ssize_t write_file(int fd, const void *buf, size_t count) { uint16_t rv; @@ -449,7 +476,7 @@ int main(int argc, char *argv[]) { static unsigned char sectbuf[512]; int dev_fd, fd; - static char ldlinux_name[] = "@:\\LDLINUX.SYS"; + static char ldlinux_name[] = "@:\\ldlinux.sys"; char **argp, *opt; int force = 0; /* -f (force) option */ struct libfat_filesystem *fs; @@ -461,6 +488,7 @@ int main(int argc, char *argv[]) int i; int writembr = 0; /* -m (write MBR) option */ int set_active = 0; /* -a (set partition active) option */ + const char *subdir = NULL; dprintf("argv = %p\n", argv); for ( i = 0 ; i <= argc ; i++ ) @@ -490,6 +518,10 @@ int main(int argc, char *argv[]) case 'a': /* Set partition active */ set_active = 1; break; + case 'd': + if ( opt[1] ) + subdir = ++opt; + break; default: usage(); } @@ -557,6 +589,42 @@ int main(int argc, char *argv[]) } libfat_close(fs); + /* + * If requested, move ldlinux.sys + */ + if (subdir) { + char new_ldlinux_name[160]; + char *cp = new_ldlinux_name+3; + const char *sd; + int slash = 1; + + new_ldlinux_name[0] = dev_fd | 0x40; + new_ldlinux_name[1] = ':'; + new_ldlinux_name[2] = '\\'; + + for (sd = subdir; *sd; sd++) { + if (*sd == '/' || *sd == '\\') { + if (slash) + continue; + *cp++ = '\\'; + } + } + + /* Skip if subdirectory == root */ + if (cp > new_ldlinux_name+3) { + if (!slash) + *cp++ = '\\'; + + memcpy(cp, "ldlinux.sys", 12); + + set_attributes(ldlinux_name, 0); + if (rename(ldlinux_name, new_ldlinux_name)) + set_attributes(ldlinux_name, 0x07); + else + set_attributes(new_ldlinux_name, 0x07); + } + } + /* * Patch ldlinux.sys and the boot sector */ -- cgit v1.2.1 From 851f2ea36d65f146293f7046ec9a112e3f793332 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 23 Jan 2007 22:27:01 -0800 Subject: mtools FAT installer: support installing ldlinux.sys in a subdirectory --- mtools/syslinux.c | 92 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 73 insertions(+), 19 deletions(-) diff --git a/mtools/syslinux.c b/mtools/syslinux.c index b55d2d49..29259dff 100644 --- a/mtools/syslinux.c +++ b/mtools/syslinux.c @@ -1,6 +1,6 @@ /* ----------------------------------------------------------------------- * * - * Copyright 1998-2004 H. Peter Anvin - All Rights Reserved + * Copyright 1998-2007 H. Peter Anvin - All Rights Reserved * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -45,7 +45,7 @@ off_t filesystem_offset = 0; /* Offset of filesystem */ void __attribute__((noreturn)) usage(void) { - fprintf(stderr, "Usage: %s [-sf] [-o offset] device\n", program); + fprintf(stderr, "Usage: %s [-sf][-d directory][-o offset] device\n", program); exit(1); } @@ -131,6 +131,7 @@ int main(int argc, char *argv[]) char **argp, *opt; int force = 0; /* -f (force) option */ char mtools_conf[] = "/tmp/syslinux-mtools-XXXXXX"; + const char *subdir = NULL; int mtc_fd; FILE *mtc, *mtp; struct libfat_filesystem *fs; @@ -157,6 +158,8 @@ int main(int argc, char *argv[]) syslinux_make_stupid(); /* Use "safe, slow and stupid" code */ } else if ( *opt == 'f' ) { force = 1; /* Force install */ + } else if ( *opt == 'd' && argp[1] ) { + subdir = *++argp; } else if ( *opt == 'o' && argp[1] ) { filesystem_offset = (off_t)strtoull(*++argp, NULL, 0); /* Byte offset */ } else { @@ -226,9 +229,9 @@ int main(int argc, char *argv[]) } /* This command may fail legitimately */ - system("mattrib -h -r -s s:ldlinux.sys 2>/dev/null"); + system("mattrib -h -r -s s:/ldlinux.sys 2>/dev/null"); - mtp = popen("mcopy -D o -D O -o - s:ldlinux.sys", "w"); + mtp = popen("mcopy -D o -D O -o - s:/ldlinux.sys", "w"); if ( !mtp || (fwrite(syslinux_ldlinux, 1, syslinux_ldlinux_len, mtp) != syslinux_ldlinux_len) || @@ -236,16 +239,6 @@ int main(int argc, char *argv[]) die("failed to create ldlinux.sys"); } - status = system("mattrib +r +h +s s:ldlinux.sys"); - - if ( !WIFEXITED(status) || WEXITSTATUS(status) ) { - fprintf(stderr, - "%s: warning: failed to set system bit on ldlinux.sys\n", - program); - } - - unlink(mtools_conf); - /* * Now, use libfat to create a block map */ @@ -261,15 +254,76 @@ int main(int argc, char *argv[]) } libfat_close(fs); - /* - * Patch ldlinux.sys and the boot sector - */ + /* Patch ldlinux.sys and the boot sector */ syslinux_patch(sectors, nsectors); + /* Write the now-patched first sector of ldlinux.sys */ + xpwrite(dev_fd, syslinux_ldlinux, 512, + filesystem_offset + ((off_t)sectors[0] << 9)); + + /* Move ldlinux.sys to the desired location */ + if (subdir) { + char target_file[4096], command[5120]; + char *cp = target_file, *ep = target_file+sizeof target_file-16; + const char *sd; + int slash = 1; + + cp += sprintf(cp, "'s:/"); + for (sd = subdir; *sd; sd++) { + if (*sd == '/' || *sd == '\\') { + if (slash) + continue; /* Remove duplicated slashes */ + slash = 1; + } else if (*sd == '\'' || *sd == '!') { + slash = 0; + if (cp < ep) *cp++ = '\''; + if (cp < ep) *cp++ = '\\'; + if (cp < ep) *cp++ = *sd; + if (cp < ep) *cp++ = '\''; + continue; + } else { + slash = 0; + } + + if (cp < ep) + *cp++ = *sd; + } + if (!slash) + *cp++ = '/'; + strcpy(cp, "ldlinux.sys'"); + + /* This command may fail legitimately */ + sprintf(command, "mattrib -h -r -s %s 2>/dev/null", target_file); + system(command); + + sprintf(command, "mmove -D o -D O s:/ldlinux.sys %s", target_file); + status = system(command); + + if ( !WIFEXITED(status) || WEXITSTATUS(status) ) { + fprintf(stderr, + "%s: warning: unable to move ldlinux.sys\n", + program); + + status = system("mattrib +r +h +s s:/ldlinux.sys"); + } else { + sprintf(command, "mattrib +r +h +s %s", target_file); + status = system(command); + } + } else { + status = system("mattrib +r +h +s s:/ldlinux.sys"); + } + + if ( !WIFEXITED(status) || WEXITSTATUS(status) ) { + fprintf(stderr, + "%s: warning: failed to set system bit on ldlinux.sys\n", + program); + } + + /* - * Write the now-patched first sector of ldlinux.sys + * Cleanup */ - xpwrite(dev_fd, syslinux_ldlinux, 512, filesystem_offset + ((off_t)sectors[0] << 9)); + unlink(mtools_conf); /* * To finish up, write the boot sector -- cgit v1.2.1 From b297348081ec40baed33e49fe5f46b54c0d7b164 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 23 Jan 2007 22:27:26 -0800 Subject: Unix FAT installer: support installing ldlinux.sys in a subdirectory --- unix/syslinux.c | 67 +++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 44 insertions(+), 23 deletions(-) diff --git a/unix/syslinux.c b/unix/syslinux.c index a9a900e5..36826a1b 100644 --- a/unix/syslinux.c +++ b/unix/syslinux.c @@ -1,6 +1,6 @@ /* ----------------------------------------------------------------------- * * - * Copyright 1998-2005 H. Peter Anvin - All Rights Reserved + * Copyright 1998-2007 H. Peter Anvin - All Rights Reserved * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -76,7 +76,7 @@ int loop_fd = -1; /* Loop device */ void __attribute__((noreturn)) usage(void) { - fprintf(stderr, "Usage: %s [-sf] [-o offset] device\n", program); + fprintf(stderr, "Usage: %s [-sf][-d directory][-o offset] device\n", program); exit(1); } @@ -178,11 +178,12 @@ int main(int argc, char *argv[]) char mntname[64], devfdname[64]; char *ldlinux_name, **argp, *opt; int force = 0; /* -f (force) option */ + const char *subdir = NULL; struct libfat_filesystem *fs; struct libfat_direntry dentry; libfat_sector_t s, *secp, sectors[65]; /* 65 is maximum possible */ int32_t ldlinux_cluster; - int nsectors; + int nsectors = 0; const char *errmsg; (void)argc; /* Unused */ @@ -205,6 +206,8 @@ int main(int argc, char *argv[]) syslinux_make_stupid(); /* Use "safe, slow and stupid" code */ } else if ( *opt == 'f' ) { force = 1; /* Force install */ + } else if ( *opt == 'd' && argp[1] ) { + subdir = *++argp; } else if ( *opt == 'o' && argp[1] ) { filesystem_offset = (off_t)strtoull(*++argp, NULL, 0); /* Byte offset */ } else { @@ -367,13 +370,13 @@ int main(int argc, char *argv[]) #endif } - ldlinux_name = alloca(strlen(mntpath)+13); + ldlinux_name = alloca(strlen(mntpath)+14); if ( !ldlinux_name ) { perror(program); err = 1; goto umount; } - sprintf(ldlinux_name, "%s/ldlinux.sys", mntpath); + sprintf(ldlinux_name, "%s//ldlinux.sys", mntpath); unlink(ldlinux_name); fd = open(ldlinux_name, O_WRONLY|O_CREAT|O_TRUNC, 0444); @@ -409,6 +412,42 @@ int main(int argc, char *argv[]) sync(); + /* + * Now, use libfat to create a block map. This probably + * should be changed to use ioctl(...,FIBMAP,...) since + * this is supposed to be a simple, privileged version + * of the installer. + */ + fs = libfat_open(libfat_xpread, dev_fd); + ldlinux_cluster = libfat_searchdir(fs, 0, "LDLINUX SYS", &dentry); + secp = sectors; + nsectors = 0; + s = libfat_clustertosector(fs, ldlinux_cluster); + while ( s && nsectors < 65 ) { + *secp++ = s; + nsectors++; + s = libfat_nextsector(fs, s); + } + libfat_close(fs); + + /* Move ldlinux.sys to the desired location */ + if (subdir) { + char *new_ldlinux_name = alloca(strlen(mntpath)+ + strlen(subdir)+15); + int mov_err = 1; + + if ( new_ldlinux_name ) { + sprintf(new_ldlinux_name, "%s//%s//ldlinux.sys", mntpath, subdir); + + if (!rename(ldlinux_name, new_ldlinux_name)) + mov_err = 0; + } + + if (mov_err) + fprintf(stderr, "%s: warning: unable to move ldlinux.sys: %s\n", + device, strerror(errno)); + } + umount: #if DO_DIRECT_MOUNT @@ -444,24 +483,6 @@ umount: if ( err ) exit(err); - /* - * Now, use libfat to create a block map. This probably - * should be changed to use ioctl(...,FIBMAP,...) since - * this is supposed to be a simple, privileged version - * of the installer. - */ - fs = libfat_open(libfat_xpread, dev_fd); - ldlinux_cluster = libfat_searchdir(fs, 0, "LDLINUX SYS", &dentry); - secp = sectors; - nsectors = 0; - s = libfat_clustertosector(fs, ldlinux_cluster); - while ( s && nsectors < 65 ) { - *secp++ = s; - nsectors++; - s = libfat_nextsector(fs, s); - } - libfat_close(fs); - /* * Patch ldlinux.sys and the boot sector */ -- cgit v1.2.1 From 882bb6e3d6fe00a8eabb1acb60372cc66b5a905e Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 23 Jan 2007 22:27:51 -0800 Subject: Update documentation to indicate FAT subdirectory support. --- NEWS | 11 ++++++++++- syslinux.doc | 35 ++++++++++++++++++++--------------- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/NEWS b/NEWS index 48a4e134..10895c85 100644 --- a/NEWS +++ b/NEWS @@ -8,7 +8,16 @@ Changes in 3.32: * MEMDISK: Turn on EDD support by default. * MEMDISK: Try to work on some machines on which it would not work when there was no floppy drive in the system. - * Simple menu system: fix serial console support (broken in 3.30). + * Simple menu system: fix serial console support (broken in + 3.30). + * SYSLINUX: Support subdirectories. Like ISOLINUX, the + "current directory" is the directory in which syslinux.cfg + is found; this is searched for in the sequence + /boot/syslinux, /syslinux, /. As a side benefit, label names + like "linux-2.6.18" and "linux-2.6.19" are now supported. + + To install ldlinux.sys in a subdirectory, pass the -d + directory option to the SYSLINUX installer. Changes in 3.31: * The simple menu system (menu.c32 and vesamenu.c32) now diff --git a/syslinux.doc b/syslinux.doc index 356c2898..9fc0ee6f 100644 --- a/syslinux.doc +++ b/syslinux.doc @@ -36,9 +36,9 @@ In order to create a bootable Linux floppy using SYSLINUX, prepare a normal MS-DOS formatted floppy. Copy one or more Linux kernel files to it, then execute the DOS command: - syslinux [-s] a: + syslinux [-sfma][-d directory] a: -(or whichever drive letter is appropriate; the [] meaning -s is optional) +(or whichever drive letter is appropriate; the [] meaning optional.) Use "syslinux.com" (in the dos subdirectory of the distribution) for plain DOS (MS-DOS, DR-DOS, PC-DOS, FreeDOS...) or Win9x/ME. @@ -48,12 +48,13 @@ WinNT/2000/XP. Under Linux, execute the command: - syslinux [-s] [-o offset] /dev/fd0 + syslinux [-sf][-d directory][-o offset] /dev/fd0 (or, again, whichever device is the correct one.) This will alter the boot sector on the disk and copy a file named -LDLINUX.SYS into its root directory. +LDLINUX.SYS into its root directory (or a subdirectory, if the -d +option is specified.) The -s option, if given, will install a "safe, slow and stupid" version of SYSLINUX. This version may work on some very buggy BIOSes @@ -65,6 +66,10 @@ mode. The -o option is used with a disk image file and specifies the byte offset of the filesystem image in the file. +For the DOS and Windows installers, the -m and -a options can be used +on hard drives to write a Master Boot Record (MBR), and to mark the +specific partition active. + On boot time, by default, the kernel will be loaded from the image named LINUX on the boot floppy. This default can be changed, see the section on the SYSLINUX config file. @@ -174,14 +179,11 @@ LABEL label kernel mykernel append myoptions - Notes: Labels are mangled as if they were filenames, and must be - unique after mangling. For example, two labels - "v2.1.30" and "v2.1.31" will not be distinguishable - under SYSLINUX, since both mangle to the same DOS filename. - This is also true for "foo bar" and "foo baz". + Note: The "kernel" doesn't have to be a Linux kernel; it can + be a boot sector or a COMBOOT file (see below.) - The "kernel" doesn't have to be a Linux kernel; it can - be a boot sector or a COMBOOT file (see below.) + Since version 3.32 label names are no longer mangled into DOS + format (for SYSLINUX.) APPEND - Append nothing. APPEND with a single hyphen as argument in a @@ -671,10 +673,13 @@ The Linux boot protocol supports a "boot loader ID", a single byte where the upper nybble specifies a boot loader family (3 = SYSLINUX) and the lower nybble is version or, in the case of SYSLINUX, media: - 0x31 = SYSLINUX - 0x32 = PXELINUX - 0x33 = ISOLINUX - 0x34 = EXTLINUX + 0x31 (49) = SYSLINUX + 0x32 (50) = PXELINUX + 0x33 (51) = ISOLINUX + 0x34 (52) = EXTLINUX + +In recent versions of Linux, this ID is available as +/proc/sys/kernel/bootloader_type. ++++ BUG REPORTS ++++ -- cgit v1.2.1 From a16a528b416d46cbdec4cb97aded26373500e986 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 23 Jan 2007 22:28:40 -0800 Subject: Call this version 3.35 instead of 3.32 --- NEWS | 2 +- version | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 10895c85..a93f72f4 100644 --- a/NEWS +++ b/NEWS @@ -2,7 +2,7 @@ Starting with 1.47, changes marked with SYSLINUX/PXELINUX/ISOLINUX apply to that specific program only; other changes apply to all of them. -Changes in 3.32: +Changes in 3.35: * MEMDISK: New "safeint" mode. * MEMDISK: Be more compliant with the PnP BIOS spec. * MEMDISK: Turn on EDD support by default. diff --git a/version b/version index 269e1a69..e182c31e 100644 --- a/version +++ b/version @@ -1 +1 @@ -3.32 +3.35 -- cgit v1.2.1 From a603406936e7277ff9847a4ed697122761d53cf5 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 23 Jan 2007 23:07:38 -0800 Subject: DOS FAT installer: Correct parsing of -d option --- dos/syslinux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dos/syslinux.c b/dos/syslinux.c index e4066ca5..77742120 100644 --- a/dos/syslinux.c +++ b/dos/syslinux.c @@ -519,8 +519,8 @@ int main(int argc, char *argv[]) set_active = 1; break; case 'd': - if ( opt[1] ) - subdir = ++opt; + if ( argp[1] ) + subdir = *++argp; break; default: usage(); -- cgit v1.2.1 From d0c3ada6595e3d86f41c27b5a9b5ea6e399edfe9 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 23 Jan 2007 23:07:57 -0800 Subject: Win32 FAT installer: support installing in a subdirectory --- win32/syslinux.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/win32/syslinux.c b/win32/syslinux.c index db5007db..1b5b8fda 100644 --- a/win32/syslinux.c +++ b/win32/syslinux.c @@ -233,7 +233,7 @@ int libfat_readfile(intptr_t pp, void *buf, size_t secsize, libfat_sector_t sect noreturn usage(void) { - fprintf(stderr, "Usage: syslinux.exe [-sfma] : [bootsecfile]\n"); + fprintf(stderr, "Usage: syslinux.exe [-sfma][-d directory] : [bootsecfile]\n"); exit(1); } @@ -256,6 +256,7 @@ int main(int argc, char *argv[]) uint32_t ldlinux_cluster; int nsectors; const char *bootsecfile = NULL; + const char *subdir = NULL; int force = 0; /* -f (force) option */ int mbr = 0; /* -m (MBR) option */ @@ -291,6 +292,10 @@ int main(int argc, char *argv[]) case 'a': /* Mark this partition active */ setactive = 1; break; + case 'd': + if ( argp[1] ) + subdir = *++argp; + break; default: usage(); break; @@ -446,6 +451,46 @@ int main(int argc, char *argv[]) /* Close file */ CloseHandle(f_handle); + /* Move the file to the desired location */ + if (subdir) { + char new_ldlinux_name[strlen(subdir)+16]; + char *cp = new_ldlinux_name+3; + const char *sd; + int slash = 1; + + new_ldlinux_name[0] = drive[0]; + new_ldlinux_name[1] = ':'; + new_ldlinux_name[2] = '\\'; + + for (sd = subdir; *sd; sd++) { + if (*sd == '/' || *sd == '\\') { + if (slash) + continue; + *cp++ = '\\'; + } + } + + /* Skip if subdirectory == root */ + if (cp > new_ldlinux_name+3) { + if (!slash) + *cp++ = '\\'; + + memcpy(cp, "ldlinux.sys", 12); + + /* Delete any previous file */ + SetFileAttributes(new_ldlinux_name, FILE_ATTRIBUTE_NORMAL); + DeleteFile(new_ldlinux_name); + if (!MoveFile(ldlinux_name, new_ldlinux_name)) + SetFileAttributes(ldlinux_name, FILE_ATTRIBUTE_READONLY | + FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN); + else + SetFileAttributes(new_ldlinux_name, FILE_ATTRIBUTE_READONLY | + FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN); + } + } + + + /* Make the syslinux boot sector */ syslinux_make_bootsect(sectbuf); -- cgit v1.2.1 From c656897fd2f4ca76e5d6e2a871a858588de0d312 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Wed, 24 Jan 2007 15:13:11 -0800 Subject: New API call: read disk. --- NEWS | 1 + comboot.doc | 23 +++++++++++++++++++++++ comboot.inc | 25 ++++++++++++++++++++++++- 3 files changed, 48 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index a93f72f4..325eb486 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,7 @@ Changes in 3.35: To install ldlinux.sys in a subdirectory, pass the -d directory option to the SYSLINUX installer. + * New API call: read disk. Changes in 3.31: * The simple menu system (menu.c32 and vesamenu.c32) now diff --git a/comboot.doc b/comboot.doc index e7627793..c99522ec 100644 --- a/comboot.doc +++ b/comboot.doc @@ -362,8 +362,10 @@ AX=000Ah [2.00] Get Derivative-Specific Information [SYSLINUX, EXTLINUX] Input: AX 000Ah + CL 9 (to get a valid return in CL for all versions) Output: AL 31h (SYSLINUX), 34h (EXTLINUX) DL drive number + CL sector size as a power of 2 (9 = 512 bytes) [3.35] ES:BX pointer to partition table entry (if DL >= 80h) Note: This function was broken in EXTLINUX 3.00-3.02. @@ -413,6 +415,7 @@ AX=000Ah [2.00] Get Derivative-Specific Information Input: AX 000Ah Output: AL 33h (ISOLINUX) DL drive number + CL 11 (sector size as a power of 2) [3.35] ES:BX pointer to El Torito spec packet Note: Some very broken El Torito implementations do @@ -718,3 +721,23 @@ AX=0018h [3.30] Query custom font This call queries if a custom display font has been loaded via the "font" configuration file command. If no custom font has been loaded, AL contains zero. + + +AX=0019h [3.35] Read disk [SYSLINUX, ISOLINUX, EXTLINUX] + Input: AX 0019h + EDX Sector number + ESI Reserved - MUST BE ZERO + EDI Reserved - MUST BE ZERO + CX Sector count + ES:BX Buffer address + Output: None + + Read disk blocks from the active filesystem (partition); for + disks, sector number zero is the boot sector. For ISOLINUX, + this call reads the CD-ROM. + + For compatiblity with all systems, the buffer should + *neither* cross 64K boundaries, *nor* wrap around the segment. + + This routine reports "boot failed" (and does not return) on + disk error. diff --git a/comboot.inc b/comboot.inc index 5fda9687..fcaa3a7a 100644 --- a/comboot.inc +++ b/comboot.inc @@ -466,6 +466,7 @@ comapi_derinfo: mov P_DL,al mov P_ES,cs mov P_BX,PartInfo + mov P_CL,SECTOR_SHIFT %elif IS_PXELINUX mov ax,[APIVer] mov P_DX,ax @@ -482,6 +483,7 @@ comapi_derinfo: mov P_DL,al mov P_ES,cs mov P_BX,spec_packet + mov P_CL,SECTOR_SHIFT %endif clc ret @@ -769,7 +771,27 @@ comapi_userfont: mov P_AL,al ret - +; +; INT 22h AX=0019h Read disk +; +%if IS_SYSLINUX || IS_MDSLINUX || IS_ISOLINUX || IS_EXTLINUX +comapi_readdisk: + mov esi,P_ESI ; Enforce ESI == EDI == 0, these + or esi,P_EDI ; are reserved for future expansion + jnz .err + mov eax,P_EDX + mov bp,P_CX + mov es,P_ES + mov bx,P_BX + call getlinsec + clc + ret +.err: + stc + ret +%else +comapi_readdisk equ comapi_err +%endif section .data @@ -818,6 +840,7 @@ int22_table: dw comapi_runkernel ; 0016 run kernel image dw comapi_usingvga ; 0017 report video mode change dw comapi_userfont ; 0018 query custom font + dw comapi_readdisk ; 0019 read disk int22_count equ ($-int22_table)/2 APIKeyWait db 0 -- cgit v1.2.1 From 8a9e0c7b9bcc70fdf7a737defcb04b1662523962 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Wed, 24 Jan 2007 21:24:30 -0800 Subject: Win32 FAT installer: fix path mangling for -d option --- win32/syslinux.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/win32/syslinux.c b/win32/syslinux.c index 1b5b8fda..f5d6eae6 100644 --- a/win32/syslinux.c +++ b/win32/syslinux.c @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------- * * * Copyright 2003 Lars Munch Christensen - All Rights Reserved - * Copyright 1998-2004 H. Peter Anvin - All Rights Reserved + * Copyright 1998-2007 H. Peter Anvin - All Rights Reserved * * Based on the Linux installer program for SYSLINUX by H. Peter Anvin * @@ -463,11 +463,18 @@ int main(int argc, char *argv[]) new_ldlinux_name[2] = '\\'; for (sd = subdir; *sd; sd++) { - if (*sd == '/' || *sd == '\\') { + char *c = *sd; + + if (c == '/' || c == '\\') { if (slash) continue; - *cp++ = '\\'; + c = '\\'; + slash = 1; + } else { + slash = 0; } + + *cp++ = c; } /* Skip if subdirectory == root */ -- cgit v1.2.1 From 1ab929ad128a4c34af8007701cc85ca6b49dd7a1 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Wed, 24 Jan 2007 21:43:58 -0800 Subject: Win32 FAT installer: fix type typo (which happened to cancel itself out...) I had written "char *c = ..." instead of "char c = ..."; as it turned out, the resulting (invalid) type conversions all worked themselves out and it didn't matter, except for compiler warnings... --- win32/syslinux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win32/syslinux.c b/win32/syslinux.c index f5d6eae6..613b1fc1 100644 --- a/win32/syslinux.c +++ b/win32/syslinux.c @@ -463,7 +463,7 @@ int main(int argc, char *argv[]) new_ldlinux_name[2] = '\\'; for (sd = subdir; *sd; sd++) { - char *c = *sd; + char c = *sd; if (c == '/' || c == '\\') { if (slash) -- cgit v1.2.1 From 882835c1dd619237dcc41cc7aaa2e7972003a67a Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Wed, 24 Jan 2007 21:49:53 -0800 Subject: DOS FAT installer: Fix name mangling for -d option --- dos/syslinux.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dos/syslinux.c b/dos/syslinux.c index 77742120..31fb9050 100644 --- a/dos/syslinux.c +++ b/dos/syslinux.c @@ -1,6 +1,6 @@ /* ----------------------------------------------------------------------- * * - * Copyright 1998-2004 H. Peter Anvin - All Rights Reserved + * Copyright 1998-2007 H. Peter Anvin - All Rights Reserved * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -603,11 +603,18 @@ int main(int argc, char *argv[]) new_ldlinux_name[2] = '\\'; for (sd = subdir; *sd; sd++) { - if (*sd == '/' || *sd == '\\') { + char c = *sd; + + if (c == '/' || c == '\\') { if (slash) continue; - *cp++ = '\\'; + c = '\\'; + slash = 1; + } else { + slash = 0; } + + *cp++ = c; } /* Skip if subdirectory == root */ -- cgit v1.2.1 From ef80edcda1d202abf19e69fd510b0a3e5ca3752d Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Wed, 24 Jan 2007 21:53:06 -0800 Subject: Document config file search path --- syslinux.doc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/syslinux.doc b/syslinux.doc index 9fc0ee6f..7f07407a 100644 --- a/syslinux.doc +++ b/syslinux.doc @@ -91,10 +91,17 @@ which requires root privilege. ++++ CONFIGURATION FILE ++++ All the configurable defaults in SYSLINUX can be changed by putting a -file called SYSLINUX.CFG in the root directory of the boot floppy. This -is a text file in either UNIX or DOS format, containing one or more of -the following items (case is insensitive for keywords; upper case is used -here to indicate that a word should be typed verbatim): +file called "syslinux.cfg" in the root directory of the boot disk. + +This is a text file in either UNIX or DOS format, containing one or +more of the following items (case is insensitive for keywords; upper +case is used here to indicate that a word should be typed verbatim): + +Starting with version 3.35, the configuration file can also be in +either the /boot/syslinux or /syslinux directories (searched in that +order.) If that is the case, then all filenames are assumed to be +relative to that same directory, unless preceded with a slash or +backslash. All options here applies to PXELINUX, ISOLINUX and EXTLINUX as well as SYSLINUX unless otherwise noted. See the respective .doc files. -- cgit v1.2.1 From 5ed6636a950d39bc2fec9b3485f229eb7f0852e1 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Thu, 25 Jan 2007 13:58:29 -0800 Subject: Compilation fix for older gcc where __DBL_*_EXP__ isn't defined --- com32/include/math.h | 7 +++++ com32/lib/math/strtod.c | 68 +++++++++++++++++++++++++------------------------ 2 files changed, 42 insertions(+), 33 deletions(-) diff --git a/com32/include/math.h b/com32/include/math.h index 5aaa9ada..e3d248fd 100644 --- a/com32/include/math.h +++ b/com32/include/math.h @@ -1,6 +1,13 @@ #ifndef _MATH_H #define _MATH_H +#ifndef __DBL_MIN_EXP__ +# define __DBL_MIN_EXP__ (-1021) +#endif +#ifndef __DBL_MAX_EXP__ +# define __DBL_MAX_EXP__ 1024 +#endif + double pow(double, double); double fabs(double); double strtod(const char *, char **); diff --git a/com32/lib/math/strtod.c b/com32/lib/math/strtod.c index f0b500cb..7289f90b 100644 --- a/com32/lib/math/strtod.c +++ b/com32/lib/math/strtod.c @@ -1,40 +1,42 @@ -// -// strtod.c -// -// Convert string to double -// -// Copyright (C) 2002 Michael Ringgaard. All rights reserved. -// Copyright (C) 2006 H. Peter Anvin. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. Neither the name of the project nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -// SUCH DAMAGE. -// +/* + * strtod.c + * + * Convert string to double + * + * Copyright (C) 2002 Michael Ringgaard. All rights reserved. + * Copyright (C) 2006-2007 H. Peter Anvin. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ #include #include #include +#include static inline int is_real(double x) { -- cgit v1.2.1 From 1b0be9ec81fcddeec48e6e3ce3cbacab1f93ea29 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Thu, 25 Jan 2007 17:03:53 -0800 Subject: Invoke ONERROR if we hit abort_load (and ONERROR is set.) --- NEWS | 1 + abort.inc | 20 ++++++++++++++++---- ui.inc | 4 ++-- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index 325eb486..3320566e 100644 --- a/NEWS +++ b/NEWS @@ -19,6 +19,7 @@ Changes in 3.35: To install ldlinux.sys in a subdirectory, pass the -d directory option to the SYSLINUX installer. * New API call: read disk. + * Invoke ONERROR on initrd load failure. Changes in 3.31: * The simple menu system (menu.c32 and vesamenu.c32) now diff --git a/abort.inc b/abort.inc index 80d70ad6..e6bf0d52 100644 --- a/abort.inc +++ b/abort.inc @@ -1,6 +1,6 @@ ; ----------------------------------------------------------------------- ; -; Copyright 2005-2006 H. Peter Anvin - All Rights Reserved +; Copyright 2005-2007 H. Peter Anvin - All Rights Reserved ; ; This program is free software; you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by @@ -33,8 +33,8 @@ abort_check: .ret1: ret .kill: mov si,aborted_msg - - ; ... fall through ... + mov bx,enter_command + jmp abort_load_chain ; ; abort_load: Called by various routines which wants to print a fatal @@ -44,10 +44,22 @@ abort_check: ; and the stack forcibly. ; ; SI = offset (in _text) of error message to print +; BX = future entry point (abort_load_chain) ; abort_load: + mov bx,error_or_command +abort_load_chain: RESET_STACK_AND_SEGS AX call cwritestr ; Expects SI -> error msg ; Return to the command prompt - jmp enter_command + jmp bx + +; +; error_or_command: Execute ONERROR if appropriate, otherwise enter_command +; +error_or_command: + mov cx,[OnerrorLen] + and cx,cx + jnz on_error + jmp enter_command \ No newline at end of file diff --git a/ui.inc b/ui.inc index 6ea3a4a6..7c68fc54 100644 --- a/ui.inc +++ b/ui.inc @@ -1,6 +1,6 @@ ;; ----------------------------------------------------------------------- ;; -;; Copyright 1994-2005 H. Peter Anvin - All Rights Reserved +;; Copyright 1994-2007 H. Peter Anvin - All Rights Reserved ;; ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -368,7 +368,7 @@ bad_kernel: jmp abort_load ; Ask user for clue ; -; on_error: bad kernel, but we have onerror set +; on_error: bad kernel, but we have onerror set; CX = OnerrorLen ; on_error: mov si,Onerror -- cgit v1.2.1 From 9d84e09edc5e0a8205e0f45849400acf35b18222 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Thu, 25 Jan 2007 17:37:23 -0800 Subject: Quick hack to make sure we build 32-bit binaries with the -m32 flag. Quick hack to make sure we build 32-bit binaries with the -m32 flag. This makes rpmbuild --target i386 do the right thing. A Makefile overhaul is really in order, though. --- syslinux.spec.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/syslinux.spec.in b/syslinux.spec.in index b6128e79..f15ed412 100644 --- a/syslinux.spec.in +++ b/syslinux.spec.in @@ -15,8 +15,10 @@ BuildPrereq: nasm >= 0.98.38, perl Autoreq: 0 %ifarch x86_64 Requires: mtools, libc.so.6()(64bit) +%define mflag %else Requires: mtools, libc.so.6 +%define mflag -m32 %endif # NOTE: extlinux belongs in /sbin, not in /usr/sbin, since it is typically @@ -62,7 +64,7 @@ booting in the /tftpboot directory. %build make clean -make installer +make CC='gcc %{mflag}' installer make -C sample tidy %install -- cgit v1.2.1 From 444ed7bd95a3dcd130a9f9ca06e1a85f3203ccc2 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Thu, 25 Jan 2007 17:49:15 -0800 Subject: Even more places which need -m32... --- syslinux.spec.in | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/syslinux.spec.in b/syslinux.spec.in index f15ed412..d635d4f9 100644 --- a/syslinux.spec.in +++ b/syslinux.spec.in @@ -63,9 +63,9 @@ booting in the /tftpboot directory. %setup -q -n syslinux-%{VERSION} %build -make clean +make CC='gcc %{mflag}' clean make CC='gcc %{mflag}' installer -make -C sample tidy +make CC='gcc %{mflag}' -C sample tidy %install rm -rf %{buildroot} @@ -74,10 +74,10 @@ mkdir -p %{buildroot}%{_sbindir} mkdir -p %{buildroot}%{_datadir}/syslinux mkdir -p %{buildroot}%{_includedir} mkdir -p %{buildroot}/boot %{buildroot}/tftpboot/pxelinux.cfg -make install-all \ +make CC='gcc %{mflag}' install-all \ INSTALLROOT=%{buildroot} BINDIR=%{_bindir} SBINDIR=%{_sbindir} \ LIBDIR=%{_datadir} INCDIR=%{_includedir} -make -C sample tidy +make CC='gcc %{mflag}' -C sample tidy cp mkdiskimage sys2ansi.pl keytab-lilo.pl %{buildroot}%{_datadir}/syslinux cp %{buildroot}%{_datadir}/syslinux/*.c32 %{buildroot}/boot cp %{buildroot}%{_datadir}/syslinux/memdisk %{buildroot}/boot @@ -123,6 +123,9 @@ if [ -f /boot/extlinux.conf ]; then extlinux --update /boot; fi %postun %changelog +* Thu Jan 25 2007 H. Peter Anvin +- Hacks to make the 32-bit version build correctly on 64-bit machines. + * Mon Sep 19 2006 H. Peter Anvin - Add a syslinux-tftpboot module. - Factor extlinux into its own package. -- cgit v1.2.1 From 7be7d5e23af8c42b47232495d5f60979971cb306 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Thu, 25 Jan 2007 21:10:55 -0800 Subject: -FPNG_NO_WRITE_SUPPORTED -> -DPNG_NO_WRITE_SUPPORTED Fix typo. --- com32/lib/MCONFIG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com32/lib/MCONFIG b/com32/lib/MCONFIG index b542196e..39b62db1 100644 --- a/com32/lib/MCONFIG +++ b/com32/lib/MCONFIG @@ -12,7 +12,7 @@ OBJCOPY = objcopy # zlib and libpng configuration flags LIBFLAGS = -DDYNAMIC_CRC_TABLE -DPNG_NO_CONSOLE_IO \ - -FPNG_NO_WRITE_SUPPORTED \ + -DPNG_NO_WRITE_SUPPORTED \ -DPNG_NO_MNG_FEATURES \ -DPNG_NO_READ_tIME -DPNG_NO_WRITE_tIME -- cgit v1.2.1 From f61c5d8767ae6481e58fb25de606aba04827ddf3 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Thu, 25 Jan 2007 21:13:31 -0800 Subject: Update TODO list. --- TODO | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/TODO b/TODO index 42a578e4..3889df4a 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,6 @@ *** To do in the short term: -- PXELINUX: Figure out localboot/idle problems +- PXELINUX: Figure out localboot/idle problems. - PXELINUX: Support changing the default server and boot file prefix? @@ -10,6 +10,8 @@ - Library support for all the comboot system calls. +- Deal with non-512-byte sectors (if I can get media which does...) + *** Future projects: @@ -17,15 +19,14 @@ - Cleaned up documentation, with a real man page. -- Subdirectory support in SYSLINUX. - - Support files that span multiple input media (SYSLINUX) -> Seems to be getting less important; floppies are dying? -- Clean up the handling of sections +- Clean up the handling of sections. + +- API call to get directory listing. + +- COM32-based CLI. -- Add "localboot" support to SYSLINUX (using the ISOLINUX feature - set.) - OBSOLETE: chain.c32 is probably better. +- Rewrite the filesystems to run in protected mode C code. -- API call to get directory listing -- cgit v1.2.1 From 2e00495ac32b1acddcf6473051460bdc61cb71a3 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Thu, 25 Jan 2007 21:15:25 -0800 Subject: Need to support Infinibad. --- TODO | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TODO b/TODO index 3889df4a..e2aacca6 100644 --- a/TODO +++ b/TODO @@ -12,6 +12,8 @@ - Deal with non-512-byte sectors (if I can get media which does...) +- Add support for getting the hardware address on Infinibad. + *** Future projects: -- cgit v1.2.1 From 969a6ae5cabea87bcb56406b6c49adfd6060f96a Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Thu, 25 Jan 2007 21:19:00 -0800 Subject: Acknowledge slax.org --- NEWS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS b/NEWS index 3320566e..095ce29f 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,8 @@ Changes in 3.35: To install ldlinux.sys in a subdirectory, pass the -d directory option to the SYSLINUX installer. + + This work was sponsored by slax.org (thanks, Tomas!) * New API call: read disk. * Invoke ONERROR on initrd load failure. -- cgit v1.2.1 From bb252401072a4976170700fe407078ae4e80d650 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Sat, 27 Jan 2007 11:17:44 -0800 Subject: Update copyright dates to 2007 --- config.inc | 4 ++-- memdisk/version.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config.inc b/config.inc index d4220ef9..32bb62c2 100644 --- a/config.inc +++ b/config.inc @@ -1,6 +1,6 @@ ;; ----------------------------------------------------------------------- ;; -;; Copyright 2002-2005 H. Peter Anvin - All Rights Reserved +;; Copyright 2002-2007 H. Peter Anvin - All Rights Reserved ;; ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -38,6 +38,6 @@ BAUD_DIVISOR equ 115200 ; Serial port parameter ; %define version_str VERSION ; Must be 4 characters long! %define date DATE_STR ; Defined from the Makefile -%define year '2005' +%define year '2007' %endif ; _CONFIG_INC diff --git a/memdisk/version.h b/memdisk/version.h index 9d457388..ceca7961 100644 --- a/memdisk/version.h +++ b/memdisk/version.h @@ -1,6 +1,6 @@ /* ----------------------------------------------------------------------- * * - * Copyright 2002 H. Peter Anvin - All Rights Reserved + * Copyright 2002-2007 H. Peter Anvin - All Rights Reserved * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,6 +20,6 @@ #define MEMDISK_VERSION_H #define FIRSTYEAR "2001" -#define COPYYEAR "2005" +#define COPYYEAR "2007" #endif -- cgit v1.2.1 From e8867319d9a1336eed644f7ac9438bf6a89ba762 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Sun, 28 Jan 2007 16:45:33 -0800 Subject: Apparently rpmbuild can't deal with empty macros. Morons. --- syslinux.spec.in | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/syslinux.spec.in b/syslinux.spec.in index d635d4f9..0559c009 100644 --- a/syslinux.spec.in +++ b/syslinux.spec.in @@ -15,10 +15,10 @@ BuildPrereq: nasm >= 0.98.38, perl Autoreq: 0 %ifarch x86_64 Requires: mtools, libc.so.6()(64bit) -%define mflag +%define cc gcc %else Requires: mtools, libc.so.6 -%define mflag -m32 +%define cc gcc -m32 %endif # NOTE: extlinux belongs in /sbin, not in /usr/sbin, since it is typically @@ -63,9 +63,9 @@ booting in the /tftpboot directory. %setup -q -n syslinux-%{VERSION} %build -make CC='gcc %{mflag}' clean -make CC='gcc %{mflag}' installer -make CC='gcc %{mflag}' -C sample tidy +make CC='%{cc}' clean +make CC='%{cc}' installer +make CC='%{cc}' -C sample tidy %install rm -rf %{buildroot} @@ -74,10 +74,10 @@ mkdir -p %{buildroot}%{_sbindir} mkdir -p %{buildroot}%{_datadir}/syslinux mkdir -p %{buildroot}%{_includedir} mkdir -p %{buildroot}/boot %{buildroot}/tftpboot/pxelinux.cfg -make CC='gcc %{mflag}' install-all \ +make CC='%{cc}' install-all \ INSTALLROOT=%{buildroot} BINDIR=%{_bindir} SBINDIR=%{_sbindir} \ LIBDIR=%{_datadir} INCDIR=%{_includedir} -make CC='gcc %{mflag}' -C sample tidy +make CC='%{cc}' -C sample tidy cp mkdiskimage sys2ansi.pl keytab-lilo.pl %{buildroot}%{_datadir}/syslinux cp %{buildroot}%{_datadir}/syslinux/*.c32 %{buildroot}/boot cp %{buildroot}%{_datadir}/syslinux/memdisk %{buildroot}/boot -- cgit v1.2.1 From 1f7382b2e789b30992f935c471ef154b63cf5b83 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Sun, 28 Jan 2007 16:49:07 -0800 Subject: Apparently rpmbuild won't accept a macro named "cc" either. Morons. --- syslinux.spec.in | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/syslinux.spec.in b/syslinux.spec.in index 0559c009..115a6f20 100644 --- a/syslinux.spec.in +++ b/syslinux.spec.in @@ -15,10 +15,10 @@ BuildPrereq: nasm >= 0.98.38, perl Autoreq: 0 %ifarch x86_64 Requires: mtools, libc.so.6()(64bit) -%define cc gcc +%define my_cc gcc %else Requires: mtools, libc.so.6 -%define cc gcc -m32 +%define my_cc gcc -m32 %endif # NOTE: extlinux belongs in /sbin, not in /usr/sbin, since it is typically @@ -63,9 +63,9 @@ booting in the /tftpboot directory. %setup -q -n syslinux-%{VERSION} %build -make CC='%{cc}' clean -make CC='%{cc}' installer -make CC='%{cc}' -C sample tidy +make CC='%{my_cc}' clean +make CC='%{my_cc}' installer +make CC='%{my_cc}' -C sample tidy %install rm -rf %{buildroot} @@ -74,10 +74,10 @@ mkdir -p %{buildroot}%{_sbindir} mkdir -p %{buildroot}%{_datadir}/syslinux mkdir -p %{buildroot}%{_includedir} mkdir -p %{buildroot}/boot %{buildroot}/tftpboot/pxelinux.cfg -make CC='%{cc}' install-all \ +make CC='%{my_cc}' install-all \ INSTALLROOT=%{buildroot} BINDIR=%{_bindir} SBINDIR=%{_sbindir} \ LIBDIR=%{_datadir} INCDIR=%{_includedir} -make CC='%{cc}' -C sample tidy +make CC='%{my_cc}' -C sample tidy cp mkdiskimage sys2ansi.pl keytab-lilo.pl %{buildroot}%{_datadir}/syslinux cp %{buildroot}%{_datadir}/syslinux/*.c32 %{buildroot}/boot cp %{buildroot}%{_datadir}/syslinux/memdisk %{buildroot}/boot -- cgit v1.2.1 From 248a5f1dd85f7619d044cbd498afce24345563a5 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Sun, 28 Jan 2007 16:53:07 -0800 Subject: Remove -m32 from the CC variable globally. --- memdisk/Makefile | 6 +++--- sample/Makefile | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/memdisk/Makefile b/memdisk/Makefile index f628ff24..b983dfde 100644 --- a/memdisk/Makefile +++ b/memdisk/Makefile @@ -1,6 +1,6 @@ ## ----------------------------------------------------------------------- ## -## Copyright 2001-2004 H. Peter Anvin - All Rights Reserved +## Copyright 2001-2007 H. Peter Anvin - All Rights Reserved ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -19,8 +19,8 @@ M32 := $(call gcc_ok,-m32,) ALIGN := $(call gcc_ok,-falign-functions=0 -falign-jumps=0 -falign-loops=0,-malign-functions=0 -malign-jumps=0 -malign-loops=0) FREE := $(call gcc_ok,-ffreestanding,) -CC = gcc $(M32) $(FREE) -CFLAGS = -g -W -Wall -Wno-sign-compare \ +CC = gcc +CFLAGS = $(M32) $(FREE) -g -W -Wall -Wno-sign-compare \ -Os -fomit-frame-pointer -march=i386 $(ALIGN) \ -DVERSION='"$(VERSION)"' -DDATE='"$(DATE)"' LDFLAGS = -g diff --git a/sample/Makefile b/sample/Makefile index b92f820b..14089060 100644 --- a/sample/Makefile +++ b/sample/Makefile @@ -19,12 +19,12 @@ gcc_ok = $(shell if gcc $(1) -c -x c /dev/null -o /dev/null 2>/dev/null; \ M32 := $(call gcc_ok,-m32,) $(call gcc_ok,-ffreestanding,) -CC = gcc $(M32) +CC = gcc LD = ld -m elf_i386 AR = ar NASM = nasm RANLIB = ranlib -CFLAGS = -W -Wall -march=i386 -Os -fomit-frame-pointer -I../com32/include +CFLAGS = $(M32) -W -Wall -march=i386 -Os -fomit-frame-pointer -I../com32/include SFLAGS = -march=i386 LDFLAGS = -s OBJCOPY = objcopy -- cgit v1.2.1 From d2a510927b3a0e01becee1faa9767e20837caf36 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Sun, 28 Jan 2007 16:56:24 -0800 Subject: sample/Makefile: $(M32) is also needed in $(SFLAGS) --- sample/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample/Makefile b/sample/Makefile index 14089060..e24ab5be 100644 --- a/sample/Makefile +++ b/sample/Makefile @@ -25,7 +25,7 @@ AR = ar NASM = nasm RANLIB = ranlib CFLAGS = $(M32) -W -Wall -march=i386 -Os -fomit-frame-pointer -I../com32/include -SFLAGS = -march=i386 +SFLAGS = $(M32) -march=i386 LDFLAGS = -s OBJCOPY = objcopy PPMTOLSS16 = ../ppmtolss16 -- cgit v1.2.1 From 4911f111ad27674d01cd93b231d1d67100c45805 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Sun, 28 Jan 2007 17:22:00 -0800 Subject: Fix the Makefile to handle overridden CC --- memdisk/Makefile | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/memdisk/Makefile b/memdisk/Makefile index b983dfde..1eebe637 100644 --- a/memdisk/Makefile +++ b/memdisk/Makefile @@ -23,7 +23,8 @@ CC = gcc CFLAGS = $(M32) $(FREE) -g -W -Wall -Wno-sign-compare \ -Os -fomit-frame-pointer -march=i386 $(ALIGN) \ -DVERSION='"$(VERSION)"' -DDATE='"$(DATE)"' -LDFLAGS = -g +SFLAGS = $(M32) -march=i386 -D__ASSEMBLY__ +LDFLAGS = $(M32) -g INCLUDE = -I../com32/include LD = ld -m elf_i386 NASM = nasm -O99 @@ -38,7 +39,7 @@ OBJS32 = start32.o setup.o msetup.o e820func.o conio.o memcpy.o memset.o \ unzip.o memdisk.o CSRC = setup.c msetup.c e820func.c conio.c unzip.c -SSRC = +SSRC = start32.S memcpy.S memset.S NASMSRC = memdisk.asm memdisk16.asm all: memdisk e820test @@ -57,10 +58,13 @@ spotless: clean $(NASM) $(NFLAGS) -f elf -l $*.lst -o $@ $< %.o: %.s - $(CC) -x assembler -c -o $@ $< + $(CC) $(SFLAGS) -c -o $@ $< + +%.o: %.S + $(CC) $(INCLUDE) $(SFLAGS) -c -o $@ $< %.o16: %.s16 - $(CC) -x assembler -c -o $@ $< + $(CC) $(SFLAGS) -x assembler -c -o $@ $< %.o: %.c $(CC) $(INCLUDE) $(CFLAGS) -c -o $@ $< @@ -69,10 +73,10 @@ spotless: clean echo '.code16gcc' | cat - $< > $@ %.s: %.S - $(CC) $(INCLUDE) $(CFLAGS) -D__ASSEMBLY__ -E -o $@ $< + $(CC) $(INCLUDE) $(SFLAGS) -E -o $@ $< %.s16: %.S16 - $(CC) $(INCLUDE) $(CFLAGS) -D__ASSEMBLY__ -E -o $@ $< + $(CC) $(INCLUDE) $(SFLAGS) -x assembler-with-cpp -E -o $@ $< %.s: %.c $(CC) $(INCLUDE) $(CFLAGS) -S -o $@ $< @@ -106,8 +110,8 @@ memdisk.o: memdisk.bin .depend: rm -f .depend - for csrc in *.c ; do $(CC) $(INCLUDE) -MM $$csrc | sed -e 's/\.o/\.s/' >> .depend ; done - for ssrc in $(SSRC) ; do $(CC) $(INCLUDE) -x c -traditional -MM $$ssrc | sed -e 's/\.S16\.o/\.o16/' >> .depend ; done + for csrc in *.c ; do $(CC) $(INCLUDE) $(CFLAGS) -MM $$csrc >> .depend ; done + for ssrc in *.S ; do $(CC) $(INCLUDE) $(SFLAGS) -MM $$ssrc >> .depend ; done for nsrc in $(NASMSRC) ; do $(NASM) -DDEPEND $(NINCLUDE) -o `echo $$nsrc | sed -e 's/\.asm/\.bin/'` -M $$nsrc >> .depend ; done depend: -- cgit v1.2.1 From ae18dd5481cc0f029315a194b1b2dacc5e491c8a Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Sun, 28 Jan 2007 17:31:14 -0800 Subject: Generate gethostip even when cross-compiling with -m32 --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index aaa2ff52..facdbcf6 100644 --- a/Makefile +++ b/Makefile @@ -199,6 +199,7 @@ $(LIB_SO): bootsect_bin.o ldlinux_bin.o syslxmod.o gethostip.o: gethostip.c gethostip: gethostip.o + $(CC) $(LDFLAGS) -o $@ $^ mkdiskimage: mkdiskimage.in mbr.bin bin2hex.pl $(PERL) bin2hex.pl < mbr.bin | cat mkdiskimage.in - > $@ -- cgit v1.2.1 From ac1f3a0f6494264528dc41b18c6c352daad6b73e Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Sun, 28 Jan 2007 17:33:21 -0800 Subject: Remove redundant rule for gethostip.o --- Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Makefile b/Makefile index facdbcf6..07ed28ba 100644 --- a/Makefile +++ b/Makefile @@ -196,8 +196,6 @@ libsyslinux.a: bootsect_bin.o ldlinux_bin.o mbr_bin.o syslxmod.o $(LIB_SO): bootsect_bin.o ldlinux_bin.o syslxmod.o $(CC) $(LDFLAGS) -shared -Wl,-soname,$(LIB_SONAME) -o $@ $^ -gethostip.o: gethostip.c - gethostip: gethostip.o $(CC) $(LDFLAGS) -o $@ $^ -- cgit v1.2.1 From fc77d7f9a369fffe47cd303ad062f103c4a1ccbd Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Sun, 28 Jan 2007 17:36:25 -0800 Subject: Make including .depend obligatory (otherwise make might not generate it?) --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 07ed28ba..c9269ddc 100644 --- a/Makefile +++ b/Makefile @@ -263,4 +263,4 @@ klibc: -include Makefile.private # Include dependencies file --include .depend +include .depend -- cgit v1.2.1 From 8b48c5ccfc87d4c4688d4e0e78538b9e84bec4bb Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Sun, 28 Jan 2007 17:41:06 -0800 Subject: When making a release, force a tag even if it already exists --- Makefile.private | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.private b/Makefile.private index ddbf75b0..9f822b2b 100644 --- a/Makefile.private +++ b/Makefile.private @@ -43,7 +43,7 @@ official: release: test -d release rm -f '$(GIT_DIR)'/refs/tags/syslinux-$(VERSION) - cg-tag syslinux-$(VERSION) + cg-tag -f syslinux-$(VERSION) -rm -rf release/syslinux-$(VERSION) -rm -f release/syslinux-$(VERSION).* cd release && env GIT_DIR='$(ABS_GIT_DIR)' cg-export -r syslinux-$(VERSION) syslinux-$(VERSION) -- cgit v1.2.1 From 8a58c2c41a8daf3e64ed2f4e58fe7e043f197244 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Sun, 28 Jan 2007 17:48:13 -0800 Subject: Quiet warnings when building in a non-git directory. --- Makefile.private | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.private b/Makefile.private index 9f822b2b..63a3bbdf 100644 --- a/Makefile.private +++ b/Makefile.private @@ -1,6 +1,6 @@ ## -*- makefile -*- ------------------------------------------------------ ## -## Copyright 2000-2006 H. Peter Anvin - All Rights Reserved +## Copyright 2000-2007 H. Peter Anvin - All Rights Reserved ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -20,7 +20,7 @@ PRIVATE = Makefile.private .depend */.depend GIT_DIR ?= .git -ABS_GIT_DIR := $(shell cd '$(GIT_DIR)' && pwd) +ABS_GIT_DIR := $(shell cd '$(GIT_DIR)' 2>/dev/null && pwd) -include release/Makefile.secret -- cgit v1.2.1 From aa4b75f7257966f14940848366fa16087debe820 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Sun, 28 Jan 2007 17:56:15 -0800 Subject: Use %-style of implicit rules when we don't have SUFFIXES set. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c9269ddc..7673cf5c 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ PERL = perl VERSION = $(shell cat version) -.c.o: +%.o: %.c $(CC) $(INCLUDE) $(CFLAGS) -c $< # -- cgit v1.2.1