2022-12-03 12:07:44 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2006-2021, RT-Thread Development Team
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
|
|
|
* 2021/08/19 bernard the first version
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <rtthread.h>
|
|
|
|
|
|
|
|
#ifdef RT_USING_DFS
|
|
|
|
#include <dfs_fs.h>
|
|
|
|
#include <rtdbg.h>
|
|
|
|
|
|
|
|
int mnt_init(void)
|
|
|
|
{
|
|
|
|
if (rt_device_find("virtio-blk0"))
|
|
|
|
{
|
|
|
|
/* mount virtio-blk as root directory */
|
2023-07-17 20:11:58 +08:00
|
|
|
if (dfs_mount("virtio-blk0", "/", "elm", 0, RT_NULL) == 0)
|
2022-12-03 12:07:44 +08:00
|
|
|
{
|
2023-07-17 20:11:58 +08:00
|
|
|
rt_kprintf("file system initialization done!\n");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (dfs_mount("virtio-blk0", "/", "ext", 0, RT_NULL) == 0)
|
|
|
|
{
|
|
|
|
rt_kprintf("file system initialization done!\n");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
rt_kprintf("file system initialization fail!\n");
|
|
|
|
}
|
2022-12-03 12:07:44 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
INIT_ENV_EXPORT(mnt_init);
|
|
|
|
#endif
|