mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Robert Karszniewicz <r.karszniewicz@phytec.de>
To: barebox@lists.infradead.org
Subject: Re: [RFC PATCH v2 3/3] bootm: handle global.bootm.root_dev
Date: Wed, 5 Aug 2020 12:15:50 +0200	[thread overview]
Message-ID: <ca916ead-6cc1-ab54-0e9f-18c3e84e82d3@phytec.de> (raw)
In-Reply-To: <1596622207-286083-4-git-send-email-r.karszniewicz@phytec.de>

On 8/5/20 12:10 PM, Robert Karszniewicz wrote:
> ---
>   common/bootm.c | 13 ++++++++++++-
>   1 file changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/common/bootm.c b/common/bootm.c
> index 73409bf9f70c..01b54ab93958 100644
> --- a/common/bootm.c
> +++ b/common/bootm.c
> @@ -656,7 +656,18 @@ int bootm_boot(struct bootm_data *bootm_data)
>   	if (bootm_data->appendroot) {
>   		char *rootarg;
>   
> -		rootarg = path_get_linux_rootarg(data->os_file);
> +		if (bootm_data->root_dev) {
> +			const char *root_dev_name = devpath_to_name(bootm_data->root_dev);
> +			const struct cdev *root_cdev = cdev_by_name(root_dev_name);
> +
> +			if (root_cdev && root_cdev->partuuid[0] != 0) {
> +				rootarg = basprintf("root=PARTUUID=%s", root_cdev->partuuid);
> +			} else {
> +				rootarg = path_get_linux_rootarg("invalid");

Here I wasn't sure if I should be uniform and let the function return an 
error or just straight assign ERR_PTR(-EINVAL).

> +			}
> +		} else {
> +			rootarg = path_get_linux_rootarg(data->os_file);
> +		}
>   		if (!IS_ERR(rootarg)) {
>   			printf("Adding \"%s\" to Kernel commandline\n", rootarg);
>   			globalvar_add_simple("linux.bootargs.bootm.appendroot",
> 


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

  reply	other threads:[~2020-08-05 10:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-05 10:10 [RFC PATCH v2 0/3] Introduce global.bootm.root_dev env var for booting via PARTUUID Robert Karszniewicz
2020-08-05 10:10 ` [RFC PATCH v2 1/3] bootm: add env var root_dev Robert Karszniewicz
2020-08-05 10:10 ` [RFC PATCH v2 2/3] globalvar: add bootm.root_dev Robert Karszniewicz
2020-08-05 10:10 ` [RFC PATCH v2 3/3] bootm: handle global.bootm.root_dev Robert Karszniewicz
2020-08-05 10:15   ` Robert Karszniewicz [this message]
2020-08-10  9:45     ` 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=ca916ead-6cc1-ab54-0e9f-18c3e84e82d3@phytec.de \
    --to=r.karszniewicz@phytec.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