]> glassweightruler.freedombox.rocks Git - Ventoy.git/blobdiff - INSTALL/tool/ventoy_lib.sh
Code Optimize
[Ventoy.git] / INSTALL / tool / ventoy_lib.sh
index f72d3fe74074cc0231de6ac2edeccf3c67e138e2..7fe771a03a5da00ec8d1535b5ae5ef99469f5d5e 100644 (file)
@@ -128,8 +128,8 @@ is_disk_contains_ventoy() {
         return
     fi
     
         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
     
     # if [ "$PART1_TYPE" != "EE" ]; then
         # if [ "$PART2_TYPE" != "EF" ]; then
@@ -139,7 +139,7 @@ is_disk_contains_ventoy() {
         # fi
     # fi
     
         # 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
     # if [ "$PART1_TYPE" != "07" ]; then
         # vtdebug "part1 type is $PART2_TYPE not 07"
         # ventoy_false
@@ -265,7 +265,7 @@ w
 EOF
     fi
    
 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"
     partprobe >/dev/null 2>&1
     sleep 3
     echo "Done"
@@ -362,7 +362,7 @@ format_ventoy_disk_gpt() {
     $vtoygpt -f $DISK
     sync
 
     $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"
     partprobe >/dev/null 2>&1
     sleep 3
     echo "Done"