]> glassweightruler.freedombox.rocks Git - Ventoy.git/blobdiff - IMG/cpio/ventoy/hook/debian/udev_disk_hook.sh
1.1.07 release
[Ventoy.git] / IMG / cpio / ventoy / hook / debian / udev_disk_hook.sh
index a0f88b1518c661c4edb36ab40d743cabb2d410fd..251f046bbf023322745ef5dcce29e827435b777e 100644 (file)
@@ -41,18 +41,18 @@ ventoy_os_install_dmsetup() {
     fi
 
     # install md-modules
-    LINE=$($GREP ' md-modules.*\.udeb'  $VTOY_PATH/iso_file_list)
+    LINE=$($GREP -i ' md-modules.*\.udeb'  $VTOY_PATH/iso_file_list)
     if [ $? -eq 0 ]; then
-        LINTCNT=$($GREP -c ' md-modules.*\.udeb'  $VTOY_PATH/iso_file_list)
+        LINTCNT=$($GREP -i -c ' md-modules.*\.udeb'  $VTOY_PATH/iso_file_list)
         if [ $LINTCNT -gt 1 ]; then
             vtlog "more than one pkgs, need to filter..."
             VER=$($BUSYBOX_PATH/uname -r)
             
-            LINE=$($GREP ' md-modules.*\.udeb'  $VTOY_PATH/iso_file_list | $GREP $VER)
-            LINTCNT=$($GREP ' md-modules.*\.udeb'  $VTOY_PATH/iso_file_list | $GREP -c $VER)
+            LINE=$($GREP -i ' md-modules.*\.udeb'  $VTOY_PATH/iso_file_list | $GREP -i $VER)
+            LINTCNT=$($GREP -i ' md-modules.*\.udeb'  $VTOY_PATH/iso_file_list | $GREP -i -c $VER)
             if [ $LINTCNT -gt 1 ]; then
                 vtlog "Still more than one pkgs, use the first one..."
-                LINE=$($GREP ' md-modules.*\.udeb'  $VTOY_PATH/iso_file_list | $GREP  -m1 $VER)
+                LINE=$($GREP -i ' md-modules.*\.udeb'  $VTOY_PATH/iso_file_list | $GREP -i -m1 $VER)
             fi
         fi
         install_udeb_from_line "$LINE" ${vt_usb_disk} 
@@ -126,6 +126,7 @@ fi
 
 if [ -n "$VT_BUS_USB" ]; then
     vtlog "$1 is USB device"
+    echo /dev/$1 > /ventoy/list-devices-usb-part
 else
     vtlog "$1 is NOT USB device (bus $ID_BUS)"
     
@@ -133,18 +134,18 @@ else
         vtlog "boot=, or casper, don't mount"
     else
         vtlog "No boot param, need to mount"
-        $BUSYBOX_PATH/mkdir /cdrom
-        
-        if [ -b $VTOY_DM_PATH ]; then
-            vtlog "mount $VTOY_DM_PATH ..."
-            $BUSYBOX_PATH/mount -t iso9660 $VTOY_DM_PATH  /cdrom
-        else
-            vtlog "mount /dev/$1 ..."
-            $BUSYBOX_PATH/mount -t iso9660 /dev/$1  /cdrom
-        fi
+        echo /dev/$1 > /ventoy/list-devices-usb-part
     fi
 fi
 
+#special process for Linx
+if $BUSYBOX_PATH/uname -r | $GREP -q "^2\.6"; then
+    if $GREP -q "linx" /proc/version; then
+        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}) 
+        echo "/dev/$vtDM" > /ventoy/list-devices-usb-part
+    fi
+fi
 
 # OK finish
 set_ventoy_hook_finish