mirror of
https://github.com/ventoy/Ventoy.git
synced 2026-10-21 05:31:56 +00:00
1. Improve the Linux remount feature to make the ISO partition mountable out of the box on mainstream desktop distros.
2. Change the ISO partition dm name to stable /dev/mapper/VentoyPart
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
#!/ventoy/busybox/sh
|
||||
|
||||
. /ventoy/hook/ventoy-hook-lib.sh
|
||||
|
||||
PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
|
||||
|
||||
vtlog "####### $0 $* ########"
|
||||
|
||||
ventoy_copy_udev_auto_rules
|
||||
@@ -0,0 +1,16 @@
|
||||
#!/ventoy/busybox/sh
|
||||
|
||||
. /ventoy/hook/ventoy-hook-lib.sh
|
||||
|
||||
PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
|
||||
|
||||
vtlog "####### $0 $* ########"
|
||||
|
||||
vtoy_udev_auto_hook() {
|
||||
if grep -q 'break.*=.*postmount' /init; then
|
||||
vtlog "udev auto before postmount"
|
||||
sed "/break.*=.*postmount/i\\$BUSYBOX_PATH/sh $VTOY_PATH/hook/manjaro/ventoy-uauto-exec.sh" -i /init
|
||||
fi
|
||||
}
|
||||
|
||||
vtoy_udev_auto_hook
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -1,25 +1,12 @@
|
||||
ACTION=="add", SUBSYSTEM=="block", KERNEL=="dm-*", \
|
||||
ACTION=="add|change", SUBSYSTEM=="block", KERNEL=="dm-*", \
|
||||
ENV{DM_NAME}=="[vV]entoy*", \
|
||||
ENV{DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG}="", \
|
||||
ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}="", \
|
||||
ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=""
|
||||
|
||||
ACTION=="add", SUBSYSTEM=="block", KERNEL=="dm-*", \
|
||||
ACTION=="add|change", SUBSYSTEM=="block", KERNEL=="dm-*", \
|
||||
ENV{DM_NAME}=="vtoy*", \
|
||||
ENV{DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG}="", \
|
||||
ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}="", \
|
||||
ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=""
|
||||
|
||||
ACTION=="change", SUBSYSTEM=="block", KERNEL=="dm-*", \
|
||||
ENV{DM_NAME}=="[vV]entoy*", \
|
||||
ENV{DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG}="", \
|
||||
ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}="", \
|
||||
ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=""
|
||||
|
||||
ACTION=="change", SUBSYSTEM=="block", KERNEL=="dm-*", \
|
||||
ENV{DM_NAME}=="vtoy*", \
|
||||
ENV{DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG}="", \
|
||||
ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}="", \
|
||||
ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=""
|
||||
|
||||
|
||||
|
||||
@@ -1,30 +1,12 @@
|
||||
|
||||
ACTION=="add", SUBSYSTEM=="block", KERNEL=="dm-*", \
|
||||
ENV{DM_NAME}=="VentoyPart", \
|
||||
ACTION=="add|change", SUBSYSTEM=="block", KERNEL=="DMXXX", \
|
||||
ENV{DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG}="", \
|
||||
ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}="", \
|
||||
ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="", \
|
||||
ENV{ID_FS_LABEL}="VentoyPart", \
|
||||
ENV{ID_FS_LABEL_ENC}="VentoyPart", \
|
||||
ENV{UDISKS_FILESYSTEM_LABEL}="VentoyPart", \
|
||||
ENV{UDISKS_PRESENTATION_NAME}="VentoyPart", \
|
||||
ENV{UDISKS_SYSTEM}="0", \
|
||||
ENV{UDISKS_REMOVABLE}="1", \
|
||||
ENV{UDISKS_AUTO}="1", \
|
||||
ENV{UDISKS_AUTOMOUNTABLE}="1"
|
||||
|
||||
|
||||
ACTION=="change", SUBSYSTEM=="block", KERNEL=="dm-*", \
|
||||
ENV{DM_NAME}=="VentoyPart", \
|
||||
ENV{DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG}="", \
|
||||
ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}="", \
|
||||
ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="", \
|
||||
ENV{ID_FS_LABEL}="VentoyPart", \
|
||||
ENV{ID_FS_LABEL_ENC}="VentoyPart", \
|
||||
ENV{UDISKS_FILESYSTEM_LABEL}="VentoyPart", \
|
||||
ENV{UDISKS_PRESENTATION_NAME}="VentoyPart", \
|
||||
ENV{UDISKS_SYSTEM}="0", \
|
||||
ENV{UDISKS_REMOVABLE}="1", \
|
||||
ENV{UDISKS_AUTO}="1", \
|
||||
ENV{UDISKS_AUTOMOUNTABLE}="1"
|
||||
|
||||
KERNEL=="yyy", SUBSYSTEM=="block", ENV{UDISKS_IGNORE}="1"
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
#!/ventoy/busybox/sh
|
||||
|
||||
. /ventoy/hook/ventoy-hook-lib.sh
|
||||
|
||||
vtlog "####### $0 $* ########"
|
||||
|
||||
for vroot in sysroot newroot root; do
|
||||
if [ -e $vroot/etc/selinux/config ]; then
|
||||
$SED "s/SELINUX=enforcing/SELINUX=permissive/g" -i $vroot/etc/selinux/config
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
$BUSYBOX_PATH/true
|
||||
@@ -1,15 +1,9 @@
|
||||
#!/bin/sh
|
||||
#!/ventoy/busybox/sh
|
||||
|
||||
for vroot in sysroot newroot; do
|
||||
if [ -d $vroot/etc ]; then
|
||||
if [ -d $vroot/etc/udev/rules.d ]; then
|
||||
:
|
||||
else
|
||||
mkdir -p $vroot/etc/udev/rules.d
|
||||
fi
|
||||
|
||||
cp -a /ventoy/hook/default/90-ventoy-auto.rules $vroot/etc/udev/rules.d/
|
||||
chmod 0644 $vroot/etc/udev/rules.d/90-ventoy-auto.rules
|
||||
break
|
||||
fi
|
||||
done
|
||||
. /ventoy/hook/ventoy-hook-lib.sh
|
||||
|
||||
vtlog "####### $0 $* ########"
|
||||
|
||||
ventoy_copy_udev_auto_rules
|
||||
|
||||
$BUSYBOX_PATH/true
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=Ventoy DM device udev attributes
|
||||
After=systemd-udevd.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=-udevadm trigger --subsystem-match=block --sysname-match=DMXXX
|
||||
ExecStart=udevadm settle
|
||||
|
||||
[Install]
|
||||
WantedBy=sysinit.target
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/ventoy/busybox/sh
|
||||
|
||||
. /ventoy/hook/ventoy-hook-lib.sh
|
||||
|
||||
PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
|
||||
|
||||
vtlog "####### $0 $* ########"
|
||||
|
||||
ventoy_copy_udev_auto_rules
|
||||
@@ -0,0 +1,16 @@
|
||||
#!/ventoy/busybox/sh
|
||||
|
||||
. /ventoy/hook/ventoy-hook-lib.sh
|
||||
|
||||
PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
|
||||
|
||||
vtlog "####### $0 $* ########"
|
||||
|
||||
vtoy_udev_auto_hook() {
|
||||
if grep -q 'break.*=.*postmount' /init; then
|
||||
vtlog "udev auto before postmount"
|
||||
sed "/break.*=.*postmount/i\\$BUSYBOX_PATH/sh $VTOY_PATH/hook/manjaro/ventoy-uauto-exec.sh" -i /init
|
||||
fi
|
||||
}
|
||||
|
||||
vtoy_udev_auto_hook
|
||||
@@ -0,0 +1,22 @@
|
||||
#!/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=fedora' /etc/os-release; then
|
||||
if grep -q 'VERSION_ID=[3-9][0-9]' /etc/os-release; then
|
||||
vtlog "fedora distro"
|
||||
ventoy_dracut_pivot_udev_rule
|
||||
ventoy_dracut_pivot_selinux_off
|
||||
return
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
vtoy_udev_auto_hook
|
||||
@@ -64,6 +64,14 @@ vterr() {
|
||||
}
|
||||
|
||||
|
||||
ventoy_copy_file() {
|
||||
cp -a "$1" "$2"
|
||||
if [ -n "$3" ]; then
|
||||
chmod $3 "$2"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
is_ventoy_hook_finished() {
|
||||
[ -e $VTOY_PATH/hook_finish ]
|
||||
}
|
||||
@@ -77,7 +85,7 @@ set_ventoy_hook_finish() {
|
||||
echo "### iso part dm cmd" >> $VTLOG
|
||||
$CAT /ventoy/ventoy_iso_part_dm_cmd >> $VTLOG
|
||||
$BUSYBOX_PATH/sh /ventoy/ventoy_iso_part_dm_cmd >>$VTLOG 2>&1
|
||||
#$BUSYBOX_PATH/rm -f /ventoy/ventoy_iso_part_dm_cmd
|
||||
$BUSYBOX_PATH/mv /ventoy/ventoy_iso_part_dm_cmd /ventoy/ventoy_iso_part_dm_cmd_bk
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -275,9 +283,8 @@ create_ventoy_device_mapper() {
|
||||
fi
|
||||
|
||||
RAWDISKNAME=$($HEAD -n1 $VTOY_PATH/ventoy_raw_table | $AWK '{print $4}')
|
||||
echo "$VT_DM_BIN create VentoyPart $VTOY_PATH/ventoy_raw_table" > /ventoy/ventoy_iso_part_dm_cmd
|
||||
#echo "$VT_DM_BIN mknodes VentoyPart" >> /ventoy/ventoy_iso_part_dm_cmd
|
||||
#echo "$VT_DM_BIN ls" >> /ventoy/ventoy_iso_part_dm_cmd
|
||||
echo "$VT_DM_BIN create VentoyPart $VTOY_PATH/ventoy_raw_table" > /ventoy/ventoy_iso_part_dm_cmd
|
||||
echo "echo 1 > $VTOY_PATH/ventoy_raw_dm_done" >> /ventoy/ventoy_iso_part_dm_cmd
|
||||
}
|
||||
|
||||
create_ventoy_loop_device_mapper() {
|
||||
@@ -739,15 +746,9 @@ ventoy_remove_all_dm() {
|
||||
$VTOY_PATH/tool/dmsetup remove ventoy >> $VTLOG 2>&1
|
||||
rm -f /dev/ventoy*
|
||||
|
||||
if [ -e $VTOY_PATH/ventoy_raw_table ]; then
|
||||
RAWDISKNAME=$($HEAD -n1 $VTOY_PATH/ventoy_raw_table | $AWK '{print $4}')
|
||||
DMRAWDISKNAME=${RAWDISKNAME#/dev/}
|
||||
if $VTOY_PATH/tool/dmsetup ls | $GREP -qw "$DMRAWDISKNAME"; then
|
||||
vtlog "dmsetup remove ${DMRAWDISKNAME}"
|
||||
$VTOY_PATH/tool/dmsetup remove "$DMRAWDISKNAME"
|
||||
else
|
||||
vtlog "no need to remove DM ${DMRAWDISKNAME}"
|
||||
fi
|
||||
if [ -e $VTOY_PATH/ventoy_raw_dm_done ]; then
|
||||
vtlog "dmsetup remove VentoyPart"
|
||||
$VTOY_PATH/tool/dmsetup remove VentoyPart
|
||||
rm -f $VTOY_PATH/ventoy_iso_part_dm_cmd
|
||||
fi
|
||||
|
||||
@@ -1011,3 +1012,59 @@ ventoy_mount_iso() {
|
||||
|
||||
$BUSYBOX_PATH/false
|
||||
}
|
||||
|
||||
ventoy_init_udev_auto_rules() {
|
||||
ventoy_copy_file /ventoy/hook/default/11-ventoy-dm.rules /etc/udev/rules.d/11-ventoy-dm.rules 0644
|
||||
}
|
||||
|
||||
ventoy_copy_udev_auto_rules() {
|
||||
if ! [ -e $VTOY_PATH/ventoy_raw_dm_done ]; then
|
||||
vtlog "ventoy_raw_dm_done not exist, no need for udev auto rule"
|
||||
return
|
||||
fi
|
||||
|
||||
vtlog "==== Copy udev auto rules ===="
|
||||
for vroot in sysroot newroot new_root root; do
|
||||
if [ -d $vroot/etc/udev/rules.d ]; then
|
||||
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/")
|
||||
$SED "s/DMXXX/dm-${vtDM}/g" -i /ventoy/udevtmp.rules
|
||||
|
||||
vtRAWDISKNAME=$($HEAD -n1 $VTOY_PATH/ventoy_raw_table | $AWK '{print $4}')
|
||||
$SED "s/yyy/${vtRAWDISKNAME#/dev/}/g" -i /ventoy/udevtmp.rules
|
||||
|
||||
vtlog "VentoyPart is /dev/dm-${vtDM} map to $vtRAWDISKNAME"
|
||||
|
||||
ventoy_copy_file /ventoy/udevtmp.rules $vroot/etc/udev/rules.d/90-ventoy-auto.rules 0644
|
||||
ventoy_copy_file /ventoy/udevtmp.rules $vroot/etc/udev/rules.d/11-ventoy-auto.rules 0644
|
||||
|
||||
if [ -d $vroot/etc/systemd/system/sysinit.target.wants ]; then
|
||||
vtlog "copy udev trigger service"
|
||||
cp -a /ventoy/hook/default/ventoy-udev-trigger.service /ventoy/udevtmp.service
|
||||
$SED "s/DMXXX/dm-${vtDM}/g" -i /ventoy/udevtmp.service
|
||||
ventoy_copy_file /ventoy/udevtmp.service $vroot/etc/systemd/system/ventoy-udev-trigger.service 0644
|
||||
|
||||
mkdir -p $vroot/etc/systemd/system-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
|
||||
else
|
||||
vtlog "sysinit wants dir not exist"
|
||||
fi
|
||||
|
||||
break
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
ventoy_dracut_pivot_udev_rule() {
|
||||
echo "#!/bin/sh" > $VT_DRACUT_HOOKS/pre-pivot/99-ventoy-udev-rules.sh
|
||||
echo "/ventoy/busybox/sh $VTOY_PATH/hook/default/ventoy-pivot-udev-rule.sh" >> $VT_DRACUT_HOOKS/pre-pivot/99-ventoy-udev-rules.sh
|
||||
}
|
||||
|
||||
ventoy_dracut_pivot_selinux_off() {
|
||||
echo "#!/bin/sh" > $VT_DRACUT_HOOKS/pre-pivot/99-ventoy-selinux-off.sh
|
||||
echo "/ventoy/busybox/sh $VTOY_PATH/hook/default/ventoy-pivot-selinux-off.sh" >> $VT_DRACUT_HOOKS/pre-pivot/99-ventoy-selinux-off.sh
|
||||
}
|
||||
|
||||
|
||||
@@ -71,11 +71,6 @@ ventoy_add_udev_auto_rule() {
|
||||
}
|
||||
|
||||
|
||||
ventoy_dracut_pivot_udev_rule() {
|
||||
cp -a $VTOY_PATH/hook/default/ventoy-pivot-udev-rule.sh $VT_DRACUT_HOOKS/pre-pivot/99-ventoy-udev-rules.sh
|
||||
}
|
||||
|
||||
|
||||
ventoy_add_kernel_udev_rule() {
|
||||
VT_UDEV_RULE_PATH=$(ventoy_get_udev_conf_path)
|
||||
echo "KERNEL==\"$1\", $VT_UDEV_RULE_PREFIX RUN+=\"$2\"" >> $VT_UDEV_RULE_PATH
|
||||
|
||||
@@ -415,6 +415,9 @@ echo "OS=###${VTOS}###" >>$VTLOG
|
||||
if [ -e "$VTOY_PATH/hook/$VTOS/ventoy-hook.sh" ]; then
|
||||
$BUSYBOX_PATH/sh "$VTOY_PATH/hook/$VTOS/ventoy-hook.sh"
|
||||
fi
|
||||
if [ -e "$VTOY_PATH/hook/$VTOS/ventoy-uauto-hook.sh" ]; then
|
||||
$BUSYBOX_PATH/sh "$VTOY_PATH/hook/$VTOS/ventoy-uauto-hook.sh"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@ if dmsetup -h > /dev/null 2>&1; then
|
||||
for t in *; do
|
||||
if grep -q "^${VPART_MAJOR_MINOR}$" $t/dev; then
|
||||
VPART=$t
|
||||
echo 0 $(cat /sys/class/block/$VPART/size) linear /dev/$VPART 0 | dmsetup create $VPART
|
||||
dmsetup mknodes "$VPART" > /dev/null 2>&1
|
||||
echo 0 $(cat /sys/class/block/$VPART/size) linear /dev/$VPART 0 | dmsetup create VentoyPart
|
||||
dmsetup mknodes "VentoyPart" > /dev/null 2>&1
|
||||
break
|
||||
fi
|
||||
done
|
||||
@@ -30,7 +30,7 @@ if dmsetup -h > /dev/null 2>&1; then
|
||||
udevadm trigger --type=devices --action=add > /dev/null 2>&1
|
||||
udevadm settle > /dev/null 2>&1
|
||||
fi
|
||||
echo "Create /dev/mapper/$VPART success"
|
||||
echo "Create /dev/mapper/VentoyPart success"
|
||||
fi
|
||||
else
|
||||
echo "dmsetup program not avaliable"
|
||||
|
||||
Reference in New Issue
Block a user