Re: [PATCH] early serial console support

Matthew Wilcox
2004-04-01T22:34:16Z

On Thu, Apr 01, 2004 at 03:21:16PM -0700, Bjorn Helgaas wrote:
> + /*
> + * The presence of an HCDP entry does not imply that we should
> + * use a serial console.
> + */
> + if (!strstr(cmdline, "console=serial"))
> + return;

Yes, but ... it's legal to say "console=tty,serial". So perhaps we need
something like ...

char *constart = strstr(cmdline, "console=");
if (!constart)
return;
constart += 8;
char *consend = strchr(constart, ' ');
if (!consend)
consend = constart + strlen(constart);
if (!memmem(constart, consend - consline, "serial", 6))
return;

--
"Next the statesmen will invent cheap lies, putting the blame upon
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince
himself that the war is just, and will thank God for the better sleep
he enjoys after this process of grotesque self-deception." -- Mark Twain