From af428784d8226d967809736eb2e2fd9099f1b2d5 Mon Sep 17 00:00:00 2001 From: hpa Date: Tue, 25 Feb 2003 00:52:20 +0000 Subject: [PATCH] Actually support comment lines. --- NEWS | 3 +++ genhash.pl | 5 ++++- keywords | 1 + keywords.inc | 1 + parseconfig.inc | 37 ++++++++++++++++++------------------- syslinux.doc | 5 +++-- 6 files changed, 30 insertions(+), 22 deletions(-) diff --git a/NEWS b/NEWS index 107d8dd..1864dcd 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,9 @@ 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 2.03: + * Actually support comment lines in the configuration file. + Changes in 2.02: * SYSLINUX: Security flaws have been found in the SYSLINUX installer when running setuid root. Rewrite the SYSLINUX diff --git a/genhash.pl b/genhash.pl index a0d9bc2..6fab579 100755 --- a/genhash.pl +++ b/genhash.pl @@ -5,6 +5,9 @@ while ( defined($keywd = ) ) { chomp $keywd; + + ($keywd,$keywdname) = split(/\s+/, $keywd); + $keywdname = $keywd unless ( $keywdname ); $l = length($keywd); $h = 0; @@ -17,5 +20,5 @@ while ( defined($keywd = ) ) { $h, $keywd, $seenhash{$h}; } $seenhash{$h} = $keywd; - printf("%-23s equ 0x%08x\n", "hash_\L${keywd}\E", $h); + printf("%-23s equ 0x%08x\n", "hash_${keywdname}", $h); } diff --git a/keywords b/keywords index 964c69a..f8e8c8e 100644 --- a/keywords +++ b/keywords @@ -1,3 +1,4 @@ +# hash append default display diff --git a/keywords.inc b/keywords.inc index 1025543..b1dacfd 100644 --- a/keywords.inc +++ b/keywords.inc @@ -44,6 +44,7 @@ keywd_size equ 8 ; Bytes per keyword align 4, db 0 keywd_table: + keyword hash, pc_comment keyword append, pc_append keyword default, pc_default keyword display, pc_filecmd, get_msg_file diff --git a/parseconfig.inc b/parseconfig.inc index 96c52b4..b24d924 100644 --- a/parseconfig.inc +++ b/parseconfig.inc @@ -79,10 +79,7 @@ pc_localboot: call getint ; "kernel" command pc_kernel: cmp word [VKernelCtr],byte 0 je .err ; ("label" section only) - mov di,trackbuf - push di - call getline - pop si + call pc_getline mov di,VKernelBuf+vk_rname call mangle_name .err: ret @@ -115,10 +112,7 @@ pc_setint16: ; "display", "font", "kbdmap" ; pc_filecmd: push ax ; Function to tailcall - mov di,trackbuf - push di - call getline - pop si + call pc_getline mov di,MNameBuf push di call mangle_name @@ -217,10 +211,7 @@ pc_serial: call getint ; "F"-key command ; pc_fkey: push ax - mov di,trackbuf - push di - call getline ; Get filename to display - pop si + call pc_getline pop di call mangle_name ; Mangle file name ret @@ -229,10 +220,7 @@ pc_fkey: push ax ; "label" command ; pc_label: call commit_vk ; Commit any current vkernel - mov di,trackbuf ; Get virtual filename - push di - call getline - pop si + call pc_getline mov di,VKernelBuf+vk_vname call mangle_name ; Mangle virtual name inc word [VKernelCtr] ; One more vkernel @@ -254,14 +242,25 @@ pc_label: call commit_vk ; Commit any current vkernel ; ; "say" command ; -pc_say: mov di,trackbuf ; "say" command +pc_say: call pc_getline ; "say" command + call writestr + jmp crlf ; tailcall + +; +; Comment line +; +pc_comment equ pc_getline ; Get a line and discard + +; +; Common subroutine: load line into trackbuf; returns with SI -> trackbuf +; +pc_getline: mov di,trackbuf push di call getline xor al,al stosb ; Null-terminate pop si - call writestr - jmp crlf ; tailcall + ret ; ; Main loop for configuration file parsing diff --git a/syslinux.doc b/syslinux.doc index ae5903b..d6e579b 100644 --- a/syslinux.doc +++ b/syslinux.doc @@ -99,6 +99,8 @@ All options here applies to PXELINUX as well as SYSLINUX unless otherwise noted. See pxelinux.doc for additional information on PXELINUX. +# comment + A comment line. The whitespace after the hash mark is mandatory. DEFAULT kernel options... Sets the default command line. If SYSLINUX boots automatically, @@ -291,8 +293,7 @@ F0 filename the help screens, e.g. <2> to get to the F2 screen, and <0> for the F10 one. -In the configuration file blank lines and comment lines beginning -with a hash mark (#) are ignored. +Blank lines are ignored. Note that the configuration file is not completely decoded. Syntax different from the one described above may still work correctly in this -- 2.7.4