Add a cleanup service for Ventoy udev rules files
Ventoy CI / build (push) Canceled after 0s
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Canceled after 0s

When we boot an ISO file to the live system through Ventoy.
The ISO partition (e.g. /dev/sda1) is hold by the device-mapper which will block it to be mounted.
So Ventoy will create a mirror device-mapper /dev/mapper/VentoyPart for /dev/sda1.
Most live systems with GUI environment will auto mount Ventoy ISO partition by udisk.
So in 1.1.18 Venoty will inject an udev rule in the Live system in order to:
1. Block the original ISO partition (e.g. /dev/sda1) to be auto-mounted.
2. Force /dev/mapper/VentoyPart to be auto-mounted.

But the udev rule file was injected to /etc directory of the Live system, this will make the rule mistakenly inherited into the final installed system.
Originally, the /run directory would have been the most suitable location, but in some Live systems /run is not a static directory but an overlayfs which is created dynamically during boot which make it a little bit complex.
So we add a cleanup systemd/sysvinit service.
This commit is contained in:
longpanda
2026-11-23 20:26:11 +08:00
parent 8308a527ac
commit 2248d1f807
15 changed files with 313 additions and 53 deletions
@@ -9,7 +9,7 @@ vtlog "####### $0 $* ########"
vtoy_udev_auto_hook() { vtoy_udev_auto_hook() {
if grep -q 'break.*=.*postmount' /init; then if grep -q 'break.*=.*postmount' /init; then
vtlog "udev auto before postmount" vtlog "udev auto before postmount"
sed "/break.*=.*postmount/i\\$BUSYBOX_PATH/sh $VTOY_PATH/hook/manjaro/ventoy-uauto-exec.sh" -i /init sed "/break.*=.*postmount/i\\$BUSYBOX_PATH/sh $VTOY_PATH/hook/arch/ventoy-uauto-exec.sh" -i /init
elif [ -d $VT_DRACUT_HOOKS/pre-pivot ]; then elif [ -d $VT_DRACUT_HOOKS/pre-pivot ]; then
vtlog "dracut distro" vtlog "dracut distro"
ventoy_dracut_pivot_udev_rule ventoy_dracut_pivot_udev_rule
@@ -6,6 +6,10 @@ After=systemd-udevd.service
Type=oneshot Type=oneshot
ExecStart=mv /dev/VTISOPART /dev/bk_VTISOPART ExecStart=mv /dev/VTISOPART /dev/bk_VTISOPART
ExecStart=cp -a /dev/DMXXX /dev/VTISOPART ExecStart=cp -a /dev/DMXXX /dev/VTISOPART
ExecStartPost=-/bin/sh -c '\
rm -f /etc/systemd/system/ventoy-clonezilla-cheat.service;\
rm -f /etc/systemd/system-preset/90-ventoy-clonezilla.preset;\
rm -f /etc/systemd/system/sysinit.target.wants/ventoy-clonezilla-cheat.service;\
'
[Install]
WantedBy=sysinit.target WantedBy=sysinit.target
@@ -3,6 +3,12 @@ Description=Ventoy subiquity curtin Workaround
[Service] [Service]
Type=oneshot Type=oneshot
ExecStart=/etc/ventoy/ventoy-curtin-wa.sh ExecStart=-/bin/sh /etc/ventoy_curtin/ventoy-curtin-wa.sh
ExecStartPost=-/bin/sh -c '\
rm -f /etc/systemd/system/ventoy-curtin-wa.service;\
rm -f /etc/systemd/system/snap.ubuntu-desktop-bootstrap.subiquity-server.service.d/10-ventoy-curtin-wa.conf;\
rm -rf /etc/ventoy_curtin;\
'
PrivateMounts=no PrivateMounts=no
ProtectSystem=no ProtectSystem=no
@@ -7,16 +7,16 @@ PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
vtlog "####### $0 $* ########" vtlog "####### $0 $* ########"
subiquity_curtin_workaround() { subiquity_curtin_workaround() {
mkdir -p /root/etc/ventoy mkdir -p /root/etc/ventoy_curtin
ventoy_copy_file /ventoy/hook/debian/ventoy-curtin-wa.sh /root/etc/ventoy/ventoy-curtin-wa.sh 0755 ventoy_copy_file /ventoy/hook/debian/ventoy-curtin-wa.sh /root/etc/ventoy_curtin/ventoy-curtin-wa.sh 0755
ventoy_copy_file /ventoy/hook/debian/ventoy-curtin-wa.conf /root/etc/ventoy/ventoy-curtin-wa.conf 0644 ventoy_copy_file /ventoy/hook/debian/ventoy-curtin-wa.conf /root/etc/ventoy_curtin/ventoy-curtin-wa.conf 0644
ventoy_copy_file /ventoy/hook/debian/ventoy-curtin-wa.service /root/etc/ventoy/ventoy-curtin-wa.service 0644 ventoy_copy_file /ventoy/hook/debian/ventoy-curtin-wa.service /root/etc/ventoy_curtin/ventoy-curtin-wa.service 0644
ln -sf /etc/ventoy/ventoy-curtin-wa.service /root/etc/systemd/system/ventoy-curtin-wa.service ln -sf /etc/ventoy_curtin/ventoy-curtin-wa.service /root/etc/systemd/system/ventoy-curtin-wa.service
vtDepDir=/root/etc/systemd/system/snap.ubuntu-desktop-bootstrap.subiquity-server.service.d vtDepDir=/root/etc/systemd/system/snap.ubuntu-desktop-bootstrap.subiquity-server.service.d
mkdir -p $vtDepDir mkdir -p $vtDepDir
ln -sf /etc/ventoy/ventoy-curtin-wa.conf $vtDepDir/10-ventoy-curtin-wa.conf ln -sf /etc/ventoy_curtin/ventoy-curtin-wa.conf $vtDepDir/10-ventoy-curtin-wa.conf
} }
@@ -6,7 +6,9 @@ ACTION=="add|change", SUBSYSTEM=="block", KERNEL=="DMXXX", \
ENV{UDISKS_SYSTEM}="0", \ ENV{UDISKS_SYSTEM}="0", \
ENV{UDISKS_REMOVABLE}="1", \ ENV{UDISKS_REMOVABLE}="1", \
ENV{UDISKS_AUTO}="1", \ ENV{UDISKS_AUTO}="1", \
ENV{UDISKS_IGNORE}="0", \
ENV{UDISKS_AUTOMOUNTABLE}="1" ENV{UDISKS_AUTOMOUNTABLE}="1"
KERNEL=="yyy", SUBSYSTEM=="block", ENV{UDISKS_IGNORE}="1" KERNEL=="yyy", SUBSYSTEM=="block", ENV{UDISKS_IGNORE}="1"
@@ -0,0 +1,22 @@
#!/bin/sh
rm -f /etc/systemd/system-preset/80-ventoy-udev.preset
rm -f /etc/systemd/system/sysinit.target.wants/ventoy-udev*.service
rm -f /etc/systemd/system/ventoy-udev*.service
if [ -f /etc/systemd/system/snap.ubuntu-desktop-bootstrap.subiquity-server.service.d/10-ventoy-curtin-wa.conf ]; then
if [ -e /etc/systemd/system/snap.ubuntu-desktop-bootstrap.subiquity-server.service ]; then
:
else
rm -f /etc/systemd/system/ventoy-curtin-wa.service
rm -f /etc/systemd/system/snap.ubuntu-desktop-bootstrap.subiquity-server.service.d/10-ventoy-curtin-wa.conf
rm -rf /etc/ventoy_curtin
fi
fi
mkdir -p /run/udev/rules.d
mv /etc/udev/rules.d/*ventoy* /run/udev/rules.d/
rm -f $0
@@ -4,8 +4,12 @@ After=systemd-udevd.service
[Service] [Service]
Type=oneshot Type=oneshot
ExecStart=-udevadm trigger --subsystem-match=block --sysname-match=yyy
ExecStart=-udevadm trigger --subsystem-match=block --sysname-match=DMXXX ExecStart=-udevadm trigger --subsystem-match=block --sysname-match=DMXXX
ExecStart=udevadm settle ExecStart=-udevadm settle
ExecStartPost=-/bin/sh /etc/ventoy-udev-cleanup.sh
RemainAfterExit=no
[Install] [Install]
WantedBy=sysinit.target WantedBy=sysinit.target
@@ -0,0 +1,57 @@
#!/bin/sh
set +e
rm -f /etc/boot.d/S01-ventoy-udev-trigger*
rm -f /etc/runlevels/sysinit/ventoy-udev-trigger*
rm -f /etc/runlevels/default/ventoy-udev-trigger*
rm -f /etc/dinit.d/boot.d/ventoy-udev-trigger*
rm -f /etc/dinit.d/default/ventoy-udev-trigger*
rm -f /etc/runit/runsvdir/sysinit/ventoy-udev-trigger*
rm -f /etc/runit/runsvdir/default/ventoy-udev-trigger*
rm -f /etc/s6/adminsv/sysinit/contents.d/ventoy-udev-trigger*
rm -f /etc/init.d/ventoy-udev-trigger*
rm -f /etc/dinit.d/ventoy-udev-trigger*
rm -rf /etc/runit/sv/ventoy-udev-trigger*
rm -rf /etc/s6/sv/ventoy-udev-trigger*
if ls -l /etc/udev/rules.d/ | grep -q ventoy; then
mkdir -p /run/udev/rules.d
mv /etc/udev/rules.d/*ventoy* /run/udev/rules.d/
fi
if [ -f /etc/rc.local ]; then
if grep -q ventoy /etc/rc.local; then
sed -i '/ventoy/d' /etc/rc.local
fi
fi
if [ -f /etc/s6/rc.local ]; then
if grep -q ventoy /etc/s6/rc.local; then
sed -i '/ventoy/d' /etc/s6/rc.local
fi
fi
setsid sh -c '
count=0
while [ $count -lt 60 ]; do
if pidof udisksd >/dev/null 2>&1; then
udevadm trigger --action=change --subsystem-match=block --sysname-match=yyy
udevadm trigger --action=change --subsystem-match=block --sysname-match=DMXXX
sleep 1
break
fi
count=$((count + 1))
sleep 2
done
' &
rm -f $0
@@ -0,0 +1,4 @@
type = scripted
command = /etc/ventoy-udev-cleanup.sh
after = local.target
@@ -0,0 +1,16 @@
#!/usr/bin/openrc-run
depend() {
after local
}
start() {
ebegin ""
/bin/sh /etc/ventoy-udev-cleanup.sh
eend 0
}
stop() {
ebegin ""
eend 0
}
@@ -0,0 +1,2 @@
#!/bin/sh
exec /etc/ventoy-udev-cleanup.sh
@@ -1,9 +0,0 @@
#!/bin/sh
for i in 0 1 2 3 4 5 6 7 8 9; do
[ -b /dev/DMXXX ] && break
sleep 1
done
udevadm trigger --subsystem-match=block --sysname-match=DMXXX
udevadm settle
+59 -15
View File
@@ -1042,40 +1042,84 @@ ventoy_copy_udev_auto_rules() {
vtlog "new root is $vroot" vtlog "new root is $vroot"
fi fi
# Resolve device mapping info
cp -a /ventoy/hook/default/90-ventoy-auto.rules /ventoy/udevtmp.rules
vtDM=$($VTOY_PATH/tool/dmsetup info VentoyPart | $GREP Major | $SED "s/.*[^0-9]\([0-9][0-9]*\)$/\1/") vtDM=$($VTOY_PATH/tool/dmsetup info VentoyPart | $GREP Major | $SED "s/.*[^0-9]\([0-9][0-9]*\)$/\1/")
$SED "s/DMXXX/dm-${vtDM}/g" -i /ventoy/udevtmp.rules
vtRAWDISKNAME=$($HEAD -n1 $VTOY_PATH/ventoy_raw_table | $AWK '{print $4}') vtRAWDISKNAME=$($HEAD -n1 $VTOY_PATH/ventoy_raw_table | $AWK '{print $4}')
$SED "s/yyy/${vtRAWDISKNAME#/dev/}/g" -i /ventoy/udevtmp.rules vtRAWDISK_SYSNAME="${vtRAWDISKNAME#/dev/}"
vtlog "VentoyPart is /dev/dm-${vtDM} map to $vtRAWDISKNAME NewRoot is $vroot" vtlog "VentoyPart is /dev/dm-${vtDM} map to $vtRAWDISKNAME NewRoot is $vroot"
ventoy_copy_file /ventoy/udevtmp.rules $vroot/etc/udev/rules.d/90-ventoy-auto.rules 0644 mkdir -p $vroot/etc/udev/rules.d
cp -a /ventoy/hook/default/90-ventoy-auto.rules /ventoy/udevtmp.rules
$SED "s/DMXXX/dm-${vtDM}/g" -i /ventoy/udevtmp.rules
$SED "s/yyy/${vtRAWDISK_SYSNAME}/g" -i /ventoy/udevtmp.rules
ventoy_copy_file /ventoy/udevtmp.rules $vroot/etc/udev/rules.d/9999-ventoy-auto.rules 0644
ventoy_copy_file /ventoy/udevtmp.rules $vroot/etc/udev/rules.d/11-ventoy-auto.rules 0644 ventoy_copy_file /ventoy/udevtmp.rules $vroot/etc/udev/rules.d/11-ventoy-auto.rules 0644
if $GREP -q 'init=.*sysvinit' /proc/cmdline; then if $GREP -q 'init=/lib/sysvinit' /proc/cmdline; then
vtlog "copy sysvinit udev trigger script" SYSVINIT=1
cp -a /ventoy/hook/default/ventoy-udev-trigger.rc /ventoy/udevtmp.rc else
$SED "s/DMXXX/dm-${vtDM}/g" -i /ventoy/udevtmp.rc SYSVINIT=0
fi
mkdir -p $vroot/etc/boot.d if [ -d $vroot/etc/systemd/system -a "$SYSVINIT" = "0" ]; then
ventoy_copy_file /ventoy/udevtmp.rc $vroot/etc/boot.d/S01-ventoy-udev-trigger 0755 vtlog "systemd inject hook"
ventoy_copy_file /ventoy/hook/default/systemd/ventoy-udev-cleanup.sh $vroot/etc/ventoy-udev-cleanup.sh 0755
else
vtlog "sysvinit inject hook"
ventoy_copy_file /ventoy/hook/default/sysvinit/ventoy-udev-cleanup.sh $vroot/etc/ventoy-udev-cleanup.sh 0755
fi
$SED "s/DMXXX/dm-${vtDM}/g" -i $vroot/etc/ventoy-udev-cleanup.sh
$SED "s/yyy/${vtRAWDISK_SYSNAME}/g" -i $vroot/etc/ventoy-udev-cleanup.sh
if [ "$SYSVINIT" = "1" ]; then
vtlog "copy sysvinit udev trigger script"
echo "/etc/ventoy-udev-cleanup.sh" >> $vroot/etc/rc.local
elif [ -d $vroot/etc/systemd/system ]; then elif [ -d $vroot/etc/systemd/system ]; then
vtlog "copy systemd udev trigger service" vtlog "copy systemd udev trigger service"
if [ -d $vroot/etc/systemd/system/sysinit.target.wants ]; then
vtlog "$vroot/etc/systemd/system/sysinit.target.wants exist ok"
else
mkdir -p $vroot/etc/systemd/system/sysinit.target.wants mkdir -p $vroot/etc/systemd/system/sysinit.target.wants
cp -a /ventoy/hook/default/ventoy-udev-trigger.service /ventoy/udevtmp.service fi
cp -a /ventoy/hook/default/systemd/ventoy-udev-trigger.service /ventoy/udevtmp.service
$SED "s/DMXXX/dm-${vtDM}/g" -i /ventoy/udevtmp.service $SED "s/DMXXX/dm-${vtDM}/g" -i /ventoy/udevtmp.service
$SED "s/yyy/${vtRAWDISK_SYSNAME}/g" -i /ventoy/udevtmp.service
ventoy_copy_file /ventoy/udevtmp.service $vroot/etc/systemd/system/ventoy-udev-trigger.service 0644 ventoy_copy_file /ventoy/udevtmp.service $vroot/etc/systemd/system/ventoy-udev-trigger.service 0644
if [ -d $vroot/etc/systemd/system-preset ]; then
vtlog "$vroot/etc/systemd/system-preset exist ok"
else
mkdir -p $vroot/etc/systemd/system-preset mkdir -p $vroot/etc/systemd/system-preset
fi
echo 'enable ventoy-udev-trigger.service' > $vroot/etc/systemd/system-preset/80-ventoy-udev.preset echo 'enable ventoy-udev-trigger.service' > $vroot/etc/systemd/system-preset/80-ventoy-udev.preset
$BUSYBOX_PATH/ln -sf /etc/systemd/system/ventoy-udev-trigger.service $vroot/etc/systemd/system/sysinit.target.wants/ventoy-udev-trigger.service $BUSYBOX_PATH/ln -sf /etc/systemd/system/ventoy-udev-trigger.service $vroot/etc/systemd/system/sysinit.target.wants/ventoy-udev-trigger.service
elif [ -d $vroot/etc/init.d ] && [ -d $vroot/etc/runlevels/default ]; then
vtlog "copy sysvinit openrc udev trigger script"
ventoy_copy_file /ventoy/hook/default/sysvinit/ventoy-udev-trigger-cleanup.openrc $vroot/etc/init.d/ventoy-udev-trigger-cleanup 0755
$BUSYBOX_PATH/ln -sf /etc/init.d/ventoy-udev-trigger-cleanup $vroot/etc/runlevels/default/ventoy-udev-trigger-cleanup
elif [ -d $vroot/etc/dinit.d/boot.d ]; then
vtlog "copy sysvinit dinit udev trigger script"
ventoy_copy_file /ventoy/hook/default/sysvinit/ventoy-udev-trigger-cleanup.dinit $vroot/etc/dinit.d/ventoy-udev-trigger-cleanup 0644
$BUSYBOX_PATH/ln -sf /etc/dinit.d/ventoy-udev-trigger-cleanup $vroot/etc/dinit.d/boot.d/ventoy-udev-trigger-cleanup
elif [ -d $vroot/etc/runit/sv ] && [ -d $vroot/etc/runit/runsvdir/default ]; then
vtlog "copy sysvinit runit udev trigger script"
mkdir -p $vroot/etc/runit/sv/ventoy-udev-trigger-cleanup
ventoy_copy_file /ventoy/hook/default/sysvinit/ventoy-udev-trigger-cleanup.runit $vroot/etc/runit/sv/ventoy-udev-trigger-cleanup/run 0755
$BUSYBOX_PATH/ln -sf /etc/runit/sv/ventoy-udev-trigger-cleanup $vroot/etc/runit/runsvdir/default/ventoy-udev-trigger-cleanup
elif [ -d $vroot/etc/s6/sv ]; then
vtlog "copy sysvinit s6 udev trigger script"
echo "/etc/ventoy-udev-cleanup.sh" >> $vroot/etc/s6/rc.local
elif [ -f $vroot/etc/rc.local ]; then
vtlog "copy sysvinit udev trigger script"
echo "/etc/ventoy-udev-cleanup.sh" >> $vroot/etc/rc.local
else else
vtlog "sysinit wants dir not exist" vtlog "unsupported init system"
fi fi
} }
+7
View File
@@ -410,6 +410,13 @@ ventoy_get_os_type() {
echo "debian"; return echo "debian"; return
fi fi
if [ -e /etc/os-release ]; then
if $GREP -qi 'ID=arch' /etc/os-release; then
echo 'arch'; return
fi
fi
echo "default" echo "default"
} }
+114 -13
View File
@@ -106,12 +106,34 @@ ventoy_get_os_type() {
echo 'pmagic'; return echo 'pmagic'; return
fi fi
# PrimeOS :
if $GREP -q 'PrimeOS' /proc/version; then
echo 'primeos'; return
# Debian :
elif $GREP -q '[Dd]ebian' /proc/version; then
echo 'debian'; return
# Ubuntu : do the same process with debian
elif $GREP -q '[Uu]buntu' /proc/version; then
echo 'debian'; return
# Deepin :
elif $GREP -q '[Dd]eepin' /proc/version; then
echo 'deepin'; return
# rhel5/CentOS5 and all other distributions based on them # rhel5/CentOS5 and all other distributions based on them
if $GREP -q 'el5' /proc/version; then elif $GREP -q 'el5' /proc/version; then
echo 'rhel5'; return echo 'rhel5'; return
# rhel6/CentOS6 and all other distributions based on them # rhel6/CentOS6 and all other distributions based on them
elif $GREP -q 'el6' /proc/version; then elif $GREP -q 'el6' /proc/version; then
if [ -f /sbin/detectcd ]; then
if $GREP -q -i 'LENOVO-EasyStartup' /sbin/detectcd; then
echo 'easystartup'; return
fi
fi
echo 'rhel6'; return echo 'rhel6'; return
# rhel7/CentOS7/rhel8/CentOS8 and all other distributions based on them # rhel7/CentOS7/rhel8/CentOS8 and all other distributions based on them
@@ -126,17 +148,12 @@ ventoy_get_os_type() {
elif $GREP -q '\.fc[0-9][0-9]\.' /proc/version; then elif $GREP -q '\.fc[0-9][0-9]\.' /proc/version; then
echo 'rhel7'; return echo 'rhel7'; return
# Debian : elif $GREP -q 'euleros' /proc/version; then
elif $GREP -q '[Dd]ebian' /proc/version; then if [ -d /usr/Euler/project/init ]; then
echo 'debian'; return echo 'euleros'; return
else
# Ubuntu : do the same process with debian echo 'rhel7'; return
elif $GREP -q '[Uu]buntu' /proc/version; then fi
echo 'debian'; return
# Deepin : do the same process with debian
elif $GREP -q '[Dd]eepin' /proc/version; then
echo 'debian'; return
# SUSE # SUSE
elif $GREP -q 'SUSE' /proc/version; then elif $GREP -q 'SUSE' /proc/version; then
@@ -210,8 +227,12 @@ ventoy_get_os_type() {
elif $GREP -q 'fuyu' /etc/os-release; then elif $GREP -q 'fuyu' /etc/os-release; then
echo 'openEuler'; return echo 'openEuler'; return
elif $GREP -q 'deepin' /etc/os-release; then elif $GREP -q 'deepin' /etc/os-release; then
echo 'debian'; return echo 'deepin'; return
elif $GREP -q 'chinauos' /etc/os-release; then elif $GREP -q 'chinauos' /etc/os-release; then
echo 'deepin'; return
elif $GREP -qi 'aerynos' /etc/os-release; then
echo 'rhel7'; return
elif $GREP -qi 'ID_LIKE=debian' /etc/os-release; then
echo 'debian'; return echo 'debian'; return
fi fi
fi fi
@@ -270,6 +291,10 @@ ventoy_get_os_type() {
echo 'android'; return echo 'android'; return
fi fi
if $GREP -q 'android.google' /proc/version; then
echo 'android'; return
fi
if $GREP -q 'adelielinux' /proc/version; then if $GREP -q 'adelielinux' /proc/version; then
echo 'adelie'; return echo 'adelie'; return
fi fi
@@ -382,6 +407,65 @@ ventoy_get_os_type() {
echo "openEuler"; return echo "openEuler"; return
fi fi
#special arch based iso file check
if [ -f /init ]; then
if $GREP -q 'mount_handler' /init; then
if [ -d /hooks ]; then
if $BUSYBOX_PATH/ls -1 /hooks/ | $GREP -q '.*iso$'; then
echo "arch"; return
fi
elif [ -d /hook ]; then
if $BUSYBOX_PATH/ls -1 /hook/ | $GREP -q '.*iso$'; then
echo "arch"; return
fi
fi
fi
fi
#Kylin V10 Server
if [ -f /usr/sbin/dhclient ]; then
if $BUSYBOX_PATH/strings /usr/sbin/dhclient | $GREP -i -q -m1 openeuler; then
echo 'openEuler'; return
fi
fi
if [ -f /etc/kylin-release ]; then
if $GREP -i -q -m1 'Kylin.*Server.* V1[1-9] ' /etc/kylin-release; then
echo 'openEuler'; return
fi
fi
if $GREP -q 'chimera' /proc/version; then
echo 'chimera'; return
fi
if $GREP -q '4.19.' /proc/version; then
if [ -d /lib/dracut/hooks ]; then
echo 'openEuler'; return
fi
fi
if [ -f /etc/tinyramfs/config ]; then
if $GREP -q 'EWE_ISO' /etc/tinyramfs/config; then
echo "ewe"; return
fi
fi
if [ -f /scripts/casper ]; then
echo "debian"; return
fi
if [ -e /etc/os-release ]; then
if $GREP -qi 'ID=arch' /etc/os-release; then
echo 'arch'; return
fi
fi
echo "default" echo "default"
} }
@@ -392,6 +476,23 @@ if [ -e "$VTOY_PATH/loop/$VTOS/ventoy-hook.sh" ]; then
elif [ -e "$VTOY_PATH/hook/$VTOS/ventoy-hook.sh" ]; then elif [ -e "$VTOY_PATH/hook/$VTOS/ventoy-hook.sh" ]; then
$BUSYBOX_PATH/sh "$VTOY_PATH/hook/$VTOS/ventoy-hook.sh" $BUSYBOX_PATH/sh "$VTOY_PATH/hook/$VTOS/ventoy-hook.sh"
fi fi
if [ -e "$VTOY_PATH/hook/$VTOS/ventoy-uauto-hook.sh" ]; then
$BUSYBOX_PATH/sh "$VTOY_PATH/hook/$VTOS/ventoy-uauto-hook.sh"
fi
####################################################################
# #
# Step 4 : Run LiveInjection Hook #
# #
####################################################################
if [ -f "/live_injection_7ed136ec_7a61_4b54_adc3_ae494d5106ea/hook.sh" ]; then
echo "==== Begin Call live injection hook.sh $VTOS" >> $VTLOG
$BUSYBOX_PATH/sh "/live_injection_7ed136ec_7a61_4b54_adc3_ae494d5106ea/hook.sh" $VTOS >>$VTLOG 2>&1
echo "==== Finish Call live injection hook.sh $VTOS" >> $VTLOG
else
echo "No live injection" >> $VTLOG
fi
#################################################################### ####################################################################