]> glassweightruler.freedombox.rocks Git - Ventoy.git/blobdiff - IMG/cpio/ventoy/hook/rhel7/ventoy-hook.sh
Fix a issue when booting easyos 3.4.3+
[Ventoy.git] / IMG / cpio / ventoy / hook / rhel7 / ventoy-hook.sh
index 1d971cfd06208e10ea8c90c282c29c2e8cc9a7a3..2fb4a557e5ea1c515ee59fbf97116a44d4d139f1 100644 (file)
@@ -28,13 +28,19 @@ else
     for vtParam in $($CAT /proc/cmdline); do
         if echo $vtParam | $GREP -q 'inst.ks=hd:LABEL='; then
             vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}')
     for vtParam in $($CAT /proc/cmdline); do
         if echo $vtParam | $GREP -q 'inst.ks=hd:LABEL='; then
             vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}')
-            VTKS="inst.ks=hd:/dev/dm-0:$vtRawKs"
+            VTKS="inst.ks=hd:/dev/ventoy:$vtRawKs"
             break
         fi
         
         if echo $vtParam | $GREP -q '^ks=.*:/'; then
             vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}')
             break
         fi
         
         if echo $vtParam | $GREP -q '^ks=.*:/'; then
             vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}')
-            VTKS="ks=hd:/dev/dm-0:$vtRawKs"
+            VTKS="ks=hd:/dev/ventoy:$vtRawKs"
+            break
+        fi
+        
+        if echo $vtParam | $GREP -q '^inst.ks=.*:/'; then
+            vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}')
+            VTKS="inst.ks=hd:/dev/ventoy:$vtRawKs"
             break
         fi
     done
             break
         fi
     done
@@ -69,9 +75,9 @@ fi
 echo "vtInstDD=$vtInstDD" >> $VTLOG
 
 if $GREP -q 'root=live' /proc/cmdline; then
 echo "vtInstDD=$vtInstDD" >> $VTLOG
 
 if $GREP -q 'root=live' /proc/cmdline; then
-    $SED "s#printf\(.*\)\$CMDLINE#printf\1\$CMDLINE root=live:/dev/dm-0 $VTKS $VTOVERLAY $vtInstDD#" -i /lib/dracut-lib.sh
+    $SED "s#printf\(.*\)\$CMDLINE#printf\1\$CMDLINE root=live:/dev/ventoy $VTKS $VTOVERLAY $vtInstDD#" -i /lib/dracut-lib.sh
 else
 else
-    $SED "s#printf\(.*\)\$CMDLINE#printf\1\$CMDLINE inst.stage2=hd:/dev/dm-0 $VTKS $VTOVERLAY $vtInstDD#" -i /lib/dracut-lib.sh
+    $SED "s#printf\(.*\)\$CMDLINE#printf\1\$CMDLINE inst.stage2=hd:/dev/ventoy $VTKS $VTOVERLAY $vtInstDD#" -i /lib/dracut-lib.sh
 fi
 
 ventoy_set_inotify_script  rhel7/ventoy-inotifyd-hook.sh
 fi
 
 ventoy_set_inotify_script  rhel7/ventoy-inotifyd-hook.sh
@@ -92,10 +98,19 @@ if [ -f /etc/system-release ]; then
         vtNeedRepo="yes"
     fi
 fi
         vtNeedRepo="yes"
     fi
 fi
-if $GREP -q el8 /proc/version; then
+
+if $GREP -q 'el[89]' /proc/version; then
     vtNeedRepo="yes"
 fi
 
     vtNeedRepo="yes"
 fi
 
+if $GREP -i -q Fedora /proc/version; then
+    if $GREP -q 'Server Edition' /etc/os-release; then
+        vtNeedRepo="yes"
+    fi
+fi
+
+echo "vtNeedRepo=$vtNeedRepo" >> $VTLOG
+
 if [ "$vtNeedRepo" = "yes" ]; then
     $BUSYBOX_PATH/cp -a $VTOY_PATH/hook/rhel7/ventoy-repo.sh /lib/dracut/hooks/pre-pivot/99-ventoy-repo.sh
 fi
 if [ "$vtNeedRepo" = "yes" ]; then
     $BUSYBOX_PATH/cp -a $VTOY_PATH/hook/rhel7/ventoy-repo.sh /lib/dracut/hooks/pre-pivot/99-ventoy-repo.sh
 fi