summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorMeco Man <[email protected]>2023-12-26 22:06:30 +0800
committerMeco Man <[email protected]>2023-12-26 23:13:08 +0800
commited4d037d7b09cee8e53810affd215ae504c79fc7 (patch)
tree9681079ecfc7308e8f61b16a32ba9861256941e6 /components
parent6e02914c2b5bac2f6b948a5ba8b71ad6cf63319d (diff)
[ci][stm32f407] add attach config CI check
Diffstat (limited to 'components')
-rw-r--r--components/dfs/Kconfig5
-rw-r--r--components/dfs/dfs_v1/filesystems/romfs/SConscript4
-rw-r--r--components/dfs/dfs_v1/filesystems/romfs/dfs_romfs.c27
-rw-r--r--components/dfs/dfs_v1/filesystems/romfs/dfs_romfs.h5
-rw-r--r--components/dfs/dfs_v1/filesystems/romfs/romfs.c38
-rw-r--r--components/dfs/dfs_v2/filesystems/romfs/SConscript4
6 files changed, 36 insertions, 47 deletions
diff --git a/components/dfs/Kconfig b/components/dfs/Kconfig
index 7a6a49859d..6af2555a14 100644
--- a/components/dfs/Kconfig
+++ b/components/dfs/Kconfig
@@ -165,6 +165,11 @@ endif
bool "Enable ReadOnly file system on flash"
default n
+ config RT_USING_DFS_ROMFS_USER_ROOT
+ bool "Use user's romfs root"
+ depends on RT_USING_DFS_ROMFS
+ default n
+
config RT_USING_DFS_CROMFS
bool "Enable ReadOnly compressed file system on flash"
default n
diff --git a/components/dfs/dfs_v1/filesystems/romfs/SConscript b/components/dfs/dfs_v1/filesystems/romfs/SConscript
index bfd633ce91..59599d02fb 100644
--- a/components/dfs/dfs_v1/filesystems/romfs/SConscript
+++ b/components/dfs/dfs_v1/filesystems/romfs/SConscript
@@ -6,10 +6,6 @@ cwd = GetCurrentDir()
src = Glob('*.c')
CPPPATH = [cwd]
-if GetDepend('DFS_ROMFS_ROOT'):
- # A new ROMFS root has been defined, we should remove the romfs.c
- SrcRemove(src, ['romfs.c'])
-
group = DefineGroup('Filesystem', src, depend = ['RT_USING_DFS','RT_USING_DFS_ROMFS'], CPPPATH = CPPPATH)
Return('group')
diff --git a/components/dfs/dfs_v1/filesystems/romfs/dfs_romfs.c b/components/dfs/dfs_v1/filesystems/romfs/dfs_romfs.c
index 1ae48c27ed..b84c0498eb 100644
--- a/components/dfs/dfs_v1/filesystems/romfs/dfs_romfs.c
+++ b/components/dfs/dfs_v1/filesystems/romfs/dfs_romfs.c
@@ -382,3 +382,30 @@ int dfs_romfs_init(void)
}
INIT_COMPONENT_EXPORT(dfs_romfs_init);
+#ifndef RT_USING_DFS_ROMFS_USER_ROOT
+static const unsigned char _dummy_dummy_txt[] =
+{
+ 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x21, 0x0d, 0x0a,
+};
+
+static const struct romfs_dirent _dummy[] =
+{
+ {ROMFS_DIRENT_FILE, "dummy.txt", _dummy_dummy_txt, sizeof(_dummy_dummy_txt)},
+};
+
+static const unsigned char _dummy_txt[] =
+{
+ 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x21, 0x0d, 0x0a,
+};
+
+rt_weak const struct romfs_dirent _root_dirent[] =
+{
+ {ROMFS_DIRENT_DIR, "dummy", (rt_uint8_t *)_dummy, sizeof(_dummy) / sizeof(_dummy[0])},
+ {ROMFS_DIRENT_FILE, "dummy.txt", _dummy_txt, sizeof(_dummy_txt)},
+};
+
+rt_weak const struct romfs_dirent romfs_root =
+{
+ ROMFS_DIRENT_DIR, "/", (rt_uint8_t *)_root_dirent, sizeof(_root_dirent) / sizeof(_root_dirent[0])
+};
+#endif
diff --git a/components/dfs/dfs_v1/filesystems/romfs/dfs_romfs.h b/components/dfs/dfs_v1/filesystems/romfs/dfs_romfs.h
index affa4bf993..829e17dc33 100644
--- a/components/dfs/dfs_v1/filesystems/romfs/dfs_romfs.h
+++ b/components/dfs/dfs_v1/filesystems/romfs/dfs_romfs.h
@@ -26,6 +26,9 @@ struct romfs_dirent
};
int dfs_romfs_init(void);
+
+#ifndef RT_USING_DFS_ROMFS_USER_ROOT
extern const struct romfs_dirent romfs_root;
+#endif /* RT_USING_DFS_ROMFS_USER_ROOT */
-#endif
+#endif /* __DFS_ROMFS_H__ */
diff --git a/components/dfs/dfs_v1/filesystems/romfs/romfs.c b/components/dfs/dfs_v1/filesystems/romfs/romfs.c
deleted file mode 100644
index 0ca17766c8..0000000000
--- a/components/dfs/dfs_v1/filesystems/romfs/romfs.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2006-2022, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date Author Notes
- */
-
-#include <rtthread.h>
-#include <dfs_romfs.h>
-
-static const unsigned char _dummy_dummy_txt[] =
-{
- 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x21, 0x0d, 0x0a,
-};
-
-static const struct romfs_dirent _dummy[] =
-{
- {ROMFS_DIRENT_FILE, "dummy.txt", _dummy_dummy_txt, sizeof(_dummy_dummy_txt)},
-};
-
-static const unsigned char _dummy_txt[] =
-{
- 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x21, 0x0d, 0x0a,
-};
-
-rt_weak const struct romfs_dirent _root_dirent[] =
-{
- {ROMFS_DIRENT_DIR, "dummy", (rt_uint8_t *)_dummy, sizeof(_dummy) / sizeof(_dummy[0])},
- {ROMFS_DIRENT_FILE, "dummy.txt", _dummy_txt, sizeof(_dummy_txt)},
-};
-
-rt_weak const struct romfs_dirent romfs_root =
-{
- ROMFS_DIRENT_DIR, "/", (rt_uint8_t *)_root_dirent, sizeof(_root_dirent) / sizeof(_root_dirent[0])
-};
-
diff --git a/components/dfs/dfs_v2/filesystems/romfs/SConscript b/components/dfs/dfs_v2/filesystems/romfs/SConscript
index bfd633ce91..59599d02fb 100644
--- a/components/dfs/dfs_v2/filesystems/romfs/SConscript
+++ b/components/dfs/dfs_v2/filesystems/romfs/SConscript
@@ -6,10 +6,6 @@ cwd = GetCurrentDir()
src = Glob('*.c')
CPPPATH = [cwd]
-if GetDepend('DFS_ROMFS_ROOT'):
- # A new ROMFS root has been defined, we should remove the romfs.c
- SrcRemove(src, ['romfs.c'])
-
group = DefineGroup('Filesystem', src, depend = ['RT_USING_DFS','RT_USING_DFS_ROMFS'], CPPPATH = CPPPATH)
Return('group')