mirror of
https://github.com/ventoy/Ventoy.git
synced 2026-11-03 03:41:57 +00:00
Improve ISO partition auto mount for different Linux distros.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
#!/ventoy/busybox/sh
|
||||
|
||||
. /ventoy/hook/ventoy-hook-lib.sh
|
||||
|
||||
PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
|
||||
|
||||
vtlog "####### $0 $* ########"
|
||||
|
||||
ventoy_copy_udev_auto_rules
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user