1.0.39 release

This commit is contained in:
longpanda 2021-03-28 17:18:23 +08:00
parent 58d387f732
commit f4bbec65ba
10 changed files with 148 additions and 12 deletions

View File

@ -474,8 +474,12 @@ EFI_STATUS EFIAPI ventoy_block_io_read
offset = Lba * 2048; offset = Lba * 2048;
} }
VirtSec = g_chain->virt_img_size_in_bytes / 2048; VirtSec = g_chain->virt_img_size_in_bytes / 2048;
if (Lba + secNum > VirtSec) if (Lba >= VirtSec)
{
return EFI_SUCCESS;
}
else if (Lba + secNum > VirtSec)
{ {
secNum = VirtSec - Lba; secNum = VirtSec - Lba;
} }

View File

@ -42,6 +42,7 @@ int g_ventoy_last_entry = -1;
int g_ventoy_suppress_esc = 0; int g_ventoy_suppress_esc = 0;
int g_ventoy_menu_esc = 0; int g_ventoy_menu_esc = 0;
int g_ventoy_fn_mutex = 0; int g_ventoy_fn_mutex = 0;
int g_ventoy_terminal_output = 0;
/* Time to delay after displaying an error message about a default/fallback /* Time to delay after displaying an error message about a default/fallback
entry failing to boot. */ entry failing to boot. */
@ -871,15 +872,18 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot)
} }
break; break;
case GRUB_TERM_KEY_F7: case GRUB_TERM_KEY_F7:
case '7': menu_fini ();
cmdstr = grub_env_get("VTOY_F7_CMD"); if (g_ventoy_terminal_output == 0)
if (cmdstr)
{ {
menu_fini (); grub_script_execute_sourcecode("terminal_output console");
grub_script_execute_sourcecode(cmdstr); g_ventoy_terminal_output = 1;
goto refresh;
} }
break; else
{
grub_script_execute_sourcecode("terminal_output gfxterm");
g_ventoy_terminal_output = 0;
}
goto refresh;
case GRUB_TERM_KEY_F1: case GRUB_TERM_KEY_F1:
case '1': case '1':
menu_fini (); menu_fini ();

View File

@ -0,0 +1,79 @@
#!/ventoy/busybox/sh
#************************************************************************************
# Copyright (c) 2020, longpanda <admin@ventoy.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
#************************************************************************************
. /ventoy/hook/ventoy-hook-lib.sh
if is_ventoy_hook_finished; then
exit 0
fi
vtlog "####### $0 $* ########"
VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
ventoy_os_install_dmsetup_by_ko() {
vtlog "ventoy_os_install_dmsetup_by_ko $1"
vtVer=$(uname -r)
if uname -m | $GREP -q 64; then
vtBit=64
else
vtBit=32
fi
ventoy_extract_vtloopex $1 kerio
vtLoopExDir=$VTOY_PATH/vtloopex/kerio/vtloopex
if [ -e $vtLoopExDir/dm-mod/$vtVer/$vtBit/dm-mod.ko.xz ]; then
$BUSYBOX_PATH/xz -d $vtLoopExDir/dm-mod/$vtVer/$vtBit/dm-mod.ko.xz
insmod $vtLoopExDir/dm-mod/$vtVer/$vtBit/dm-mod.ko
fi
}
wait_for_usb_disk_ready
vtdiskname=$(get_ventoy_disk_name)
if [ "$vtdiskname" = "unknown" ]; then
vtlog "ventoy disk not found"
PATH=$VTPATH_OLD
exit 0
fi
if echo $vtdiskname | $EGREP -q "nvme|mmc|nbd"; then
ventoy_os_install_dmsetup_by_ko "${vtdiskname}p2"
else
ventoy_os_install_dmsetup_by_ko "${vtdiskname}2"
fi
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/')
vtDM=$(ventoy_find_dm_id ${blkdev_num})
vtlog "/dev/$vtDM"
mount -t iso9660 /dev/$vtDM /cdrom
modprobe squashfs
echo "/dev/$vtDM" > /ventoy/vtDM
PATH=$VTPATH_OLD
set_ventoy_hook_finish

View File

@ -0,0 +1,20 @@
#!/ventoy/busybox/sh
#************************************************************************************
# Copyright (c) 2020, longpanda <admin@ventoy.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
#************************************************************************************
$SED "/for drive in/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/kerio-disk.sh >/dev/null 2>&1; cat /ventoy/vtDM; exit 0" -i /installer/install_init

View File

@ -86,6 +86,9 @@ ventoy_get_debian_distro() {
fi fi
fi fi
if [ -e /opt/kerio ]; then
echo 'kerio'; return
fi
echo 'default' echo 'default'

View File

@ -49,7 +49,12 @@ done
if [ -n "$1" ]; then if [ -n "$1" ]; then
vtlog "ln -s /dev/$vtDM $1" vtlog "ln -s /dev/$vtDM $1"
ln -s /dev/$vtDM "$1"
if [ -e "$1" ]; then
vtlog "$1 already exist"
else
ln -s /dev/$vtDM "$1"
fi
else else
vtLABEL=$($BUSYBOX_PATH/blkid /dev/$vtDM | $SED 's/.*LABEL="\([^"]*\)".*/\1/') vtLABEL=$($BUSYBOX_PATH/blkid /dev/$vtDM | $SED 's/.*LABEL="\([^"]*\)".*/\1/')
vtlog "vtLABEL is $vtLABEL" vtlog "vtLABEL is $vtLABEL"

View File

@ -1608,7 +1608,7 @@ function img_unsupport_menuentry {
############################################################# #############################################################
############################################################# #############################################################
set VENTOY_VERSION="1.0.38" set VENTOY_VERSION="1.0.39"
#ACPI not compatible with Window7/8, so disable by default #ACPI not compatible with Window7/8, so disable by default
set VTOY_PARAM_NO_ACPI=1 set VTOY_PARAM_NO_ACPI=1

View File

@ -402,6 +402,19 @@ int ventoy_vdisk_read(struct san_device *sandev, uint64_t lba, unsigned int coun
if (g_hddmode) if (g_hddmode)
{ {
#if 0
/* need to check ?? */
lastlba = g_chain->virt_img_size_in_bytes / 512;
if (lba < lastlba)
{
if (lba + count > lastlba)
{
count = lastlba - lba;
}
ventoy_vdisk_read_real_hdd(lba, count, buffer);
}
#endif
ventoy_vdisk_read_real_hdd(lba, count, buffer); ventoy_vdisk_read_real_hdd(lba, count, buffer);
ix86->regs.dl = sandev->drive; ix86->regs.dl = sandev->drive;
return 0; return 0;
@ -435,7 +448,15 @@ int ventoy_vdisk_read(struct san_device *sandev, uint64_t lba, unsigned int coun
} }
VirtSec = g_chain->virt_img_size_in_bytes / 2048; VirtSec = g_chain->virt_img_size_in_bytes / 2048;
if (lba + count > VirtSec) if (lba >= VirtSec)
{
/* fix for grub4dos Inconsistent data read from error */
memset((void *)(buffer + (count - 1) * 2048), 0, 2048);
ix86->regs.dl = sandev->drive;
return 0;
}
else if (lba + count > VirtSec)
{ {
count = VirtSec - lba; count = VirtSec - lba;
} }

Binary file not shown.