mnt.c 595 B

123456789101112131415161718192021222324252627282930
  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. #include <rtthread.h>
  11. #ifdef RT_USING_DFS
  12. #include <dfs_fs.h>
  13. int mnt_init(void)
  14. {
  15. if (rt_device_find("virtio-blk0"))
  16. {
  17. /* mount virtio-blk as root directory */
  18. if (dfs_mount("virtio-blk0", "/", "elm", 0, RT_NULL) == 0)
  19. {
  20. rt_kprintf("file system initialization done!\n");
  21. }
  22. }
  23. return 0;
  24. }
  25. INIT_ENV_EXPORT(mnt_init);
  26. #endif