From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 6/6] Documentation: devel: add short section on file systems
Date: Thu, 20 Mar 2025 06:20:19 +0100 [thread overview]
Message-ID: <20250320052019.1726331-7-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20250320052019.1726331-1-a.fatoum@pengutronix.de>
barebox has a lot of commands that can be used to exercise different
aspects of a file system. Add some documentation for that.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
Documentation/devel/background-execution.rst | 2 +
Documentation/devel/devel.rst | 1 +
Documentation/devel/filesystems.rst | 73 ++++++++++++++++++++
3 files changed, 76 insertions(+)
create mode 100644 Documentation/devel/filesystems.rst
diff --git a/Documentation/devel/background-execution.rst b/Documentation/devel/background-execution.rst
index cf8675b9aa0e..e1e350785298 100644
--- a/Documentation/devel/background-execution.rst
+++ b/Documentation/devel/background-execution.rst
@@ -1,3 +1,5 @@
+.. _background_execution:
+
Background execution in barebox
===============================
diff --git a/Documentation/devel/devel.rst b/Documentation/devel/devel.rst
index 39070074ca1b..3e9d44218334 100644
--- a/Documentation/devel/devel.rst
+++ b/Documentation/devel/devel.rst
@@ -9,6 +9,7 @@ Contents:
:maxdepth: 2
porting
+ filesystems
background-execution
project-ideas
diff --git a/Documentation/devel/filesystems.rst b/Documentation/devel/filesystems.rst
new file mode 100644
index 000000000000..454e736c701f
--- /dev/null
+++ b/Documentation/devel/filesystems.rst
@@ -0,0 +1,73 @@
+File system development in barebox
+==================================
+
+The barebox file system support is based heavily on Linux.
+
+Access to all file systems goes through the virtual file system
+layer, which provides uniform access to all mounted file systems
+under the same root.
+
+As power-fail safe writing of file system couldn't be guaranteed,
+most file systems supported by barebox are read-only.
+Safe writing is possible, however, via the :ref:`state_framework`.
+
+For an up-to-date listing of writable filesystems, refer to the
+``CONFIG_FS_WRITABLE`` Kconfig symbol.
+
+Testing File systems
+--------------------
+
+Nearly all file system operations have commands that directly exercise them:
+
++--------------------------+-----------------------------------------+
+| Command | Operations |
++==========================+=========================================+
+| :ref:`command_cat` | ``open``, ``close``, ``read`` |
++--------------------------+-----------------------------------------+
+| :ref:`command_echo` | ``create``, ``write`` |
++--------------------------+-----------------------------------------+
+| :ref:`command_sync` | ``flush`` |
++--------------------------+-----------------------------------------+
+| :ref:`command_erase` | ``erase`` |
++--------------------------+-----------------------------------------+
+| :ref:`command_protect` | ``protect`` |
++--------------------------+-----------------------------------------+
+| :ref:`command_md` | ``lseek``, ``memmap`` |
++--------------------------+-----------------------------------------+
+| :ref:`command_rm` | ``unlink`` |
++--------------------------+-----------------------------------------+
+| :ref:`command_mkdir` | ``mkdir`` |
++--------------------------+-----------------------------------------+
+| :ref:`command_rmdir` | ``rmdir`` |
++--------------------------+-----------------------------------------+
+| :ref:`command_ln` | ``symlink`` |
++--------------------------+-----------------------------------------+
+| :ref:`command_readlink` | ``readlink`` |
++--------------------------+-----------------------------------------+
+| | :ref:`command_ls` | ``opendir``, ``readdir``, ``closedir`` |
+| | :ref:`command_tree` | |
++--------------------------+-----------------------------------------+
+| :ref:`command_stat` | ``stat`` |
++--------------------------+-----------------------------------------+
+| :ref:`command_truncate` | ``truncate`` |
++--------------------------+-----------------------------------------+
+
+This leaves two specialized operations that can't be easily tested
+via the shell:
+
+- ``discard_range``: Advise that a range need not be preserved
+- ``ioctl``: Issue device-specific output and input control commands
+
+Unused metadata
+---------------
+
+barebox currently ignores ownership and permission information
+inside file systems as well as special nodes like FIFOs or
+sockets. When porting file systems, these parts can be omitted.
+
+Background execution
+--------------------
+
+Outside command context (i.e. in
+:ref:`pollers and secondary barebox threads <background_execution>`),
+virtual file system access is only permitted with ramfs.
--
2.39.5
prev parent reply other threads:[~2025-03-20 5:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-20 5:20 [PATCH 0/6] fs: implement tree and truncate Ahmad Fatoum
2025-03-20 5:20 ` [PATCH 1/6] fs: use filename_create/filename_lookup instead of open-coding Ahmad Fatoum
2025-03-20 5:20 ` [PATCH 2/6] fs: implement O_DIRECTORY Ahmad Fatoum
2025-03-20 5:20 ` [PATCH 3/6] fs: implement opendir in terms of fdopendir Ahmad Fatoum
2025-03-20 5:20 ` [PATCH 4/6] commands: implement tree command Ahmad Fatoum
2025-03-20 5:20 ` [PATCH 5/6] commands: add new truncate command Ahmad Fatoum
2025-03-20 5:20 ` 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=20250320052019.1726331-7-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.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