X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/Ventoy.git/blobdiff_plain/05a1b863a66bf72b26e5d87570c4e0e61b9736cd..8ef9732931bb298c8d5ffd66efcc4d79ad2cdbe2:/IMG/cpio/ventoy/hook/alpine/ventoy-hook.sh diff --git a/IMG/cpio/ventoy/hook/alpine/ventoy-hook.sh b/IMG/cpio/ventoy/hook/alpine/ventoy-hook.sh index ae366cd..f894966 100644 --- a/IMG/cpio/ventoy/hook/alpine/ventoy-hook.sh +++ b/IMG/cpio/ventoy/hook/alpine/ventoy-hook.sh @@ -19,6 +19,17 @@ . $VTOY_PATH/hook/ventoy-os-lib.sh -echo "-[-a-z0-9]*2 root:root 0666 @$BUSYBOX_PATH/sh $VTOY_PATH/hook/alpine/udev_disk_hook.sh" >> /mdev.conf -$CAT /etc/mdev.conf >> /mdev.conf -$BUSYBOX_PATH/mv /mdev.conf /etc/mdev.conf +PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH + +LineBegin=$(grep -n "ebegin.*Mounting boot media" /init | awk -F: '{print $1}') + +grep -n "^eend" /init > /t.list +while read line; do + LineEnd=$(echo $line | awk -F: '{print $1}') + if [ $LineEnd -gt $LineBegin ]; then + sed "${LineEnd}i\done" -i /init + sed "${LineBegin}r /ventoy/hook/alpine/insert.sh" -i /init + break + fi +done < /t.list +rm -f /t.list