mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@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 08:44:37 +0100	[thread overview]
Message-ID: <Z9fS5ZZzEDheZMJh@pengutronix.de> (raw)
In-Reply-To: <20250313101728.3546902-12-a.fatoum@pengutronix.de>

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.

Should defaultenv_append_runtime_directory() be called in
qemu_fw_cfg_fs_init() instead?

Sascha

-- 
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 |



  reply	other threads:[~2025-03-17  7:46 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 [this message]
2025-03-17 11:36     ` 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=Z9fS5ZZzEDheZMJh@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=adrian.negreanu@nxp.com \
    --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