File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed
Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ if [ " $( id -u) " -ne 0 ]; then
4+ echo " Please run with sudo ..."
5+ exit 1
6+ fi
7+
8+ oldpwd=$( pwd)
9+ VPART=" "
10+
11+ if dmsetup -h > /dev/null 2>&1 ; then
12+ VPART_MAJOR_MINOR=$( dmsetup table ventoy | head -n 1 | awk ' {print $4}' )
13+ cd /sys/class/block/
14+ for t in * ; do
15+ if grep -q " ^${VPART_MAJOR_MINOR} $" $t /dev; then
16+ VPART=$t
17+ echo 0 $( cat /sys/class/block/$VPART /size) linear /dev/$VPART 0 | dmsetup create $VPART
18+ dmsetup mknodes " $VPART " > /dev/null 2>&1
19+ break
20+ fi
21+ done
22+ cd $oldpwd
23+
24+ if [ -z " $VPART " ]; then
25+ echo " $VPART_MAJOR_MINOR not found"
26+ dmsetup ls; dmsetup info ventoy; dmsetup table ventoy
27+ exit 1
28+ else
29+ if [ ! -b " /dev/mapper/$VPART " ]; then
30+ udevadm trigger --type=devices --action=add > /dev/null 2>&1
31+ udevadm settle > /dev/null 2>&1
32+ fi
33+ echo " Create /dev/mapper/$VPART success"
34+ fi
35+ else
36+ echo " dmsetup program not avaliable"
37+ exit 1
38+ fi
Original file line number Diff line number Diff line change @@ -126,6 +126,7 @@ mkdir -p $tmpmnt/tool
126126dd status=none bs=1024 count=16 if=./tool/i386/vtoycli of=$tmpmnt /tool/mount.exfat-fuse_i386
127127dd status=none bs=1024 count=16 if=./tool/x86_64/vtoycli of=$tmpmnt /tool/mount.exfat-fuse_x86_64
128128dd status=none bs=1024 count=16 if=./tool/aarch64/vtoycli of=$tmpmnt /tool/mount.exfat-fuse_aarch64
129+ cp -a ./tool/create_ventoy_iso_part_dm.sh $tmpmnt /tool/
129130
130131
131132rm -f $tmpmnt /grub/i386-pc/* .img
You can’t perform that action at this time.
0 commit comments