Commit a5c70651 authored by longpanda's avatar longpanda
Browse files

1.0.13 release

parent 785255b6
if [ "$grub_platform" = "pc" ]; then
menuentry 'Search and boot Windows' {
if search -n -s -f /bootmgr; then
ntldr /bootmgr
elif search -n -s -f /ntldr; then
ntldr /ntldr
else
echo "Windows NOT found ..."
fi
}
menuentry 'Boot the 1st local disk' {
set root=(hd0,1)
chainloader +1
boot
}
menuentry 'Boot the 2nd local disk' {
set root=(hd1,1)
chainloader +1
boot
}
menuentry 'Boot the 3rd local disk' {
set root=(hd2,1)
chainloader +1
boot
}
else
menuentry 'Search and boot Windows' {
if search -n -s -f /EFI/Microsoft/Boot/bootmgfw.efi; then
terminal_output console
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
boot
else
echo "Windows NOT found ..."
fi
}
menuentry 'Search and boot BOOTX64.EFI' {
if search -n -s -f /efi/boot/bootx64.efi; then
terminal_output console
chainloader /efi/boot/bootx64.efi
boot
else
echo "BOOTX64.EFI NOT found ..."
fi
}
fi
menuentry 'Return to menu [Esc]' VTOY_RET {
echo 'Return ...'
}
......@@ -7,7 +7,7 @@ menuentry Reboot {
menuentry Halt {
echo -e '\n\nSystem is halting ... \n'
sleep 1
reboot
halt
}
menuentry 'Return to menu [Esc]' VTOY_RET {
......
desktop-image: "background.png"
title-text: " "
title-font: "ascii"
title-color: "#ffffff"
message-font: "ascii"
message-color: "#f2f2f2"
terminal-box: "terminal_box_*.png"
......@@ -16,14 +14,12 @@ terminal-box: "terminal_box_*.png"
menu_pixmap_style = "menu_*.png"
item_font = "ascii"
item_color = "#ffffff"
item_height = 30
item_spacing = 1
item_padding = 1
selected_item_font = "ascii"
selected_item_color= "#f2f2f2"
selected_item_pixmap_style = "select_*.png"
......@@ -67,8 +63,8 @@ terminal-box: "terminal_box_*.png"
+ hbox{
left = 90%
top = 30
left = 30%
top = 95%-50
width = 10%
height = 25
+ label {text = "@VTOY_ISO_RAW@" color = "red" align = "left"}
......
......@@ -278,7 +278,7 @@ EOF
echo "create efi fat fs $PART2 ..."
for i in 0 1 2 3 4 5 6 7 8 9; do
if mkfs.vfat -F 16 -n EFI $PART2; then
if mkfs.vfat -F 16 -n VTOYEFI $PART2; then
echo 'success'
break
else
......
No preview for this file type
......@@ -33,6 +33,8 @@ ventoy_img_chunk *g_chunk;
uint32_t g_img_chunk_num;
ventoy_img_chunk *g_cur_chunk;
uint32_t g_disk_sector_size;
uint8_t *g_os_param_reserved;
ventoy_override_chunk *g_override_chunk;
uint32_t g_override_chunk_num;
......@@ -42,6 +44,14 @@ uint32_t g_virt_chunk_num;
ventoy_sector_flag g_sector_flag[128];
#define VENTOY_ISO9660_SECTOR_OVERFLOW 2097152
int g_fixup_iso9660_secover_enable = 0;
int g_fixup_iso9660_secover_start = 0;
uint64 g_fixup_iso9660_secover_1st_secs = 0;
uint64 g_fixup_iso9660_secover_cur_secs = 0;
uint64 g_fixup_iso9660_secover_tot_secs = 0;
static struct int13_disk_address __bss16 ( ventoy_address );
#define ventoy_address __use_data16 ( ventoy_address )
......@@ -195,6 +205,17 @@ static int ventoy_vdisk_read_real(uint64_t lba, unsigned int count, unsigned lon
memcpy((char *)databuffer, override_data + start - override_start, override_end - start);
}
}
if (g_fixup_iso9660_secover_enable && (!g_fixup_iso9660_secover_start) &&
g_override_chunk[i].override_size == sizeof(ventoy_iso9660_override))
{
ventoy_iso9660_override *dirent = (ventoy_iso9660_override *)override_data;
if (dirent->first_sector >= VENTOY_ISO9660_SECTOR_OVERFLOW)
{
g_fixup_iso9660_secover_start = 1;
g_fixup_iso9660_secover_cur_secs = 0;
}
}
}
end:
......@@ -202,6 +223,59 @@ end:
return 0;
}
uint64_t ventoy_fixup_iso9660_sector(uint64_t Lba, uint32_t secNum)
{
uint32_t i = 0;
if (g_fixup_iso9660_secover_cur_secs > 0)
{
Lba += VENTOY_ISO9660_SECTOR_OVERFLOW;
g_fixup_iso9660_secover_cur_secs += secNum;
if (g_fixup_iso9660_secover_cur_secs >= g_fixup_iso9660_secover_tot_secs)
{
g_fixup_iso9660_secover_start = 0;
goto end;
}
}
else
{
ventoy_iso9660_override *dirent;
ventoy_override_chunk *pOverride;
for (i = 0, pOverride = g_override_chunk; i < g_override_chunk_num; i++, pOverride++)
{
dirent = (ventoy_iso9660_override *)pOverride->override_data;
if (Lba == dirent->first_sector)
{
g_fixup_iso9660_secover_start = 0;
goto end;
}
}
if (g_fixup_iso9660_secover_start)
{
for (i = 0, pOverride = g_override_chunk; i < g_override_chunk_num; i++, pOverride++)
{
dirent = (ventoy_iso9660_override *)pOverride->override_data;
if (Lba + VENTOY_ISO9660_SECTOR_OVERFLOW == dirent->first_sector)
{
g_fixup_iso9660_secover_tot_secs = (dirent->size + 2047) / 2048;
g_fixup_iso9660_secover_cur_secs = secNum;
if (g_fixup_iso9660_secover_cur_secs >= g_fixup_iso9660_secover_tot_secs)
{
g_fixup_iso9660_secover_start = 0;
}
Lba += VENTOY_ISO9660_SECTOR_OVERFLOW;
goto end;
}
}
}
}
end:
return Lba;
}
int ventoy_vdisk_read(struct san_device *sandev, uint64_t lba, unsigned int count, unsigned long buffer)
{
uint32_t i, j;
......@@ -223,6 +297,12 @@ int ventoy_vdisk_read(struct san_device *sandev, uint64_t lba, unsigned int coun
ix86 = (struct i386_all_regs *)sandev->x86_regptr;
/* Workaround for SSTR PE loader error */
if (g_fixup_iso9660_secover_start)
{
lba = ventoy_fixup_iso9660_sector(lba, count);
}
readend = (lba + count) * 2048;
if (readend <= g_chain->real_img_size_in_bytes)
{
......@@ -384,6 +464,8 @@ static void ventoy_dump_chain(ventoy_chain_head *chain)
printf("os_param->vtoy_img_size=<%llu>\n", chain->os_param.vtoy_img_size);
printf("os_param->vtoy_reserve[0]=<%u>\n", vtoy_reserve[0]);
printf("os_param->vtoy_reserve[1]=<%u>\n", vtoy_reserve[1]);
printf("os_param->vtoy_reserve[2]=<%u>\n", vtoy_reserve[2]);
printf("os_param->vtoy_reserve[3]=<%u>\n", vtoy_reserve[3]);
printf("os_param->vtoy_img_location_addr=<0x%llx>\n", chain->os_param.vtoy_img_location_addr);
printf("os_param->vtoy_img_location_len=<%u>\n", chain->os_param.vtoy_img_location_len);
ventoy_debug_pause();
......@@ -489,6 +571,14 @@ int ventoy_boot_vdisk(void *data)
g_disk_sector_size = g_chain->disk_sector_size;
g_cur_chunk = g_chunk;
g_os_param_reserved = (uint8_t *)(g_chain->os_param.vtoy_reserved);
/* Workaround for Windows & ISO9660 */
if (g_os_param_reserved[2] == 1 && g_os_param_reserved[3] == 0)
{
g_fixup_iso9660_secover_enable = 1;
}
g_override_chunk = (ventoy_override_chunk *)((char *)g_chain + g_chain->override_chunk_offset);
g_override_chunk_num = g_chain->override_chunk_num;
......
......@@ -80,6 +80,14 @@ typedef struct ventoy_os_param
grub_uint8_t reserved[31];
}ventoy_os_param;
typedef struct ventoy_iso9660_override
{
uint32_t first_sector;
uint32_t first_sector_be;
uint32_t size;
uint32_t size_be;
}ventoy_iso9660_override;
#pragma pack()
// compile assert to check that size of ventoy_os_param must be 512
......
......@@ -492,13 +492,13 @@ static int VentoyFatDiskRead(uint32 Sector, uint8 *Buffer, uint32 SectorCount)
static CHAR GetMountLogicalDrive(void)
{
CHAR Letter = 'Z';
CHAR Letter = 'Y';
DWORD Drives;
DWORD Mask = 0x2000000;
DWORD Mask = 0x1000000;
Drives = GetLogicalDrives();
Log("Drives=0x%x", Drives);
while (Mask)
{
if ((Drives & Mask) == 0)
......@@ -724,7 +724,7 @@ static int ProcessUnattendedInstallation(const char *script)
{
Letter = 'X';
}
sprintf_s(CurDir, sizeof(CurDir), "%C:\\Autounattend.xml", Letter);
Log("Copy file <%s> --> <%s>", script, CurDir);
CopyFile(script, CurDir, FALSE);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment