Skip to content

Commit d1628a1

Browse files
authored
[dfs] enable procfs and tempfs in default when using smart; fix LWIP_ROUTE warning issue.
1 parent e9f6992 commit d1628a1

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

components/dfs/Kconfig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ if RT_USING_SMART
187187
default y
188188
config RT_USING_DFS_PROCFS
189189
bool "Enable proc file system"
190-
default n
190+
default y
191191
endif
192192

193193
config RT_USING_DFS_CROMFS
@@ -204,11 +204,13 @@ endif
204204

205205
config RT_USING_DFS_TMPFS
206206
bool "Enable TMP file system"
207+
default y if RT_USING_SMART
207208
default n
208209

209210
config RT_USING_DFS_MQUEUE
210211
bool "Enable MQUEUE file system"
211212
select RT_USING_DEV_BUS
213+
default y if RT_USING_SMART
212214
default n
213215

214216
if RT_USING_DFS_V1

components/dfs/dfs_v2/filesystems/procfs/proc_net.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ static void *seq_next(struct dfs_seq_file *seq, void *data, off_t *index)
4747
return NULL;
4848
}
4949

50+
#if LWIP_ROUTE
5051
static void route_show(const char *name, uint32_t ip_addr, uint32_t netmask, void *parameter)
5152
{
5253
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
6667
dfs_seq_printf(seq, "%d ", 0);
6768
dfs_seq_printf(seq, "%d\n", 0);
6869
}
70+
#endif
6971

7072
static int seq_show(struct dfs_seq_file *seq, void *data)
7173
{

components/dfs/dfs_v2/filesystems/procfs/procfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ static int dfs_procfs_stat(struct dfs_dentry *dentry, struct stat *st)
293293
{
294294
vnode = dentry->vnode;
295295

296-
st->st_dev = (dev_t)(dentry->mnt->dev_id);
296+
st->st_dev = (dev_t)(rt_ubase_t)(dentry->mnt->dev_id);
297297
st->st_ino = (ino_t)dfs_dentry_full_path_crc32(dentry);
298298

299299
st->st_gid = vnode->gid;

components/drivers/core/mnt.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ static int fstab_mnt_init(void)
158158
msh_exec_script("fstab.sh", 16);
159159
#endif
160160

161+
#ifdef RT_USING_DFS_PROCFS
162+
mkdir("/proc", 0755);
163+
dfs_mount(RT_NULL, "/proc", "procfs", 0, RT_NULL);
164+
#endif
165+
161166
LOG_I("File system initialization done");
162167

163168
return 0;

0 commit comments

Comments
 (0)