From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Marco Felsch <m.felsch@pengutronix.de>
Cc: barebox@lists.infradead.org, fpg@pengutronix.de,
Ahmad Fatoum <a.fatoum@barebox.org>
Subject: Re: [PATCH v2 01/10] commands: devlookup: honour global.bootm.root_param for -k
Date: Thu, 15 Oct 2026 11:52:43 +0200 [thread overview]
Message-ID: <13a8465d-7cd2-4252-a2a0-0fd24b1dc0e1@pengutronix.de> (raw)
In-Reply-To: <er7tpu7joyb6vtfw2vleyvhzzws6yslwbkrsvqx36zpp5ybv3y@g23qmstyfzbb>
Hello Marco,
On 10/15/26 11:46 AM, Marco Felsch wrote:
> On 26-10-15 11:18, Ahmad Fatoum wrote:
>> From: Ahmad Fatoum <a.fatoum@barebox.org>
>> if (kernelopt)
>> - val = buf = cdev_get_linux_rootarg(cdev);
>> + val = buf = cdev_get_linux_rootarg(cdev,
>> + getenv_nonempty("global.bootm.root_param") ?: "root");
> ^
> Wouldn't it make more sense if cdev_get_linux_rootarg() returns the
> correct <key>= so it's fixed for all possible cdev_get_linux_rootarg()
> users?
> In other words put this logic into cdev_get_linux_rootarg() and keep the
> API.
There are no other users of this API. I can imagine other users (e.g. a
board's custom boot entry provider) wanting to tightly control whether
global.bootm.root_param is used or not.
Cheers,
Ahmad
>
> Regards,
> Marco
>
>> else if (paramname)
>> val = dev_get_param(cdev->dev, paramname);
>> else
>> @@ -109,7 +110,7 @@ BAREBOX_CMD_HELP_TEXT("parameter with that name is looked up.")
>> BAREBOX_CMD_HELP_TEXT("")
>> BAREBOX_CMD_HELP_TEXT("Options:")
>> BAREBOX_CMD_HELP_OPT ("-v", "write output to VARIABLE instead of printing it")
>> -BAREBOX_CMD_HELP_OPT ("-k", "output kernel rootarg line")
>> +BAREBOX_CMD_HELP_OPT ("-k", "output kernel rootarg line (see global.bootm.root_param)")
>> BAREBOX_CMD_HELP_OPT ("-a", "output resolution of cdev alias")
>> BAREBOX_CMD_HELP_END
>>
>> diff --git a/common/block.c b/common/block.c
>> index 5441c7ca1848..16075bb146ec 100644
>> --- a/common/block.c
>> +++ b/common/block.c
>> @@ -665,7 +665,8 @@ int cdev_get_linux_root_and_opts(const struct cdev *partcdev, const char **root,
>> return 0;
>> }
>>
>> -char *cdev_get_linux_rootarg(const struct cdev *partcdev)
>> +char *cdev_get_linux_rootarg(const struct cdev *partcdev,
>> + const char *root_param)
>> {
>> int err;
>> const char *root = NULL;
>> @@ -675,5 +676,5 @@ char *cdev_get_linux_rootarg(const struct cdev *partcdev)
>> if (err)
>> return NULL;
>>
>> - return format_root_bootarg("root", root, rootopts);
>> + return format_root_bootarg(root_param, root, rootopts);
>> }
>> diff --git a/include/block.h b/include/block.h
>> index 065ae81358b4..91ab91f9109b 100644
>> --- a/include/block.h
>> +++ b/include/block.h
>> @@ -109,7 +109,8 @@ static inline int block_flush(struct block_device *blk)
>>
>> #ifdef CONFIG_BLOCK
>> unsigned file_list_add_blockdevs(struct file_list *files);
>> -char *cdev_get_linux_rootarg(const struct cdev *partcdev);
>> +char *cdev_get_linux_rootarg(const struct cdev *partcdev,
>> + const char *root_param);
>> int cdev_get_linux_root_and_opts(const struct cdev *partcdev, const char **root,
>> const char **rootopts);
>> #else
>> @@ -117,7 +118,8 @@ static inline unsigned file_list_add_blockdevs(struct file_list *files)
>> {
>> return 0;
>> }
>> -static inline char *cdev_get_linux_rootarg(const struct cdev *partcdev)
>> +static inline char *cdev_get_linux_rootarg(const struct cdev *partcdev,
>> + const char *root_param)
>> {
>> return NULL;
>> }
>> --
>> 2.47.3
>>
>>
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2026-10-15 9:53 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 9:18 [PATCH v2 00/10] efi: payload: allow passing arguments to UKIs Ahmad Fatoum
2026-10-15 9:18 ` [PATCH v2 01/10] commands: devlookup: honour global.bootm.root_param for -k Ahmad Fatoum
2026-10-15 9:46 ` Marco Felsch
2026-10-15 9:52 ` Ahmad Fatoum [this message]
2026-10-15 9:18 ` [PATCH v2 02/10] common: bootargs: don't leave linux_bootargs dangling after free Ahmad Fatoum
2026-10-15 9:49 ` Marco Felsch
2026-10-15 9:18 ` [PATCH v2 03/10] common: bootargs: drop legacy bootargs fallback with FLEXIBLE_BOOTARGS Ahmad Fatoum
2026-10-15 9:52 ` Marco Felsch
2026-10-15 9:18 ` [PATCH v2 04/10] globalvar: skip empty variables in globalvar_get_match() Ahmad Fatoum
2026-10-15 9:54 ` Marco Felsch
2026-10-15 9:18 ` [PATCH v2 05/10] efi: payload: honour bootm dryrun in the EFI application handler Ahmad Fatoum
2026-10-15 9:18 ` [PATCH v2 06/10] efi: payload: always shutdown barebox when booting Ahmad Fatoum
2026-10-15 10:03 ` Marco Felsch
2026-10-15 10:16 ` Ahmad Fatoum
2026-10-15 9:18 ` [PATCH v2 07/10] efi: payload: pass shell arguments as load options to executed images Ahmad Fatoum
2026-10-15 10:14 ` Marco Felsch
2026-10-15 10:25 ` Ahmad Fatoum
2026-10-15 10:49 ` Marco Felsch
2026-10-15 9:18 ` [PATCH v2 08/10] efi: add global.efi.bootargs for bootm'd EFI applications Ahmad Fatoum
2026-10-15 10:34 ` Marco Felsch
2026-10-15 10:38 ` Ahmad Fatoum
2026-10-15 9:18 ` [PATCH v2 09/10] Documentation: efi: describe load options handling Ahmad Fatoum
2026-10-15 11:08 ` Marco Felsch
2026-10-15 11:19 ` Ahmad Fatoum
2026-10-15 12:13 ` Marco Felsch
2026-10-15 12:47 ` Ahmad Fatoum
2026-10-15 9:18 ` [PATCH v2 10/10] test: py: efiloader: check global.efi.bootargs reaches the kernel Ahmad Fatoum
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=13a8465d-7cd2-4252-a2a0-0fd24b1dc0e1@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=a.fatoum@barebox.org \
--cc=barebox@lists.infradead.org \
--cc=fpg@pengutronix.de \
--cc=m.felsch@pengutronix.de \
/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