From 9464fe1b163d65a70fe4c2d922cf0411154505de Mon Sep 17 00:00:00 2001 From: bernard Date: Tue, 20 May 2025 07:20:35 +0800 Subject: [PATCH 1/3] [dfs] enable procfs and tempfs in default when using smart; fix LWIP_ROUTE warning issue. --- components/dfs/Kconfig | 4 +++- components/dfs/dfs_v2/filesystems/procfs/proc_net.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/components/dfs/Kconfig b/components/dfs/Kconfig index 9b2f1b40de8..17052fe2a48 100644 --- a/components/dfs/Kconfig +++ b/components/dfs/Kconfig @@ -187,7 +187,7 @@ if RT_USING_SMART default y config RT_USING_DFS_PROCFS bool "Enable proc file system" - default n + default y endif config RT_USING_DFS_CROMFS @@ -204,11 +204,13 @@ endif config RT_USING_DFS_TMPFS bool "Enable TMP file system" + default y if RT_USING_SMART default n config RT_USING_DFS_MQUEUE bool "Enable MQUEUE file system" select RT_USING_DEV_BUS + default y if RT_USING_SMART default n if RT_USING_DFS_V1 diff --git a/components/dfs/dfs_v2/filesystems/procfs/proc_net.c b/components/dfs/dfs_v2/filesystems/procfs/proc_net.c index e2b38e0c8db..76707beffb2 100644 --- a/components/dfs/dfs_v2/filesystems/procfs/proc_net.c +++ b/components/dfs/dfs_v2/filesystems/procfs/proc_net.c @@ -47,6 +47,7 @@ static void *seq_next(struct dfs_seq_file *seq, void *data, off_t *index) return NULL; } +#if LWIP_ROUTE static void route_show(const char *name, uint32_t ip_addr, uint32_t netmask, void *parameter) { struct dfs_seq_file *seq = (struct dfs_seq_file *)parameter; @@ -66,6 +67,7 @@ static void route_show(const char *name, uint32_t ip_addr, uint32_t netmask, voi dfs_seq_printf(seq, "%d ", 0); dfs_seq_printf(seq, "%d\n", 0); } +#endif static int seq_show(struct dfs_seq_file *seq, void *data) { From c45fa21d994c0f8deb0f09a132eb232e3ba76a68 Mon Sep 17 00:00:00 2001 From: bernard Date: Tue, 20 May 2025 07:36:55 +0800 Subject: [PATCH 2/3] [DeviceDrivers] mount procfs when enable procfs --- components/drivers/core/mnt.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/drivers/core/mnt.c b/components/drivers/core/mnt.c index c59fcd8b897..02a68d46dd3 100644 --- a/components/drivers/core/mnt.c +++ b/components/drivers/core/mnt.c @@ -158,6 +158,11 @@ static int fstab_mnt_init(void) msh_exec_script("fstab.sh", 16); #endif +#ifdef RT_USING_DFS_PROCFS + mkdir("/proc", 0755); + dfs_mount(RT_NULL, "/proc", "procfs", 0, RT_NULL); +#endif + LOG_I("File system initialization done"); return 0; From f24e433974ea9bd9aaee30975b2fecab911dc23c Mon Sep 17 00:00:00 2001 From: bernard Date: Tue, 20 May 2025 07:54:16 +0800 Subject: [PATCH 3/3] [procfs] fix compiler warnings --- components/dfs/dfs_v2/filesystems/procfs/procfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/dfs/dfs_v2/filesystems/procfs/procfs.c b/components/dfs/dfs_v2/filesystems/procfs/procfs.c index c8b5c1477c7..8cba8ed48c6 100644 --- a/components/dfs/dfs_v2/filesystems/procfs/procfs.c +++ b/components/dfs/dfs_v2/filesystems/procfs/procfs.c @@ -293,7 +293,7 @@ static int dfs_procfs_stat(struct dfs_dentry *dentry, struct stat *st) { vnode = dentry->vnode; - st->st_dev = (dev_t)(dentry->mnt->dev_id); + st->st_dev = (dev_t)(rt_ubase_t)(dentry->mnt->dev_id); st->st_ino = (ino_t)dfs_dentry_full_path_crc32(dentry); st->st_gid = vnode->gid;