@@ -237,8 +237,8 @@ if [[ "$firmware" == "uefi" ]]; then
237
237
if [[ " $virtual " == " true" ]]; then umount_vpart; fi
238
238
exit 1
239
239
fi
240
- efifstype=$( lsblk -o path,fstype | grep " $efipart " | awk ' {print $2}' )
241
- syspath=$( lsblk -o path,mountpoint | grep " $efipart " | awk -v n=2 ' { for (i=n; i<=NF; i++) printf "%s%s", $i, (i<NF ? OFS : ORS)}' )
240
+ efifstype=$( lsblk -o path,fstype | grep " $efipart " | awk ' {print $2}' | uniq )
241
+ syspath=$( lsblk -o path,mountpoint | grep " $efipart " | awk -v n=2 ' { for (i=n; i<=NF; i++) printf "%s%s", $i, (i<NF ? OFS : ORS)}' | uniq )
242
242
if [[ -z " ${syspath// } " ]]; then
243
243
rmsysmnt=" true"
244
244
syspath=" /mnt/EFI"
@@ -285,8 +285,8 @@ elif [[ "$firmware" == "bios" || "$firmware" == "both" ]]; then
285
285
if [[ " $virtual " == " true" ]]; then umount_vpart; fi
286
286
exit 1
287
287
fi
288
- sysfstype=$( lsblk -o path,fstype | grep " $syspart " | awk ' {print $2}' )
289
- syspath=$( lsblk -o path,mountpoint | grep " $syspart " | awk -v n=2 ' { for (i=n; i<=NF; i++) printf "%s%s", $i, (i<NF ? OFS : ORS)}' )
288
+ sysfstype=$( lsblk -o path,fstype | grep " $syspart " | awk ' {print $2}' | uniq )
289
+ syspath=$( lsblk -o path,mountpoint | grep " $syspart " | awk -v n=2 ' { for (i=n; i<=NF; i++) printf "%s%s", $i, (i<NF ? OFS : ORS)}' | uniq )
290
290
if [[ -z " ${syspath// } " ]]; then
291
291
rmsysmnt=" true"
292
292
syspath=" /mnt/winsys"
@@ -317,10 +317,10 @@ if [[ "$firmware" == "uefi" ]]; then
317
317
if [[ " $virtual " == " false" || " $verbose " == " true" ]]; then
318
318
echo " Get block device for mount point (sudo required later)..."
319
319
fi
320
- efipart=$( lsblk -o path,mountpoint | grep " $syspath " | awk ' {print $1}' )
321
- efifstype=$( lsblk -o path,fstype | grep " $efipart " | awk ' {print $2}' )
320
+ efipart=$( lsblk -o path,mountpoint | grep " $syspath " | awk ' {print $1}' | uniq )
321
+ efifstype=$( lsblk -o path,fstype | grep " $efipart " | awk ' {print $2}' | uniq )
322
322
elif [[ " $firmware " == " bios" || " $firmware " == " both" ]]; then
323
- syspart=$( lsblk -o path,mountpoint | grep " $syspath " | awk ' {print $1}' )
323
+ syspart=$( lsblk -o path,mountpoint | grep " $syspath " | awk ' {print $1}' | uniq )
324
324
sysdisk=$( printf " $syspart " | sed ' s/[0-9]\+$//;s/p\+$//' )
325
325
if [[ " $virtual " == " false" || " $verbose " == " true" ]]; then
326
326
echo " Checking block device for active partition (sudo required)..."
@@ -349,7 +349,7 @@ elif [[ "$firmware" == "bios" || "$firmware" == "both" ]]; then
349
349
if [[ " $virtual " == " true" ]]; then umount_vpart; fi
350
350
exit 1
351
351
fi
352
- sysfstype=$( lsblk -o path,fstype | grep " $syspart " | awk ' {print $2}' )
352
+ sysfstype=$( lsblk -o path,fstype | grep " $syspart " | awk ' {print $2}' | uniq )
353
353
if [[ " $firmware " == " both" ]]; then
354
354
efipart=" $syspart "
355
355
efifstype=" $sysfstype "
@@ -383,7 +383,7 @@ mount_vpart () {
383
383
vrtpath=" /mnt/virtwin"
384
384
echo " Partition table on: $imgpath "
385
385
echo
386
- lsblk " $vrtdisk " -o path,pttype,fstype,parttypename,label,mountpoint | sed ' 2d'
386
+ lsblk " $vrtdisk " -o path,pttype,fstype,parttypename,label,mountpoint | sed ' 2d' | uniq
387
387
echo
388
388
read -p " Enter device containing the Windows volume [nbd#p#]:" vtwinpart
389
389
while [[ " $vtwinpart " != * " nbd" * || ! -e " /dev/$vtwinpart " ]]; do
526
526
# Check source for path to the WBM files then get the block device.
527
527
# Get the mount point, file path and block device that contains the virtual disk file.
528
528
if [[ -d " $winpath /Windows/Boot" ]]; then
529
- windisk=$( lsblk -o path,mountpoint | grep " $winpath " | awk ' {print $1}' | sed ' s/[0-9]\+$//;s/p\+$//' )
529
+ windisk=$( lsblk -o path,mountpoint | grep " $winpath " | awk ' {print $1}' | sed ' s/[0-9]\+$//;s/p\+$//' | uniq )
530
530
elif [[ " $virtual " == " true" && -d " $vrtpath /Windows/Boot" ]]; then
531
531
if [[ " $winpath " == * " /mnt" * ]]; then winpath=$( echo " $winpath " | cut -d/ -f1-3) ; fi
532
532
if [[ " $winpath " == * " /media" * ]]; then winpath=$( echo " $winpath " | cut -d/ -f1-4) ; fi
533
- windisk=$( lsblk -o path,mountpoint | grep " $winpath " | awk ' {print $1}' | sed ' s/[0-9]\+$//;s/p\+$//' )
533
+ windisk=$( lsblk -o path,mountpoint | grep " $winpath " | awk ' {print $1}' | sed ' s/[0-9]\+$//;s/p\+$//' | uniq )
534
534
if [[ " $imgpath " == * " /mnt" * ]]; then imgstring=$( echo " $imgpath " | cut -d/ -f4- | sed ' s/^/\\/;s/\//\\/g' ) ; fi
535
535
if [[ " $imgpath " == * " /media" * ]]; then imgstring=$( echo " $imgpath " | cut -d/ -f5- | sed ' s/^/\\/;s/\//\\/g' ) ; fi
536
536
else
0 commit comments