mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 6/6] blspec: push appendroot handling to bootm
Date: Fri, 29 Apr 2016 11:52:05 +0200	[thread overview]
Message-ID: <1461923525-6356-7-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1461923525-6356-1-git-send-email-s.hauer@pengutronix.de>

The bootm code now can handle the adding of the root= option itself,
so drop the code and let bootm do it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 common/blspec.c | 39 +++++++++++++--------------------------
 1 file changed, 13 insertions(+), 26 deletions(-)

diff --git a/common/blspec.c b/common/blspec.c
index 1800556..ac8f512 100644
--- a/common/blspec.c
+++ b/common/blspec.c
@@ -637,29 +637,6 @@ int blspec_scan_devicename(struct blspec *blspec, const char *devname)
 	return blspec_scan_device(blspec, dev);
 }
 
-static int blspec_append_root(struct blspec_entry *entry)
-{
-	const char *appendroot;
-	char *rootarg;
-
-	appendroot = blspec_entry_var_get(entry, "linux-appendroot");
-	if (!appendroot || strcmp(appendroot, "true"))
-		return 0;
-
-	rootarg = path_get_linux_rootarg(entry->rootpath);
-	if (IS_ERR(rootarg)) {
-		pr_err("Getting root argument for %s failed with: %s\n",
-				entry->rootpath, strerrorp(rootarg));
-		return PTR_ERR(rootarg);
-	}
-
-	globalvar_add_simple("linux.bootargs.dyn.blspec.appendroot", rootarg);
-
-	free(rootarg);
-
-	return 0;
-}
-
 /*
  * blspec_boot - boot an entry
  *
@@ -671,6 +648,7 @@ int blspec_boot(struct blspec_entry *entry, int verbose, int dryrun)
 {
 	int ret;
 	const char *abspath, *devicetree, *options, *initrd, *linuximage;
+	const char *appendroot;
 	struct bootm_data data = {
 		.initrd_address = UIMAGE_INVALID_ADDRESS,
 		.os_address = UIMAGE_SOME_ADDRESS,
@@ -709,9 +687,18 @@ int blspec_boot(struct blspec_entry *entry, int verbose, int dryrun)
 
 	globalvar_add_simple("linux.bootargs.dyn.blspec", options);
 
-	ret = blspec_append_root(entry);
-	if (ret)
-		goto err_out;
+	appendroot = blspec_entry_var_get(entry, "linux-appendroot");
+	if (appendroot) {
+		int val;
+
+		ret = strtobool(appendroot, &val);
+		if (ret) {
+			pr_err("Invalid value \"%s\" for appendroot option\n",
+			       appendroot);
+			goto err_out;
+		}
+		data.appendroot = val;
+	}
 
 	pr_info("booting %s from %s\n", blspec_entry_var_get(entry, "title"),
 			entry->cdev ? dev_name(entry->cdev->dev) : "none");
-- 
2.8.0.rc3


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

      parent reply	other threads:[~2016-04-29  9:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-29  9:51 Sascha Hauer
2016-04-29  9:52 ` [PATCH 1/6] globalvar: Allow to remove globalvars Sascha Hauer
2016-04-29  9:52 ` [PATCH 2/6] string: Introduce strtobool Sascha Hauer
2016-04-29  9:52 ` [PATCH 3/6] getenv_bool: use strtobool Sascha Hauer
2016-04-29  9:52 ` [PATCH 4/6] parameter: Use strtobool Sascha Hauer
2016-04-29  9:52 ` [PATCH 5/6] bootm: Optionally add a root= option to Kernel command line Sascha Hauer
2016-04-29  9:52 ` Sascha Hauer [this message]

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=1461923525-6356-7-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.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