X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/Ventoy.git/blobdiff_plain/9a8d4d0227f2ac11ca5bd7c826c1d9761d0f5bd5..fa7e1d5fa0007e5d1d634cc4e41fdfd3aa381a8e:/IMG/cpio/ventoy/hook/arch/ventoy-disk.sh diff --git a/IMG/cpio/ventoy/hook/arch/ventoy-disk.sh b/IMG/cpio/ventoy/hook/arch/ventoy-disk.sh index c176537..31e65f0 100644 --- a/IMG/cpio/ventoy/hook/arch/ventoy-disk.sh +++ b/IMG/cpio/ventoy/hook/arch/ventoy-disk.sh @@ -49,7 +49,12 @@ done if [ -n "$1" ]; then vtlog "ln -s /dev/$vtDM $1" - ln -s /dev/$vtDM "$1" + + if [ -e "$1" ]; then + vtlog "$1 already exist" + else + ln -s /dev/$vtDM "$1" + fi else vtLABEL=$($BUSYBOX_PATH/blkid /dev/$vtDM | $SED 's/.*LABEL="\([^"]*\)".*/\1/') vtlog "vtLABEL is $vtLABEL" @@ -59,7 +64,11 @@ else vtlog "vtLABEL is $vtLABEL from cmdline" fi - ln -s /dev/$vtDM "/dev/disk/by-label/$vtLABEL" + if [ -e "/dev/disk/by-label/$vtLABEL" ]; then + vtlog "$1 already exist" + else + ln -s /dev/$vtDM "/dev/disk/by-label/$vtLABEL" + fi fi # OK finish