]> glassweightruler.freedombox.rocks Git - Ventoy.git/blobdiff - INSTALL/tool/ventoy_lib.sh
1.0.29 release
[Ventoy.git] / INSTALL / tool / ventoy_lib.sh
index 78d93e9cf8bb11c8136b5300b567bd82ab06af5a..7fe771a03a5da00ec8d1535b5ae5ef99469f5d5e 100644 (file)
@@ -52,7 +52,7 @@ check_tool_work_ok() {
         vtoyfat=vtoyfat_32
     fi
     
-    if echo 1 | ./tool/hexdump > /dev/null; then
+    if echo 1 | hexdump > /dev/null; then
         vtdebug "hexdump test ok ..."
     else
         vtdebug "hexdump test fail ..."
@@ -88,6 +88,8 @@ get_disk_part_name() {
         echo ${DISK}p${2}
     elif echo $DISK | grep -q "/dev/nvme[0-9][0-9]*n[0-9]"; then
         echo ${DISK}p${2}
+    elif echo $DISK | grep -q "/dev/mmcblk[0-9]"; then
+        echo ${DISK}p${2}
     else
         echo ${DISK}${2}
     fi
@@ -126,8 +128,8 @@ is_disk_contains_ventoy() {
         return
     fi
     
-    PART1_TYPE=$(dd if=$DISK bs=1 count=1 skip=450 status=none | ./tool/hexdump -n1 -e  '1/1 "%02X"')
-    PART2_TYPE=$(dd if=$DISK bs=1 count=1 skip=466 status=none | ./tool/hexdump -n1 -e  '1/1 "%02X"')
+    PART1_TYPE=$(dd if=$DISK bs=1 count=1 skip=450 status=none | hexdump -n1 -e  '1/1 "%02X"')
+    PART2_TYPE=$(dd if=$DISK bs=1 count=1 skip=466 status=none | hexdump -n1 -e  '1/1 "%02X"')
     
     # if [ "$PART1_TYPE" != "EE" ]; then
         # if [ "$PART2_TYPE" != "EF" ]; then
@@ -137,7 +139,7 @@ is_disk_contains_ventoy() {
         # fi
     # fi
     
-    # PART1_TYPE=$(dd if=$DISK bs=1 count=1 skip=450 status=none | ./tool/hexdump -n1 -e  '1/1 "%02X"')
+    # PART1_TYPE=$(dd if=$DISK bs=1 count=1 skip=450 status=none | hexdump -n1 -e  '1/1 "%02X"')
     # if [ "$PART1_TYPE" != "07" ]; then
         # vtdebug "part1 type is $PART2_TYPE not 07"
         # ventoy_false
@@ -263,7 +265,7 @@ w
 EOF
     fi
    
-    udevadm trigger >/dev/null 2>&1
+    udevadm trigger --name-match=$DISK >/dev/null 2>&1
     partprobe >/dev/null 2>&1
     sleep 3
     echo "Done"
@@ -360,7 +362,7 @@ format_ventoy_disk_gpt() {
     $vtoygpt -f $DISK
     sync
 
-    udevadm trigger >/dev/null 2>&1
+    udevadm trigger --name-match=$DISK >/dev/null 2>&1
     partprobe >/dev/null 2>&1
     sleep 3
     echo "Done"