Skip to content

Commit

Permalink
1. Add a new feature to directly boot wim files
Browse files Browse the repository at this point in the history
2. auto installation plugin update
    1) Expand the configuration, now you can specify more than one auto installation scripts for one ISO file
    2) Add a prompt for the iso with auto installation config, you can choose whether to use the auto installation script and which one to use for this time
3. persistence plugin update
    1) Expand the configuration, now you can specify more than one persistence backend image files for one ISO file
    2) Add a prompt for the iso with persistence config, you can choose whether to use the persistence image and which one to use for this time
4. Move the position of the red Memdisk tip to a more prominent position
5. Add a return parent directory item when in TreeView mode
6. Add a VTOY_DEFAULT_SEARCH_ROOT option in global control plugin to specify the root path of the iso files.
7. Change the style of F2 power menu
8. Fix a bug about Ventoy2Disk.exe can't start when there is a DataRAM Ramdisk in the system.
9. Files with size less than 32KB will be filted by default
10. Fix a bug about wrong file size in TreeView mode with NTFS/XFS
11. Files with space or Non Ascii charactors in name will be shown but with unsupported message when you boot it.
12. Optimization for Ventoy2Disk.sh
13. Optimization for arch linux boot
14. New iso support
  • Loading branch information
ventoy committed May 29, 2020
1 parent 7a0b2d9 commit c8e8693
Show file tree
Hide file tree
Showing 33 changed files with 1,254 additions and 483 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ EFI_STATUS EFIAPI ventoy_block_io_read
secNum = BufferSize / 2048;
offset = Lba * 2048;

if (offset + BufferSize < g_chain->real_img_size_in_bytes)
if (offset + BufferSize <= g_chain->real_img_size_in_bytes)
{
return ventoy_read_iso_sector(Lba, secNum, Buffer);
}
Expand Down
2 changes: 0 additions & 2 deletions GRUB2/MOD_SRC/grub-2.04/grub-core/fs/xfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -970,8 +970,6 @@ grub_xfs_dir_iter (const char *filename, enum grub_fshelp_filetype filetype,
info.mtime = grub_be_to_cpu32 (node->inode.mtime.sec);
}
info.dir = ((filetype & GRUB_FSHELP_TYPE_MASK) == GRUB_FSHELP_DIR);
if (!info.dir)
info.size = node->inode.size;
grub_free (node);
return ctx->hook (filename, &info, ctx->hook_data);
}
Expand Down
13 changes: 10 additions & 3 deletions GRUB2/MOD_SRC/grub-2.04/grub-core/kern/disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,16 +412,23 @@ grub_disk_read_small (grub_disk_t disk, grub_disk_addr_t sector,
grub_err_t grub_disk_blocklist_read(void *chunklist, grub_uint64_t sector,
grub_uint64_t size, grub_uint32_t log_sector_size)
{
grub_uint64_t sizeshift;
ventoy_img_chunk *last_chunk = NULL;
ventoy_img_chunk *new_chunk = NULL;
ventoy_img_chunk_list *chunk_list = (ventoy_img_chunk_list *)chunklist;

sizeshift = (size >> log_sector_size);
if (sizeshift == 0)
{
sizeshift = 1;
}

if (chunk_list->cur_chunk == 0)
{
chunk_list->chunk[0].img_start_sector = 0;
chunk_list->chunk[0].img_end_sector = (size >> 11) - 1;
chunk_list->chunk[0].disk_start_sector = sector;
chunk_list->chunk[0].disk_end_sector = sector + (size >> log_sector_size) - 1;
chunk_list->chunk[0].disk_end_sector = sector + sizeshift - 1;
chunk_list->cur_chunk = 1;
return 0;
}
Expand All @@ -430,7 +437,7 @@ grub_err_t grub_disk_blocklist_read(void *chunklist, grub_uint64_t sector,
if (last_chunk->disk_end_sector + 1 == sector)
{
last_chunk->img_end_sector += (size >> 11);
last_chunk->disk_end_sector += (size >> log_sector_size);
last_chunk->disk_end_sector += sizeshift;
return 0;
}

Expand All @@ -452,7 +459,7 @@ grub_err_t grub_disk_blocklist_read(void *chunklist, grub_uint64_t sector,
new_chunk->img_start_sector = last_chunk->img_end_sector + 1;
new_chunk->img_end_sector = new_chunk->img_start_sector + (size >> 11) - 1;
new_chunk->disk_start_sector = sector;
new_chunk->disk_end_sector = sector + (size >> log_sector_size) - 1;
new_chunk->disk_end_sector = sector + sizeshift - 1;

chunk_list->cur_chunk++;

Expand Down
19 changes: 14 additions & 5 deletions GRUB2/MOD_SRC/grub-2.04/grub-core/normal/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ int g_ventoy_memdisk_mode = 0;
int g_ventoy_iso_raw = 0;
int g_ventoy_iso_uefi_drv = 0;
int g_ventoy_last_entry = 0;
int g_ventoy_suppress_esc = 0;
int g_ventoy_menu_esc = 0;

/* Time to delay after displaying an error message about a default/fallback
entry failing to boot. */
Expand Down Expand Up @@ -590,8 +592,10 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot)
enum timeout_style timeout_style;

default_entry = get_entry_number (menu, "default");

if (g_ventoy_last_entry >= 0 && g_ventoy_last_entry < menu->size) {

if (g_ventoy_suppress_esc)
default_entry = 1;
else if (g_ventoy_last_entry >= 0 && g_ventoy_last_entry < menu->size) {
default_entry = g_ventoy_last_entry;
}
/* If DEFAULT_ENTRY is not within the menu entries, fall back to
Expand Down Expand Up @@ -771,12 +775,12 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot)
case '\r':
// case GRUB_TERM_KEY_RIGHT:
case GRUB_TERM_CTRL | 'f':
menu_fini ();
menu_fini ();
*auto_boot = 0;
return current_entry;
return current_entry;

case GRUB_TERM_ESC:
if (nested)
if (nested && 0 == g_ventoy_suppress_esc)
{
menu_fini ();
return -1;
Expand Down Expand Up @@ -950,11 +954,16 @@ show_menu (grub_menu_t menu, int nested, int autobooted)
break;

g_ventoy_last_entry = boot_entry;
if (g_ventoy_menu_esc)
break;

e = grub_menu_get_entry (menu, boot_entry);
if (! e)
continue; /* Menu is empty. */

if (2 == e->argc && e->args && e->args[1] && grub_strncmp(e->args[1], "VTOY_RET", 8) == 0)
break;

grub_cls ();

if (auto_boot)
Expand Down
Loading

0 comments on commit c8e8693

Please sign in to comment.