diff --git a/disk/part.c b/disk/part.c index 303178161c0..bab27ba07d8 100644 --- a/disk/part.c +++ b/disk/part.c @@ -477,7 +477,8 @@ int blk_get_device_part_str(const char *ifname, const char *dev_part_str, if (!strcmp(ifname, "hostfs")) { strcpy((char *)info->type, BOOT_PART_TYPE); strcpy((char *)info->name, "Host filesystem"); - + info->fs_type = IS_ENABLED(CONFIG_SANDBOX) ? FS_TYPE_SANDBOX : + FS_TYPE_SEMIHOSTING; return 0; } #endif diff --git a/fs/fs_legacy.c b/fs/fs_legacy.c index 5a7a3ae4194..82936142c07 100644 --- a/fs/fs_legacy.c +++ b/fs/fs_legacy.c @@ -483,7 +483,11 @@ int fs_set_blk_dev(const char *ifname, const char *dev_part_str, int fstype) if (!fs_dev_desc && !info->null_dev_desc_ok) continue; + if (fs_partition.fs_type && + fs_partition.fs_type != info->fstype) + continue; + log_debug("probe %s\n", info->name); if (!info->probe(fs_dev_desc, &fs_partition)) { fs_type = info->fstype; fs_dev_part = part; diff --git a/include/part.h b/include/part.h index fcb3c13dea4..0fd7c18d6b6 100644 --- a/include/part.h +++ b/include/part.h @@ -7,6 +7,7 @@ #define _PART_H #include +#include #include #include #include @@ -84,6 +85,7 @@ struct disk_partition { #ifdef CONFIG_DOS_PARTITION uchar sys_ind; /* partition type */ #endif + enum fs_type_t fs_type; /* type used for hostfs and virtio-fs */ }; /* Accessors for struct disk_partition field ->uuid */