[Bug 4520] [RFC] kexecboot: passing extra cmdline arguments

bugzilla-daemon at amethyst.openembedded.net bugzilla-daemon at amethyst.openembedded.net
Sat Aug 30 11:25:38 UTC 2008


http://bugs.openembedded.net/show_bug.cgi?id=4520





--- Comment #14 from Thomas Kunze <thommy at tabao.de>  2008-08-30 13:25:38 ---

> with only one invocation on snprintf. E.g.:
> 
> ---- /code -----
>     snprintf(command, sizeof(command), "/usr/sbin/kexec
> --command-line=\"%s%s%croot=%s rootfstype=%s rootwait\" -l %s",
>         boot->cmdline, extra_cmdline,
>             (boot->cmdline || '\0' != extra_cmdline[0] ? ' ' : '\0'),
>         boot->device, boot->fstype, boot->kernelpath);
> ---- code -----
Lets be cmdline=foo and extra_cmdline="\0". We get:
--command-line="foo\0 root=..."

We should have better conventions:
i.e. 
boot->{cmdline, extra_cmdline, device, fstype, kernelpath}:
-must not be space prefixed or suffixed and must not contain "\0"
-must be set to NULL if not set.

This makes the above simplification impossible right? If you know some better
way feel free to say so.

-- 
Configure bugmail: http://bugs.openembedded.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.




More information about the Openembedded-issues mailing list