]> glassweightruler.freedombox.rocks Git - Ventoy.git/commitdiff
1.0.39 release v1.0.39
authorlongpanda <admin@ventoy.net>
Sun, 28 Mar 2021 09:18:23 +0000 (17:18 +0800)
committerlongpanda <admin@ventoy.net>
Sun, 28 Mar 2021 09:18:23 +0000 (17:18 +0800)
EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/Ventoy/VentoyProtocol.c
GRUB2/MOD_SRC/grub-2.04/grub-core/normal/menu.c
IMG/cpio/ventoy/hook/debian/kerio-disk.sh [new file with mode: 0644]
IMG/cpio/ventoy/hook/debian/kerio-hook.sh [new file with mode: 0644]
IMG/cpio/ventoy/hook/debian/ventoy-hook.sh
IMG/cpio/ventoy/hook/manjaro/ventoy-disk.sh
IMG/vtloopex/kerio/vtloopex/dm-mod/3.16.0-k5-kerio-amd64/64/dm-mod.ko.xz [new file with mode: 0644]
INSTALL/grub/grub.cfg
IPXE/ipxe_mod_code/ipxe-3fe683e/src/arch/x86/core/ventoy_vdisk.c
LANGUAGES/languages.ini

index a6e168e05a1e0d873adb8c84226cf67089acf03b..9866a4a45c7357a664e853ca19206fa8343b0b15 100644 (file)
@@ -474,8 +474,12 @@ EFI_STATUS EFIAPI ventoy_block_io_read
         offset = Lba * 2048;
     }
 
-    VirtSec = g_chain->virt_img_size_in_bytes / 2048;    
-    if (Lba + secNum > VirtSec)
+    VirtSec = g_chain->virt_img_size_in_bytes / 2048;
+    if (Lba >= VirtSec)
+    {
+        return EFI_SUCCESS;
+    }
+    else if (Lba + secNum > VirtSec)
     {
         secNum = VirtSec - Lba;
     }
index 393f2752465e097a2ae3547855ae4dc54a289b10..a83aeccafceb976043c29ac688c514f8d3f27a6b 100644 (file)
@@ -42,6 +42,7 @@ int g_ventoy_last_entry = -1;
 int g_ventoy_suppress_esc = 0;
 int g_ventoy_menu_esc = 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
    entry failing to boot.  */
@@ -871,15 +872,18 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot)
             }
             break;
         case GRUB_TERM_KEY_F7:
-        case '7':
-            cmdstr = grub_env_get("VTOY_F7_CMD");
-            if (cmdstr)
+            menu_fini ();
+            if (g_ventoy_terminal_output == 0)
             {
-                menu_fini ();
-                grub_script_execute_sourcecode(cmdstr);
-                goto refresh;
+                grub_script_execute_sourcecode("terminal_output console");
+                g_ventoy_terminal_output = 1;
             }
-            break;
+            else
+            {
+                grub_script_execute_sourcecode("terminal_output gfxterm");
+                g_ventoy_terminal_output = 0;
+            }
+            goto refresh;
         case GRUB_TERM_KEY_F1:
         case '1':
             menu_fini ();
diff --git a/IMG/cpio/ventoy/hook/debian/kerio-disk.sh b/IMG/cpio/ventoy/hook/debian/kerio-disk.sh
new file mode 100644 (file)
index 0000000..a589d8f
--- /dev/null
@@ -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
diff --git a/IMG/cpio/ventoy/hook/debian/kerio-hook.sh b/IMG/cpio/ventoy/hook/debian/kerio-hook.sh
new file mode 100644 (file)
index 0000000..864292b
--- /dev/null
@@ -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
index 9c4b50fd303dde3193f8fed43e11def896b71a4f..2af8bd17d0e0b996d5526828e0abe83f151d73df 100644 (file)
@@ -86,6 +86,9 @@ ventoy_get_debian_distro() {
         fi
     fi
     
+    if [ -e /opt/kerio ]; then
+        echo 'kerio'; return
+    fi
     
     
     echo 'default'
index e325eabf0160310296b5faa646b5125d5cff8192..d23fe49916c994306645002347b66e913e6c50e9 100644 (file)
@@ -49,7 +49,12 @@ done
 
 if [ -n "$1" ]; then
     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
     vtLABEL=$($BUSYBOX_PATH/blkid /dev/$vtDM | $SED 's/.*LABEL="\([^"]*\)".*/\1/')
     vtlog "vtLABEL is $vtLABEL"
diff --git a/IMG/vtloopex/kerio/vtloopex/dm-mod/3.16.0-k5-kerio-amd64/64/dm-mod.ko.xz b/IMG/vtloopex/kerio/vtloopex/dm-mod/3.16.0-k5-kerio-amd64/64/dm-mod.ko.xz
new file mode 100644 (file)
index 0000000..27d9fcb
Binary files /dev/null and b/IMG/vtloopex/kerio/vtloopex/dm-mod/3.16.0-k5-kerio-amd64/64/dm-mod.ko.xz differ
index 783cfdad80c0671821aa3e22b058abe434e66a94..162acf3568ad1a19ce5ed5a1c7c082e38fc575b2 100644 (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
 set VTOY_PARAM_NO_ACPI=1
index 58cc9750f60dab0477352dea7e2d28d24d050893..074f1afeb17a33262c4c41e5248cc1f8ecb027a1 100644 (file)
@@ -402,6 +402,19 @@ int ventoy_vdisk_read(struct san_device *sandev, uint64_t lba, unsigned int coun
 
     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);
         ix86->regs.dl = sandev->drive;
         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;    
-    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;
     }
index 8f92970f2048685da611d72d7c600a55c5d0b9af..b07c287efb32978c160bdcd02701be1dd156103b 100644 (file)
Binary files a/LANGUAGES/languages.ini and b/LANGUAGES/languages.ini differ