Skip to content

Commit 7c48f20

Browse files
committed
Fix error with not enough loopback devices #46
1 parent 1519e8e commit 7c48f20

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/common.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,10 @@ function mount_image() {
155155
# mount root and boot partition
156156

157157
detach_all_loopback $image_path
158+
sudo losetup -f
158159
sudo mount -o loop,offset=$root_offset $image_path $mount_path/
159160
if [[ "$boot_partition" != "$root_partition" ]]; then
161+
sudo losetup -f
160162
sudo mount -o loop,offset=$boot_offset,sizelimit=$( expr $root_offset - $boot_offset ) $image_path $mount_path/boot
161163
fi
162164
sudo mkdir -p $mount_path/dev/pts

0 commit comments

Comments
 (0)