From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org, Adrian Negreanu <adrian.negreanu@nxp.com>
Subject: Re: [PATCH 11/11] fs: qemu_fw_cfg: support populating environment via QEMU fw_cfg
Date: Mon, 17 Mar 2025 12:36:48 +0100 [thread overview]
Message-ID: <710a2e83-3027-49dc-8035-a374075eb2e9@pengutronix.de> (raw)
In-Reply-To: <Z9fS5ZZzEDheZMJh@pengutronix.de>
Hi Sascha,
On 3/17/25 08:44, Sascha Hauer wrote:
> Hi Ahmad,
>
> On Thu, Mar 13, 2025 at 11:17:28AM +0100, Ahmad Fatoum wrote:
>> diff --git a/fs/qemu_fw_cfg.c b/fs/qemu_fw_cfg.c
>> index 7f7350e67e64..ef2a1008ee5d 100644
>> --- a/fs/qemu_fw_cfg.c
>> +++ b/fs/qemu_fw_cfg.c
>> @@ -13,6 +13,7 @@
>> #include <errno.h>
>> #include <linux/stat.h>
>> #include <xfuncs.h>
>> +#include <envfs.h>
>> #include <fcntl.h>
>> #include <linux/qemu_fw_cfg.h>
>> #include <wchar.h>
>> @@ -363,7 +364,13 @@ static int fw_cfg_fs_probe(struct device *dev)
>> */
>> fsdev->cdev = cdev_by_name(devpath_to_name(fsdev->backingstore));
>>
>> - return fw_cfg_fs_parse(sb);
>> + ret = fw_cfg_fs_parse(sb);
>> + if (ret)
>> + goto free_data;
>> +
>> + defaultenv_append_runtime_directory("/mnt/fw_cfg/by_name/opt/org.barebox.env");
>
> I see the variables show up in /mnt/fw_cfg/by_name/opt/org.barebox.env/,
> but not in the environment.
>
> I wonder how this is supposed to work. The fw_cfg fs is mounted when I
> first access /mnt/fw_cfg on the barebox command line, but at that time
> defaultenv_append_runtime_directory() has no effect anymore as
> defaultenv_load() is executed during startup.
I had the ramfb driver enabled and that mounted the FS for me...
> Should defaultenv_append_runtime_directory() be called in
> qemu_fw_cfg_fs_init() instead?
Possibly. I will check for v2.
Thanks for your feedback and testing,
Ahmad
>
> Sascha
>
prev parent reply other threads:[~2025-03-17 11:38 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-13 10:17 [PATCH 00/11] firmware: qemu_fw_cfg: implement file system Ahmad Fatoum
2025-03-13 10:17 ` [PATCH 01/11] video: ramfb: fix frame buffer screen size Ahmad Fatoum
2025-03-13 10:17 ` [PATCH 02/11] firmware: qemu_fw_cfg: drop duplicate definitions Ahmad Fatoum
2025-03-13 10:17 ` [PATCH 03/11] firmware: qemu_fw_cfg: add support for seeking Ahmad Fatoum
2025-03-13 10:17 ` [PATCH 04/11] firmware: qemu_fw_cfg: rename from /dev/fw_cfg0 to /dev/fw_cfg Ahmad Fatoum
2025-03-13 10:17 ` [PATCH 05/11] fs: add qemu_fw_cfg file system Ahmad Fatoum
2025-03-17 8:21 ` Sascha Hauer
2025-03-17 11:34 ` Ahmad Fatoum
2025-03-13 10:17 ` [PATCH 06/11] firmware: qemu_fw_cfg: register at device initcall level Ahmad Fatoum
2025-03-13 10:17 ` [PATCH 07/11] video: ramfb: use new qemu fw_cfg FS Ahmad Fatoum
2025-03-13 10:17 ` [PATCH 08/11] libfile: give copy_file a flags parameter Ahmad Fatoum
2025-03-13 10:17 ` [PATCH 09/11] libfile: pass copy_file flags through copy_recursive Ahmad Fatoum
2025-03-13 10:17 ` [PATCH 10/11] libfile: add support for not clobbering files in copy_file Ahmad Fatoum
2025-03-13 10:17 ` [PATCH 11/11] fs: qemu_fw_cfg: support populating environment via QEMU fw_cfg Ahmad Fatoum
2025-03-17 7:44 ` Sascha Hauer
2025-03-17 11:36 ` Ahmad Fatoum [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=710a2e83-3027-49dc-8035-a374075eb2e9@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=adrian.negreanu@nxp.com \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@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