X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/Ventoy.git/blobdiff_plain/05a1b863a66bf72b26e5d87570c4e0e61b9736cd..ac0f68f90b99150296e58b27fd335d21b47d32ae:/INSTALL/tool/ventoy_lib.sh diff --git a/INSTALL/tool/ventoy_lib.sh b/INSTALL/tool/ventoy_lib.sh index 3562927..37e6fb7 100644 --- a/INSTALL/tool/ventoy_lib.sh +++ b/INSTALL/tool/ventoy_lib.sh @@ -14,16 +14,6 @@ ventoy_true() { } ventoy_is_linux64() { - if [ -e /lib64 ]; then - ventoy_true - return - fi - - if [ -e /usr/lib64 ]; then - ventoy_true - return - fi - if uname -a | egrep -q 'x86_64|amd64'; then ventoy_true return @@ -165,12 +155,12 @@ is_disk_contains_ventoy() { return fi - PART1_TYPE=$(dd if=$DISK bs=1 count=1 skip=450 status=none | ./tool/hexdump -n1 -e '1/1 "%02X"') - if [ "$PART1_TYPE" != "07" ]; then - vtdebug "part1 type is $PART2_TYPE not 07" - ventoy_false - return - fi + # PART1_TYPE=$(dd if=$DISK bs=1 count=1 skip=450 status=none | ./tool/hexdump -n1 -e '1/1 "%02X"') + # if [ "$PART1_TYPE" != "07" ]; then + # vtdebug "part1 type is $PART2_TYPE not 07" + # ventoy_false + # return + # fi if [ -e /sys/class/block/${PART1#/dev/}/start ]; then PART1_START=$(cat /sys/class/block/${PART1#/dev/}/start) @@ -265,12 +255,21 @@ EOF partprobe >/dev/null 2>&1 sleep 3 - echo 'mkfs on disk partitions ...' - while ! [ -e $PART2 ]; do - echo "wait $PART2 ..." - sleep 1 + for i in 1 2 3 4 5 6 7; do + if [ -b $PART2 ]; then + break + else + echo "wait $PART2 ..." + sleep 1 + fi done + + if ! [ -b $PART2 ]; then + MajorMinor=$(sed "s/:/ /" /sys/class/block/${PART2#/dev/}/dev) + echo "mknod -m 0660 $PART2 b $MajorMinor ..." + mknod -m 0660 $PART2 b $MajorMinor + fi echo "create efi fat fs ..." for i in 0 1 2 3 4 5 6 7 8 9; do