X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/Ventoy.git/blobdiff_plain/21735f92d60f4432b1de743be6a3adb4e8628726..bd8aebf166bd9a7a5f2fc0f54baf2aff3bea74cd:/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