Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 26b4198

Browse files
committedNov 20, 2024·
[DFS/FEATURE] Support ISO9660
1. Not support link. 2. Fixup the DFS open flag with readonly. Link: #9270 Signed-off-by: GuEe-GUI <[email protected]>
1 parent 9381bec commit 26b4198

File tree

5 files changed

+733
-2
lines changed

5 files changed

+733
-2
lines changed
 

‎components/dfs/Kconfig

+7
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,13 @@ endif
162162
bool "Using devfs for device objects"
163163
default y
164164

165+
if RT_USING_DFS_V1
166+
config RT_USING_DFS_ISO9660
167+
bool "Using ISO9660 filesystem"
168+
depends on RT_USING_MEMHEAP
169+
default n
170+
endif
171+
165172
config RT_USING_DFS_ROMFS
166173
bool "Enable ReadOnly file system on flash"
167174
default n
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# RT-Thread building script for component
2+
3+
from building import *
4+
5+
cwd = GetCurrentDir()
6+
src = Glob('*.c')
7+
CPPPATH = [cwd]
8+
9+
group = DefineGroup('Filesystem', src, depend = ['RT_USING_DFS', 'RT_USING_DFS_ISO9660'], CPPPATH = CPPPATH)
10+
11+
Return('group')

‎components/dfs/dfs_v1/filesystems/iso9660/dfs_iso9660.c

+697
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* Copyright (c) 2006-2023, RT-Thread Development Team
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Change Logs:
7+
* Date Author Notes
8+
* 2023-02-25 GuEe-GUI the first version
9+
*/
10+
11+
#ifndef __DFS_ISO9660_H__
12+
#define __DFS_ISO9660_H__
13+
14+
int dfs_iso9660_init(void);
15+
16+
#endif /* __DFS_ISO9660_H__ */

‎components/dfs/dfs_v1/src/dfs_fs.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,8 @@ int dfs_mount(const char *device_name,
322322
/* open device, but do not check the status of device */
323323
if (dev_id != NULL)
324324
{
325-
if (rt_device_open(fs->dev_id,
326-
RT_DEVICE_OFLAG_RDWR) != RT_EOK)
325+
if (rt_device_open(fs->dev_id, RT_DEVICE_OFLAG_RDWR) != RT_EOK &&
326+
rt_device_open(fs->dev_id, RT_DEVICE_OFLAG_RDONLY) != RT_EOK)
327327
{
328328
/* The underlying device has error, clear the entry. */
329329
dfs_lock();

0 commit comments

Comments
 (0)
Please sign in to comment.