mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] common/bootargs: add blkdevparts variables
@ 2015-02-16 13:03 h.feurstein
  2015-02-17  7:51 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: h.feurstein @ 2015-02-16 13:03 UTC (permalink / raw)
  To: barebox; +Cc: Hubert Feurstein

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] common/bootargs: add blkdevparts variables
  2015-02-16 13:03 [PATCH] common/bootargs: add blkdevparts variables h.feurstein
@ 2015-02-17  7:51 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2015-02-17  7:51 UTC (permalink / raw)
  To: h.feurstein; +Cc: Hubert Feurstein, barebox

On Mon, Feb 16, 2015 at 02:03:18PM +0100, h.feurstein@gmail.com wrote:
> 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.

Uh, wrong world. For mtd devices I would be glad if the partition table
would be stored on the device. Now we get support for separating the
partition tables for block devices. Anyway, applied, thanks

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-02-17  7:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-16 13:03 [PATCH] common/bootargs: add blkdevparts variables h.feurstein
2015-02-17  7:51 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox