]> glassweightruler.freedombox.rocks Git - Ventoy.git/blobdiff - IMG/cpio/ventoy/hook/rhel6/udev_disk_hook.sh
1.1.07 release
[Ventoy.git] / IMG / cpio / ventoy / hook / rhel6 / udev_disk_hook.sh
index 388c92cf2bbf3add432c283b6d0caf38d27633c2..a1954ce534164eec5eb7e8ea25019edc57363b0c 100644 (file)
@@ -19,6 +19,8 @@
 
 . /ventoy/hook/ventoy-hook-lib.sh
 
 
 . /ventoy/hook/ventoy-hook-lib.sh
 
+vtCheatLoop=loop6
+
 ventoy_os_install_dmsetup() {
     vtlog "ventoy_os_install_dmsetup $1"
     
 ventoy_os_install_dmsetup() {
     vtlog "ventoy_os_install_dmsetup $1"
     
@@ -50,9 +52,9 @@ ventoy_os_install_dmsetup() {
 
 
 if is_ventoy_hook_finished || not_ventoy_disk "${1:0:-1}"; then
 
 
 if is_ventoy_hook_finished || not_ventoy_disk "${1:0:-1}"; then
-    # /dev/loop7 come first
-    if [ "$1" = "loop7" ] && [ -b $VTOY_DM_PATH ]; then
-        ventoy_copy_device_mapper  /dev/loop7
+    # /dev/vtCheatLoop come first
+    if [ "$1" = "$vtCheatLoop" ] && [ -b $VTOY_DM_PATH ]; then
+        ventoy_copy_device_mapper  /dev/$vtCheatLoop
     fi
     exit 0
 fi
     fi
     exit 0
 fi
@@ -64,7 +66,7 @@ fi
 
 
 #some distro add there repo file to /etc/anaconda.repos.d/ which will cause error during installation
 
 
 #some distro add there repo file to /etc/anaconda.repos.d/ which will cause error during installation
-$BUSYBOX_PATH/nohup $VTOY_PATH/tool/inotifyd $VTOY_PATH/hook/rhel6/anaconda-repo-listen.sh /etc/anaconda.repos.d:n &  
+#$BUSYBOX_PATH/nohup $VTOY_PATH/tool/inotifyd $VTOY_PATH/hook/rhel6/anaconda-repo-listen.sh /etc/anaconda.repos.d:n &  
 
 ventoy_udev_disk_common_hook $* "noreplace"
 
 
 ventoy_udev_disk_common_hook $* "noreplace"
 
@@ -72,14 +74,14 @@ $BUSYBOX_PATH/mount $VTOY_DM_PATH /mnt/ventoy
 
 # 
 # We do a trick for rhel6 series here.
 
 # 
 # We do a trick for rhel6 series here.
-# Use /dev/loop7 and wapper it as a removable cdrom with bind mount.
-# Then the anaconda installer will accept /dev/loop7 as the install medium.
+# Use /dev/$vtCheatLoop and wapper it as a removable cdrom with bind mount.
+# Then the anaconda installer will accept /dev/$vtCheatLoop as the install medium.
 #
 #
-ventoy_copy_device_mapper  /dev/loop7
+ventoy_copy_device_mapper  /dev/$vtCheatLoop
 
 
-$BUSYBOX_PATH/cp -a /sys/devices/virtual/block/loop7 /tmp/ >> $VTLOG 2>&1
-echo 19 > /tmp/loop7/capability
-$BUSYBOX_PATH/mount --bind /tmp/loop7 /sys/block/loop7 >> $VTLOG 2>&1
+$BUSYBOX_PATH/cp -a /sys/devices/virtual/block/$vtCheatLoop /tmp/ >> $VTLOG 2>&1
+echo 19 > /tmp/$vtCheatLoop/capability
+$BUSYBOX_PATH/mount --bind /tmp/$vtCheatLoop /sys/block/$vtCheatLoop >> $VTLOG 2>&1
 
 # OK finish
 set_ventoy_hook_finish
 
 # OK finish
 set_ventoy_hook_finish