2026-10-08 11:10:13 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
exec >> /var/log/ventoy-curtin-wa.log 2>&1
|
|
|
|
|
set -x
|
|
|
|
|
|
|
|
|
|
if [ -e /tmp/ventoy_storage_config.py ]; then
|
|
|
|
|
echo "no need to patch again"
|
2026-11-24 10:22:02 +08:00
|
|
|
else
|
2026-10-08 11:10:13 +08:00
|
|
|
NewFile=/tmp/ventoy_storage_config.py
|
2026-11-24 10:22:02 +08:00
|
|
|
OldFile=$(find /snap -type f -path '*curtin/storage_config.py' -print -quit 2>/dev/null)
|
|
|
|
|
if [ -n "$OldFile" ]; then
|
2026-10-08 11:10:13 +08:00
|
|
|
echo "Patch curtin storage config script"
|
|
|
|
|
cp -a $OldFile $NewFile
|
|
|
|
|
|
|
|
|
|
#skip Ventoy dm device
|
|
|
|
|
sed 's#\(if *\(.*\)\[.MAJOR.\] *in *\["11", *"2"\]\)#\1 or re.match(r"[vV]entoy.*|vtoy.*", \2.get("DM_NAME") or "")#g' -i $NewFile
|
|
|
|
|
mount --bind $NewFile $OldFile
|
|
|
|
|
else
|
|
|
|
|
echo "curin file not exist"
|
|
|
|
|
fi
|
|
|
|
|
fi
|