242 ret = mount(ROOT_DEV_NAME, ROOT_DIR_NAME, fsType, mountFlags, NULL);
245 PRINT_ERR(
"Failed to mount %s, rootDev %s, errno %d: %s\n", ROOT_DIR_NAME, ROOT_DEV_NAME, err, strerror(err));
249#ifdef LOSCFG_STORAGE_EMMC
250#ifdef LOSCFG_PLATFORM_PATCHFS
252 ret = mkdir(PATCH_DIR_NAME, DEFAULT_MOUNT_DIR_MODE);
253 if ((ret != LOS_OK) && ((err = get_errno()) != EEXIST)) {
254 PRINT_ERR(
"Failed to mkdir %s, errno %d: %s\n", PATCH_DIR_NAME, err, strerror(err));
258 ret = mount(PATCH_DEV_NAME, PATCH_DIR_NAME, fsType, 0, DEFAULT_MOUNT_DATA);
259 if ((ret != LOS_OK) && ((err = get_errno()) == ENOTSUP)) {
260 ret =
format(PATCH_DEV_NAME, 0, FM_FAT32);
262 PRINT_ERR(
"Failed to format %s\n", PATCH_DEV_NAME);
266 ret = mount(PATCH_DEV_NAME, PATCH_DIR_NAME, fsType, 0, DEFAULT_MOUNT_DATA);
272 PRINT_ERR(
"Failed to mount %s, errno %d: %s\n", PATCH_DIR_NAME, err, strerror(err));
279 ret = mkdir(STORAGE_DIR_NAME, DEFAULT_MOUNT_DIR_MODE);
280 if ((ret != LOS_OK) && ((err = get_errno()) != EEXIST)) {
281 PRINT_ERR(
"Failed to mkdir %s, errno %d: %s\n", STORAGE_DIR_NAME, err, strerror(err));
285 ret = mount(USER_DEV_NAME, STORAGE_DIR_NAME, fsType, 0, DEFAULT_MOUNT_DATA);
288 PRINT_ERR(
"Failed to mount %s, errno %d: %s\n", STORAGE_DIR_NAME, err, strerror(err));
292#ifdef LOSCFG_STORAGE_EMMC
294 ret = mkdir(USERDATA_DIR_NAME, DEFAULT_MOUNT_DIR_MODE);
295 if ((ret != LOS_OK) && ((err = get_errno()) != EEXIST)) {
296 PRINT_ERR(
"Failed to mkdir %s, errno %d: %s\n", USERDATA_DIR_NAME, err, strerror(err));
300 ret = mount(USERDATA_DEV_NAME, USERDATA_DIR_NAME, fsType, 0, DEFAULT_MOUNT_DATA);
301 if ((ret != LOS_OK) && ((err = get_errno()) == ENOTSUP)) {
302 ret =
format(USERDATA_DEV_NAME, 0, FM_FAT32);
304 PRINT_ERR(
"Failed to format %s\n", USERDATA_DEV_NAME);
308 ret = mount(USERDATA_DEV_NAME, USERDATA_DIR_NAME, fsType, 0, DEFAULT_MOUNT_DATA);
314 PRINT_ERR(
"Failed to mount %s, errno %d: %s\n", USERDATA_DIR_NAME, err, strerror(err));