Improve ISO partition auto mount for different Linux distros.

This commit is contained in:
longpanda
2026-10-09 10:04:53 +08:00
parent 96f3210bd0
commit ab684ca049
14 changed files with 189 additions and 1 deletions
@@ -0,0 +1,25 @@
#!/ventoy/busybox/sh
. /ventoy/hook/ventoy-hook-lib.sh
PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
vtlog "####### $0 $* ########"
vtoy_udev_auto_hook() {
if [ -e /init ]; then
if $GREP -q '^mountroot$' /init; then
vtlog "mountroot distro"
sed "/^mountroot$/a\\$BUSYBOX_PATH/sh $VTOY_PATH/hook/kaos/ventoy-uauto-exec.sh" -i /init
return
fi
if $GREP -q '^ *exec.*switch_root' /init; then
vtlog "switch_root distro"
sed "/^ *exec.*switch_root/i\\$BUSYBOX_PATH/sh $VTOY_PATH/hook/kaos/ventoy-uauto-exec.sh" -i /init
return
fi
fi
}
vtoy_udev_auto_hook