]> glassweightruler.freedombox.rocks Git - Ventoy.git/blobdiff - IMG/cpio/ventoy/hook/gentoo/ventoy-hook.sh
Fix the order issue in TreeView mode. (#3218)
[Ventoy.git] / IMG / cpio / ventoy / hook / gentoo / ventoy-hook.sh
index ce5dbe5ed21f7af5e6da7c9c7556eb77809fa1c1..d0ba02a7fe8c3426e6880db781a1365a38cd9bc4 100644 (file)
 
 . $VTOY_PATH/hook/ventoy-os-lib.sh
 
-if [ -d /etc/udev/rules.d ] || [ -d /lib/udev/rules.d ]; then    
+if $GREP -q kaspersky /proc/version; then
+    $SED "/sysresccd_stage1_normal[^(]*$/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/gentoo/disk_hook.sh"  -i /init
+    if [ -f /ventoy/ventoy_persistent_map ]; then
+        $SED "/sysresccd_parsecmdline[^(]*$/a\ BACKSTORE_CMD='LABEL=casper-rw,noloop'"  -i /init
+    fi
+elif $GREP -q 'setting up the root filesystem' /init; then
+    $SED "/setting up the root filesystem/a\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/gentoo/disk_hook.sh"  -i /init
+    $SED "/setting up the root filesystem/a\ export CDROOT_DEV=/dev/mapper/ventoy"  -i /init
+elif [ -d /etc/udev/rules.d ] || [ -d /lib/udev/rules.d ]; then    
     ventoy_systemd_udevd_work_around
     ventoy_add_udev_rule "$VTOY_PATH/hook/default/udev_disk_hook.sh %k noreplace"
 else
-    if $GREP -q kaspersky /proc/version; then
-        $SED "/sysresccd_stage1_normal[^(]*$/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/gentoo/disk_hook.sh"  -i /init
-    else
-        $SED "/mdev *-s/a\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/gentoo/disk_hook.sh"  -i /init
-    fi
+    $SED "/mdev *-s/a\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/gentoo/disk_hook.sh"  -i /init    
 fi