mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@barebox.org>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@barebox.org>
Subject: [PATCH] startup: add semihosting filesystem automount
Date: Tue, 27 May 2025 23:03:00 +0200	[thread overview]
Message-ID: <20250527210300.562536-1-a.fatoum@barebox.org> (raw)

From: Ahmad Fatoum <ahmad@a3f.at>

For more convenient use of the semihosting file system, let's add an
automount when the file system is enabled.

Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
 common/startup.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/common/startup.c b/common/startup.c
index bbe905141efc..c9e99d47fbd7 100644
--- a/common/startup.c
+++ b/common/startup.c
@@ -57,6 +57,7 @@ static int mount_root(void)
 	mount("none", "ramfs", "/", NULL);
 	mkdir("/dev", 0);
 	mkdir("/tmp", 0);
+	mkdir("/mnt", 0);
 	mount("none", "devfs", "/dev", NULL);
 
 	if (IS_ENABLED(CONFIG_FS_EFIVARFS) && efi_is_payload()) {
@@ -69,6 +70,11 @@ static int mount_root(void)
 		mount("none", "pstore", "/pstore", NULL);
 	}
 
+	if (IS_ENABLED(CONFIG_FS_SMHFS)) {
+		mkdir("/mnt/smhfs", 0);
+		automount_add("/mnt/smhfs", "mount -t smhfs /dev/null /mnt/smhfs");
+	}
+
 	return 0;
 }
 fs_initcall(mount_root);
-- 
2.39.5




             reply	other threads:[~2025-05-27 21:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-27 21:03 Ahmad Fatoum [this message]
2025-06-02 11:48 ` 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=20250527210300.562536-1-a.fatoum@barebox.org \
    --to=a.fatoum@barebox.org \
    --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