grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: <grub-devel@gnu.org>
Subject: [PATCH] grub-legacy: fix 256 char limitation on kernel command line length
Date: Thu, 21 Nov 2013 14:40:08 -0500	[thread overview]
Message-ID: <20131121194008.GA13513@windriver.com> (raw)

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 <paul.gortmaker@windriver.com>

---

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
 
 /*


                 reply	other threads:[~2013-11-21 21:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20131121194008.GA13513@windriver.com \
    --to=paul.gortmaker@windriver.com \
    --cc=grub-devel@gnu.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).