summaryrefslogtreecommitdiffstats
path: root/common/blspec.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-04-29 11:35:51 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-05-04 11:58:46 +0200
commita91ce459de038a4e95ae01740d8b253e703fe254 (patch)
tree68175938534f1a9e74c2c97316142147339be685 /common/blspec.c
parentf66990af3cf2e1bfda60938beeadcb98557d9487 (diff)
downloadbarebox-a91ce459de038a4e95ae01740d8b253e703fe254.tar.gz
blspec: push appendroot handling to bootm
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>
Diffstat (limited to 'common/blspec.c')
-rw-r--r--common/blspec.c39
1 files 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");