From: Olaf Dabrunz <od@suse.de>
To: Bernhard Walle <bwalle@suse.de>
Cc: kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
linux-arch@vger.kernel.org
Subject: Re: [patch 1/5] Extended crashkernel command line
Date: Tue, 11 Sep 2007 15:14:45 +0200 [thread overview]
Message-ID: <20070911131445.GA17460@suse.de> (raw)
In-Reply-To: <20070909083914.488571169@strauss.suse.de>
On 09-Sep-07, Bernhard Walle wrote:
> If there are multiple occurrences, then the last one is taken. The advantage
> is that if you have a bootloader like lilo or elilo which allows you to append
> a command line parameter but not to remove one (like in GRUB), then you can add
> another crashkernel value for testing at the boot command line and this one
> overwrites the command line in the configuration then.
AFAIK it is the other way round: the lilo configuration-parameter
"append" appends the kernel parameters in the configuration to the
parameters given by the user on the kernel command line.
So the parameters set by the user during boot appear first on the
command line.
> Signed-off-by: Bernhard Walle <bwalle@suse.de>
>
> ---
> include/linux/kexec.h | 2
> kernel/kexec.c | 139 ++++++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 141 insertions(+)
>
> --- a/include/linux/kexec.h
> +++ b/include/linux/kexec.h
> @@ -179,6 +179,8 @@ extern note_buf_t *crash_notes;
> extern u32 vmcoreinfo_note[VMCOREINFO_NOTE_SIZE/4];
> extern unsigned int vmcoreinfo_size;
> extern unsigned int vmcoreinfo_max_size;
> +int parse_crashkernel(char *cmdline, unsigned long long system_ram,
> + unsigned long long *crash_size, unsigned long long *crash_base);
>
> [...]
>
> +int parse_crashkernel(char *cmdline,
> + unsigned long long system_ram,
> + unsigned long long *crash_size,
> + unsigned long long *crash_base)
> +{
> + char *p = cmdline, *ck_cmdline = NULL;
> + char *first_colon, *first_space;
> +
> + /* find crashkernel and use the last one if there are more */
> + p = strstr(p, "crashkernel=");
> + while (p) {
> + ck_cmdline = p;
> + p = strstr(p+1, "crashkernel=");
> + }
> +
So perhaps something like this instead:
+ /* find crashkernel and use the first one if there are more */
+ p = strstr(p, "crashkernel=");
+ ck_cmdline = p;
> + if (!ck_cmdline)
> + return -EINVAL;
> +
> + ck_cmdline += 12; /* strlen("crashkernel=") */
> +
> + /*
> + * if the commandline contains a ':', then that's the extended
> + * syntax -- if not, it must be the classic syntax
> + */
> + first_colon = strchr(ck_cmdline, ':');
> + first_space = strchr(ck_cmdline, ' ');
> + if (first_colon && (!first_space || first_colon < first_space))
>
> [...]
--
Olaf Dabrunz (od/odabrunz), SUSE Linux Products GmbH, Nürnberg
next prev parent reply other threads:[~2007-09-11 13:14 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-09 8:39 [patch 0/5] Add extended crashkernel command line syntax Bernhard Walle
2007-09-09 8:39 ` [patch 1/5] Extended crashkernel command line Bernhard Walle
2007-09-11 6:15 ` Vivek Goyal
2007-09-11 10:01 ` Bernhard Walle
2007-09-12 11:23 ` Vivek Goyal
2007-09-12 11:35 ` Bernhard Walle
2007-09-11 13:14 ` Olaf Dabrunz [this message]
2007-09-11 15:32 ` Lombard, David N
2007-09-11 17:21 ` Bernhard Walle
2007-09-09 8:39 ` [patch 2/5] Use extended crashkernel command line on i386 Bernhard Walle
2007-09-09 8:39 ` [patch 3/5] Use extended crashkernel command line on x86_64 Bernhard Walle
2007-09-09 17:27 ` [discuss] " Yinghai Lu
2007-09-09 18:52 ` Bernhard Walle
2007-09-09 21:06 ` Eric W. Biederman
2007-09-11 5:14 ` Vivek Goyal
2007-09-11 10:01 ` Bernhard Walle
2007-09-09 8:39 ` [patch 4/5] Use extended crashkernel command line on IA64 Bernhard Walle
2007-09-09 13:01 ` Matthew Wilcox
2007-09-09 19:08 ` Bernhard Walle
2007-09-09 8:39 ` [patch 5/5] Add documentation for extended crashkernel syntax Bernhard Walle
2007-09-11 6:09 ` [patch 0/5] Add extended crashkernel command line syntax Vivek Goyal
2007-09-13 15:02 ` Bernhard Walle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070911131445.GA17460@suse.de \
--to=od@suse.de \
--cc=bwalle@suse.de \
--cc=kexec@lists.infradead.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).