1. Improve the Linux remount feature to make the ISO partition mountable out of the box on mainstream desktop distros.
Ventoy CI / build (push) Canceled after 0s
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Canceled after 0s

2. Change the ISO partition dm name to stable /dev/mapper/VentoyPart
This commit is contained in:
longpanda
2026-10-08 11:10:13 +08:00
parent 432152813e
commit 490ed6ce0f
20 changed files with 288 additions and 71 deletions
@@ -0,0 +1,3 @@
[Unit]
Wants=ventoy-curtin-wa.service
After=ventoy-curtin-wa.service
@@ -0,0 +1,8 @@
[Unit]
Description=Ventoy subiquity curtin Workaround
[Service]
Type=oneshot
ExecStart=/etc/ventoy/ventoy-curtin-wa.sh
PrivateMounts=no
ProtectSystem=no
@@ -0,0 +1,27 @@
#!/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"
elif [ -d /snap/ubuntu-desktop-bootstrap/current/lib ]; then
PyVer=$(ls -1 /snap/ubuntu-desktop-bootstrap/current/lib | grep -m1 python)
echo "Python Path: $PyVer"
OldFile=/snap/ubuntu-desktop-bootstrap/current/lib/$PyVer/site-packages/curtin/storage_config.py
NewFile=/tmp/ventoy_storage_config.py
if [ -e $OldFile ]; then
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
else
echo "curin snap dir not exit"
fi
+1 -1
View File
@@ -60,7 +60,7 @@ ventoy_get_debian_distro() {
fi
if $GREP -q 'NAME="Kylin"' /etc/os-release; then
echo 'kylin'; return
fi
fi
fi
if $GREP -q 'slax/' /proc/cmdline; then
@@ -0,0 +1,36 @@
#!/ventoy/busybox/sh
. /ventoy/hook/ventoy-hook-lib.sh
PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
vtlog "####### $0 $* ########"
subiquity_curtin_workaround() {
mkdir -p /root/etc/ventoy
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.conf /root/etc/ventoy/ventoy-curtin-wa.conf 0644
ventoy_copy_file /ventoy/hook/debian/ventoy-curtin-wa.service /root/etc/ventoy/ventoy-curtin-wa.service 0644
ln -sf /etc/ventoy/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
mkdir -p $vtDepDir
ln -sf /etc/ventoy/ventoy-curtin-wa.conf $vtDepDir/10-ventoy-curtin-wa.conf
}
if [ -d /root/etc/systemd/system -a -d /root/etc/udev/rules.d ]; then
vtlog "systemd udev check OK"
ventoy_copy_udev_auto_rules
if ls /root/etc/udev/rules.d | grep -q 'snap.*desktop'; then
subiquity_curtin_workaround
else
vtlog "no snap desktop detected"
fi
else
vtlog "systemd or udev not exist"
fi
@@ -0,0 +1,28 @@
#!/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