mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: h.feurstein@gmail.com
To: barebox@lists.infradead.org
Cc: Hubert Feurstein <hubert.feurstein@deto.at>
Subject: [PATCH] common/bootargs: add blkdevparts variables
Date: Mon, 16 Feb 2015 14:03:18 +0100	[thread overview]
Message-ID: <1424091798-23393-1-git-send-email-h.feurstein@gmail.com> (raw)

From: Hubert Feurstein <hubert.feurstein@deto.at>

The kernel command line option blkdevparts works like mtdparts, but for all
block devices. So it can be used for eMMC devices without the need of a
traditional partition table.

Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com>
---
 common/bootargs.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/common/bootargs.c b/common/bootargs.c
index 6624f72..803736f 100644
--- a/common/bootargs.c
+++ b/common/bootargs.c
@@ -38,7 +38,7 @@ static int linux_bootargs_overwritten;
  */
 const char *linux_bootargs_get(void)
 {
-	char *bootargs, *mtdparts;
+	char *bootargs, *parts;
 
 	if (linux_bootargs_overwritten)
 		return linux_bootargs;
@@ -49,14 +49,21 @@ const char *linux_bootargs_get(void)
 	if (!strlen(bootargs))
 		return getenv("bootargs");
 
-	mtdparts = globalvar_get_match("linux.mtdparts.", ";");
+	linux_bootargs = bootargs;
 
-	if (strlen(mtdparts)) {
-		linux_bootargs = asprintf("%s mtdparts=%s", bootargs, mtdparts);
-		free(bootargs);
-		free(mtdparts);
-	} else {
-		free(mtdparts);
+	parts = globalvar_get_match("linux.mtdparts.", ";");
+	if (strlen(parts)) {
+		bootargs = asprintf("%s mtdparts=%s", linux_bootargs, parts);
+		free(linux_bootargs);
+		free(parts);
+		linux_bootargs = bootargs;
+	}
+
+	parts = globalvar_get_match("linux.blkdevparts.", ";");
+	if (strlen(parts)) {
+		bootargs = asprintf("%s blkdevparts=%s", linux_bootargs, parts);
+		free(linux_bootargs);
+		free(parts);
 		linux_bootargs = bootargs;
 	}
 
@@ -78,3 +85,4 @@ int linux_bootargs_overwrite(const char *bootargs)
 
 BAREBOX_MAGICVAR_NAMED(global_linux_bootargs_, global.linux.bootargs.*, "Linux bootargs variables");
 BAREBOX_MAGICVAR_NAMED(global_linux_mtdparts_, global.linux.mtdparts.*, "Linux mtdparts variables");
+BAREBOX_MAGICVAR_NAMED(global_linux_blkdevparts_, global.linux.blkdevparts.*, "Linux blkdevparts variables");
-- 
2.3.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2015-02-16 13:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-16 13:03 h.feurstein [this message]
2015-02-17  7:51 ` Sascha Hauer

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=1424091798-23393-1-git-send-email-h.feurstein@gmail.com \
    --to=h.feurstein@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=hubert.feurstein@deto.at \
    /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