[syslinux] [PATCH 2/9] ldlinux: Print a warning if no config file is found
Matt Fleming
matt.fleming at intel.com
Mon Nov 5 02:28:52 PST 2012
On Sat, 2012-11-03 at 01:00 -0400, Shao Miller wrote:
> On 11/2/2012 10:13, Matt Fleming wrote:
> > From: Matt Fleming <matt.fleming at intel.com>
> >
> > This behaviour is taken from 4.06, where an error message is printed
> > if no config file is found. A warning is a more user-friendly choice
> > since Syslinux will still function without a config file.
> >
> > Signed-off-by: Matt Fleming <matt.fleming at intel.com>
> > ---
> > com32/elflink/ldlinux/readconfig.c | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/com32/elflink/ldlinux/readconfig.c b/com32/elflink/ldlinux/readconfig.c
> > index 1db397a..2fa0641 100644
> > --- a/com32/elflink/ldlinux/readconfig.c
> > +++ b/com32/elflink/ldlinux/readconfig.c
> > @@ -1420,7 +1420,10 @@ void parse_configs(char **argv)
> > current_menu = root_menu;
> >
> > if (!argv || !*argv) {
> > - parse_one_config(NULL);
> > + if (parse_one_config(NULL) < 0) {
> > + printf("WARNING: No configuration file found\n");
> > + return;
> > + }
> > } else {
> > while ((filename = *argv++)) {
> > dprintf("Parsing config: %s", filename);
> >
>
> Except for PXELINUX, where it might be best as "ERROR". Gene Cumm
> suggested something like:
>
> printf("%s: No configuration file found\n", is_pxelinux ? "ERROR" :
> "WARNING");
There's some pending changes for 5.00-pre10 that mean the actual error
message you see under PXELINUX if the config file is missing is this one
from pxe_open_config(),
printf("%-68s\n", "Unable to locate configuration file");
kaboom();
If people want an "ERROR" in it somewhere, I'm all for that. Please send
a patch.
--
Matt Fleming, Intel Open Source Technology Center
More information about the Syslinux
mailing list