mirror of
https://github.com/ventoy/Ventoy.git
synced 2026-11-16 10:53:14 +01:00
29 lines
786 B
Bash
29 lines
786 B
Bash
#!/ventoy/busybox/sh
|
|||
|
|
|
||
|
|
. /ventoy/hook/ventoy-hook-lib.sh
|
||
|
|
|
||
|
|
PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
|
||
|
|
|
||
|
|
vtlog "####### $0 $* ########"
|
||
|
|
|
||
|
|
vtoy_udev_auto_hook() {
|
||
|
|
if [ -e /etc/os-release ]; then
|
||
|
|
if grep -q 'ID=ubuntu' /etc/os-release; then
|
||
|
|
if egrep -q 'VERSION_ID=\"2[2-9]\.|VERSION_ID=\"3[0-9]\.' /etc/os-release; then
|
||
|
|
vtlog "ubuntu distro"
|
||
|
|
sed "/^mountroot$/a\\$BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/ventoy-uauto-exec.sh" -i /init
|
||
|
|
return
|
||
|
|
fi
|
||
|
|
fi
|
||
|
|
fi
|
||
|
|
|
||
|
|
|
||
|
|
if [ -e /init ] && $GREP -q '^mountroot$' /init; then
|
||
|
|
vtlog "mountroot distro"
|
||
|
|
sed "/^mountroot$/a\\$BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/ventoy-uauto-exec.sh" -i /init
|
||
|
|
return
|
||
|
|
fi
|
||
|
|
}
|
||
|
|
|
||
|
|
vtoy_udev_auto_hook
|