From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1VjbfV-0003YO-97 for mharc-grub-devel@gnu.org; Thu, 21 Nov 2013 16:20:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52139) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vja6m-0006e5-1H for grub-devel@gnu.org; Thu, 21 Nov 2013 14:40:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vja6f-0000hA-Fi for grub-devel@gnu.org; Thu, 21 Nov 2013 14:40:11 -0500 Received: from mail1.windriver.com ([147.11.146.13]:45629) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vja6e-0000XO-Ua for grub-devel@gnu.org; Thu, 21 Nov 2013 14:40:05 -0500 Received: from ALA-HCB.corp.ad.wrs.com (ala-hcb.corp.ad.wrs.com [147.11.189.41]) by mail1.windriver.com (8.14.5/8.14.5) with ESMTP id rALJdxou025315 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL) for ; Thu, 21 Nov 2013 11:40:00 -0800 (PST) Received: from yow-pgortmak-d1 (128.224.146.65) by ALA-HCB.corp.ad.wrs.com (147.11.189.41) with Microsoft SMTP Server id 14.2.347.0; Thu, 21 Nov 2013 11:39:59 -0800 Received: by yow-pgortmak-d1 (Postfix, from userid 1000) id A9D99E1D188; Thu, 21 Nov 2013 14:40:08 -0500 (EST) Date: Thu, 21 Nov 2013 14:40:08 -0500 From: Paul Gortmaker To: Subject: [PATCH] grub-legacy: fix 256 char limitation on kernel command line length Message-ID: <20131121194008.GA13513@windriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 147.11.146.13 X-Mailman-Approved-At: Thu, 21 Nov 2013 16:20:07 -0500 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Nov 2013 19:40:19 -0000 The legacy grub only copies 0xff chars of cmdline, which means that longer lines used with nfsroot and static network settings may get truncated. The code where this happens is in stage2/boot.c: while (dest < linux_data_tmp_addr + LINUX_CL_END_OFFSET && *src) *(dest++) = *(src++); Bump everything up by 0x100 to give us 512 chars, or double what it used to be. Current x86 kernels support up to 2048 chars, but this will cover 99% of currently failing use cases. Signed-off-by: Paul Gortmaker --- diff --git a/stage2/shared.h b/stage2/shared.h index 818062c..8cf24da 100644 --- a/stage2/shared.h +++ b/stage2/shared.h @@ -160,8 +160,8 @@ extern char *grub_scratch_mem; #define LINUX_VID_MODE_ASK 0xFFFD #define LINUX_CL_OFFSET 0x9000 -#define LINUX_CL_END_OFFSET 0x90FF -#define LINUX_SETUP_MOVE_SIZE 0x9100 +#define LINUX_CL_END_OFFSET 0x91FF +#define LINUX_SETUP_MOVE_SIZE 0x9200 #define LINUX_CL_MAGIC 0xA33F /*