support Porteus v5.0rc3

This commit is contained in:
longpanda
2021-10-09 19:22:42 +08:00
parent 1db0827463
commit 93614c3251
2 changed files with 51 additions and 1 deletions

View File

@@ -25,13 +25,25 @@ porteus_hook() {
if $GREP -q exfat /proc/filesystems; then
vtPath=$($VTOY_PATH/tool/vtoydump -p $VTOY_PATH/ventoy_os_param)
vtFindFlag=0
$GREP '`value from`' /usr/* -r | $AWK -F: '{print $1}' | while read vtline; do
echo "hooking $vtline ..." >> $VTLOG
$SED "s#\`value from\`#$vtPath#g" -i $vtline
vtFindFlag=1
done
if [ $vtFindFlag -eq 0 ]; then
if $GREP -q '`value from`' /linuxrc; then
echo "hooking linuxrc ..." >> $VTLOG
$SED "/searching *for *\$CFG *file/i$BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/porteus-path.sh" -i /linuxrc
$SED "/searching *for *\$CFG *file/iFROM=\$(cat /porteus-from)" -i /linuxrc
$SED "/searching *for *\$CFG *file/iISO=\$(cat /porteus-from)" -i /linuxrc
vtFindFlag=1
fi
fi
else
for vtfile in '/init' '/linuxrc' ; do
for vtfile in '/linuxrc' '/init'; do
if [ -e $vtfile ]; then
if ! $GREP -q ventoy $vtfile; then
echo "hooking $vtfile ..." >> $VTLOG