From horms  Thu Jan  4 14:21:54 2007
Received: from mail.au.vergenet.net [203.222.130.46]
	by tabatha.lab.ultramonkey.org with POP3 (fetchmail-6.3.6-rc3)
	for <horms@localhost> (single-drop); Thu, 04 Jan 2007 14:21:54 +0900 (JST)
Received: by stephanie (mbox horms)
 (with Cubic Circle's cucipop (v1.31 1998/05/13) Thu Jan  4 16:21:53 2007)
X-From_: fastboot-bounces@lists.osdl.org  Thu Jan  4 16:14:50 2007
Return-Path: <fastboot-bounces@lists.osdl.org>
Received: from smtp.osdl.org (smtp0.osdl.org [65.172.181.24])
	by stephanie.vergenet.net (8.12.3/8.12.3) with ESMTP id l045EmVL008952
	for <horms@verge.net.au>; Thu, 4 Jan 2007 16:14:49 +1100
Received: from fire-2.osdl.org (localhost [127.0.0.1])
	by smtp.osdl.org (8.12.8/8.12.8) with ESMTP id l0458TJk028949;
	Wed, 3 Jan 2007 21:08:55 -0800
Received: from ausmtp04.au.ibm.com (ausmtp04.au.ibm.com [202.81.18.152])
	by smtp.osdl.org (8.12.8/8.12.8) with ESMTP id l0458OJi028940
	(version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=FAIL)
	for <fastboot@lists.osdl.org>; Wed, 3 Jan 2007 21:08:26 -0800
Received: from sd0208e0.au.ibm.com (d23rh904.au.ibm.com [202.81.18.202])
	by ausmtp04.au.ibm.com (8.13.8/8.13.5) with ESMTP id l045LXn6273796
	for <fastboot@lists.osdl.org>; Thu, 4 Jan 2007 16:21:35 +1100
Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.250.237])
	by sd0208e0.au.ibm.com (8.13.6/8.13.6/NCO v8.1.1) with ESMTP id
	l045BQ2Q245508
	for <fastboot@lists.osdl.org>; Thu, 4 Jan 2007 16:11:31 +1100
Received: from d23av04.au.ibm.com (loopback [127.0.0.1])
	by d23av04.au.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id
	l0457vXv025713
	for <fastboot@lists.osdl.org>; Thu, 4 Jan 2007 16:07:57 +1100
Received: from cws2222.cwsit.com ([9.124.31.105])
	by d23av04.au.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id
	l0457vOf025694; Thu, 4 Jan 2007 16:07:57 +1100
Received: from thechosenOne.com (localhost.localdomain [127.0.0.1])
	by cws2222.cwsit.com (Postfix) with ESMTP id 1EE4FA6C001;
	Thu,  4 Jan 2007 10:34:48 +0530 (IST)
Received: (from ankita@localhost)
	by thechosenOne.com (8.13.1/8.13.1/Submit) id l0454lve017790;
	Thu, 4 Jan 2007 10:34:47 +0530
Date: Thu, 4 Jan 2007 10:34:47 +0530
From: Ankita Garg <ankita@in.ibm.com>
To: fastboot@lists.osdl.org
Message-ID: <20070104050447.GA12206@in.ibm.com>
Mime-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.4.1i
Received-SPF: pass (localhost is always allowed.)
X-MIMEDefang-Filter: osdl$Revision: 1.166 $
Cc: Neil Horman <nhorman@redhat.com>
Subject: [Fastboot] [PATCH 1/2] kexec-tool: Add generic function to append a
	string to second kernel commandline
X-BeenThere: fastboot@lists.osdl.org
X-Mailman-Version: 2.1.8
Precedence: list
Reply-To: ankita@in.ibm.com
List-Id: discussion of various fast-boot projects <fastboot.lists.osdl.org>
List-Unsubscribe: <https://lists.osdl.org/mailman/listinfo/fastboot>,
	<mailto:fastboot-request@lists.osdl.org?subject=unsubscribe>
List-Archive: <http://lists.osdl.org/pipermail/fastboot>
List-Post: <mailto:fastboot@lists.osdl.org>
List-Help: <mailto:fastboot-request@lists.osdl.org?subject=help>
List-Subscribe: <https://lists.osdl.org/mailman/listinfo/fastboot>,
	<mailto:fastboot-request@lists.osdl.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Sender: fastboot-bounces@lists.osdl.org
Errors-To: fastboot-bounces@lists.osdl.org
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by stephanie.vergenet.net id l045EmVL008952
X-Spam-Checker-Version: SpamAssassin 3.0.4-stephanie.vergenet.net_20061221 
	(2005-06-05) on stephanie
X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00 autolearn=ham 
	version=3.0.4-stephanie.vergenet.net_20061221
X-Spam-Level: 
X-Loop: oathstix_finish by stephanie
X-Loop: oathstix_finish by tabatha.lab.ultramonkey.org

Hi,

o Patch to add a generic function to append a string eg. reset_devices, to the 
  second kernel command line.

Signed-off-by: Ankita Garg <ankita@in.ibm.com>
--

 kexec.c |   16 ++++++++++++++++
 kexec.h |    2 +-
 2 files changed, 17 insertions(+), 1 deletion(-)

Index: kexec-tools-testing-20061214/kexec/kexec.c
===================================================================
--- kexec-tools-testing-20061214.orig/kexec/kexec.c	2008-04-11 03:05:38.000000000 -0500
+++ kexec-tools-testing-20061214/kexec/kexec.c	2008-04-11 03:10:05.000000000 -0500
@@ -347,6 +347,22 @@
 	return base;
 }
 
+int cmdline_append_string(char *cmdline, char *append_str, int cmdline_size)
+{
+	int cmdlen;
+
+	if(cmdline_size)
+	{
+		cmdlen = strlen(cmdline) + strlen(append_str);
+		if (cmdlen > (cmdline_size - 1))
+			die("Command line overflow\n");
+	}
+	strcat(cmdline, append_str);
+	dfprintf(stdout, "Command line after adding reset_devices\n");
+	dfprintf(stdout, "%s\n", cmdline);
+	return 0;
+}
+
 char *slurp_file(const char *filename, off_t *r_size)
 {
 	int fd;
Index: kexec-tools-testing-20061214/kexec/kexec.h
===================================================================
--- kexec-tools-testing-20061214.orig/kexec/kexec.h	2008-04-11 03:05:38.000000000 -0500
+++ kexec-tools-testing-20061214/kexec/kexec.h	2008-04-11 19:33:25.000000000 -0500
@@ -188,7 +188,8 @@
 	const void *buf, unsigned long bufsz, unsigned long memsz,
 	unsigned long buf_align, unsigned long buf_min, unsigned long buf_max,
 	int buf_end);
-
+extern int cmdline_append_string(char *cmdline, char *append_str,
+	int cmdline_size);
 extern unsigned char purgatory[];
 extern size_t purgatory_size;
 

Regards, 
-- 
Ankita Garg (ankita@in.ibm.com)
Linux Technology Center
IBM India Systems & Technology Labs, 
Bangalore, India   
_______________________________________________
fastboot mailing list
fastboot@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/fastboot
