feat(file system): add memory-based romfs

1, this RomFS's codebase is Nuttx romfs, then it is compatible with
Linux RomFS and you can create such a file system using the tool genromfs.
2, there are two major changes against with the original Nuttx romfs:
    1), it is memory-based: all contents of the fs are stored in the
        memory in the very first stage of "mount".
    2), this version of romfs is altered to be compatible with our new
        version of VFS to take advantage of vnode cache and path cache.

close: #I3S0CP
This commit is contained in:
chenwei
2021-05-19 14:53:43 +08:00
parent d632356413
commit c4595d2504
6 changed files with 56 additions and 2 deletions

View File

@@ -146,6 +146,7 @@ LITEOS_TABLES_DRIVER_LDFLAGS := \
####FS MAP####
LITEOS_TABLES_FSMAP_LDFLAGS := \
-uramfs_fsmap \
-uromfs_fsmap \
-unfs_fsmap \
-ufat_fsmap \
-ujffs_fsmap \

View File

@@ -325,6 +325,11 @@ ifeq ($(LOSCFG_FS_RAMFS), y)
LIB_SUBDIRS += fs/ramfs
endif
ifeq ($(LOSCFG_FS_ROMFS), y)
LITEOS_BASELIB += -lromfs
LIB_SUBDIRS += fs/romfs
endif
ifeq ($(LOSCFG_FS_NFS), y)
LITEOS_BASELIB += -lnfs
LIB_SUBDIRS += fs/nfs

View File

@@ -38,6 +38,7 @@ JFFS2_TOOL=mkfs.jffs2
WIN_JFFS2_TOOL=mkfs.jffs2.exe
YAFFS2_TOOL=mkyaffs2image100
VFAT_TOOL=mkfs.vfat
ROMFS_TOOL=genromfs
MCOPY_TOOL=mcopy
tool_check() {
@@ -66,8 +67,11 @@ if [ "${FSTYPE}" = "jffs2" ]; then
${JFFS2_TOOL} -q -o ${ROOTFS_IMG} -d ${ROOTFS_DIR} --pagesize=4096
fi
elif [ "${FSTYPE}" = "yaffs2" ]; then
tool_check ${YAFFS2_TOOL}
${YAFFS2_TOOL} ${ROOTFS_DIR} ${ROOTFS_IMG} 2k 24bit
tool_check ${YAFFS2_TOOL}
${YAFFS2_TOOL} ${ROOTFS_DIR} ${ROOTFS_IMG} 2k 24bit
elif [ "${FSTYPE}" = "romfs" ]; then
tool_check ${ROMFS_TOOL}
${ROMFS_TOOL} -d ${ROOTFS_DIR} -f ${ROOTFS_IMG}
elif [ "${FSTYPE}" = "vfat" ]; then
if [ "${system}" != "Linux" ] ; then
echo "Unsupported fs type!" >&2