1 /*
2  * Copyright (c) 2006-2021, RT-Thread Development Team
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Change Logs:
7  * Date           Author       Notes
8  * 2021/08/19     bernard      the first version
9  */
10 
11 #include <rtthread.h>
12 
13 #ifdef RT_USING_DFS
14 #include <dfs_fs.h>
15 
mnt_init(void)16 int mnt_init(void)
17 {
18     if (rt_device_find("virtio-blk0"))
19     {
20         /* mount virtio-blk as root directory */
21         if (dfs_mount("virtio-blk0", "/", "elm", 0, RT_NULL) == 0)
22         {
23             rt_kprintf("file system initialization done!\n");
24         }
25         else
26         {
27             if (dfs_mount("virtio-blk0", "/", "ext", 0, RT_NULL) == 0)
28             {
29                 rt_kprintf("file system initialization done!\n");
30             }
31             else
32             {
33                 rt_kprintf("file system initialization fail!\n");
34             }
35         }
36     }
37 
38     return 0;
39 }
40 INIT_ENV_EXPORT(mnt_init);
41 #endif
42