mirror of
https://github.com/ventoy/Ventoy.git
synced 2025-12-18 09:36:17 +00:00
Fix the vhd.vtoy file boot issue in ext4 file system. (#3444)
This commit is contained in:
@@ -3410,6 +3410,7 @@ int ventoy_get_block_list(grub_file_t file, ventoy_img_chunk_list *chunklist, gr
|
|||||||
static grub_err_t ventoy_cmd_img_sector(grub_extcmd_context_t ctxt, int argc, char **args)
|
static grub_err_t ventoy_cmd_img_sector(grub_extcmd_context_t ctxt, int argc, char **args)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
int fs_type;
|
||||||
grub_file_t file;
|
grub_file_t file;
|
||||||
grub_disk_addr_t start;
|
grub_disk_addr_t start;
|
||||||
char errmsg[128];
|
char errmsg[128];
|
||||||
@@ -3432,7 +3433,8 @@ static grub_err_t ventoy_cmd_img_sector(grub_extcmd_context_t ctxt, int argc, ch
|
|||||||
grub_free(g_img_chunk_list.chunk);
|
grub_free(g_img_chunk_list.chunk);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ventoy_get_fs_type(file->fs->name) >= ventoy_fs_max)
|
fs_type = ventoy_get_fs_type(file->fs->name);
|
||||||
|
if (fs_type >= ventoy_fs_max)
|
||||||
{
|
{
|
||||||
grub_file_close(file);
|
grub_file_close(file);
|
||||||
return grub_error(GRUB_ERR_BAD_ARGUMENT, "Unsupported filesystem %s\n", file->fs->name);
|
return grub_error(GRUB_ERR_BAD_ARGUMENT, "Unsupported filesystem %s\n", file->fs->name);
|
||||||
@@ -3458,8 +3460,11 @@ static grub_err_t ventoy_cmd_img_sector(grub_extcmd_context_t ctxt, int argc, ch
|
|||||||
|
|
||||||
if (rc)
|
if (rc)
|
||||||
{
|
{
|
||||||
vtoy_tip(10, "%s\n\nWill exit in 10 seconds...\n", errmsg);
|
if (fs_type == ventoy_fs_btrfs)
|
||||||
grub_exit();
|
{
|
||||||
|
vtoy_tip(10, "%s\n\nWill exit in 10 seconds...\n", errmsg);
|
||||||
|
grub_exit();
|
||||||
|
}
|
||||||
return grub_error(GRUB_ERR_NOT_IMPLEMENTED_YET, "%s\n", errmsg);
|
return grub_error(GRUB_ERR_NOT_IMPLEMENTED_YET, "%s\n", errmsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user