Permalink
Browse files

kpartx synchronouly unmaps partitions

  • Loading branch information...
1 parent c5c435d commit 7ef64ff5009203cd28efb30b183cc98d41493f2c @oppegard oppegard committed with Gary Liu Apr 4, 2013
@@ -10,7 +10,7 @@ source $base_dir/lib/prelude_apply.bash
disk_image_name=root.img
# unmap the loop device in case it's already mapped
-kpartx -dv $work/$disk_image_name
+kpartx -dvs $work/$disk_image_name
# Map partition in image to loopback
dev=$(kpartx -avs $work/$disk_image_name | grep "^add" | cut -d" " -f3)
@@ -31,4 +31,4 @@ rm -f $mnt/boot/grub/menu.lst~
umount $mnt
# Unmap partition
-kpartx -dv $work/$disk_image_name
+kpartx -dvs $work/$disk_image_name
@@ -20,7 +20,7 @@ parted --script $work/$disk_image_name mklabel msdos
parted --script $work/$disk_image_name mkpart primary ext2 $part_offset $part_size
# unmap the loop device in case it's already mapped
-kpartx -dv $work/$disk_image_name
+kpartx -dvs $work/$disk_image_name
# Map partition in image to loopback
dev=$(kpartx -avs $work/$disk_image_name | grep "^add" | cut -d" " -f3)
@@ -53,4 +53,4 @@ fi
# Unmap partition
echo "Removing device mappings for $disk_image_name"
-kpartx -dv $work/$disk_image_name
+kpartx -dvs $work/$disk_image_name
@@ -10,7 +10,7 @@ source $base_dir/lib/prelude_apply.bash
disk_image_name=root.img
# unmap the loop device in case it's already mapped
-kpartx -dv $work/$disk_image_name
+kpartx -dvs $work/$disk_image_name
# Map partition in image to loopback
dev=$(kpartx -avs $work/$disk_image_name | grep "^add" | cut -d" " -f3)
@@ -65,4 +65,4 @@ rm -rf $mnt/tmp/grub
umount $mnt
# Unmap partition
-kpartx -dv $work/$disk_image_name
+kpartx -dvs $work/$disk_image_name
@@ -10,7 +10,7 @@ source $base_dir/lib/prelude_apply.bash
disk_image_name=root.img
# unmap the loop device in case it's already mapped
-kpartx -dv $work/$disk_image_name
+kpartx -dvs $work/$disk_image_name
# Map partition in image to loopback
dev=$(kpartx -avs $work/$disk_image_name | grep "^add" | cut -d" " -f3)
@@ -31,4 +31,4 @@ rm -f $mnt/boot/grub/menu.lst~
umount $mnt
# Unmap partition
-kpartx -dv $work/$disk_image_name
+kpartx -dvs $work/$disk_image_name

0 comments on commit 7ef64ff

Please sign in to comment.