Skip to content

Commit b5a5b14

Browse files
committed
feat: retry losetup
1 parent 9700823 commit b5a5b14

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎image-factory/create_image.sh‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,13 @@ sync
153153

154154
# Setup loop device
155155
if ! LOOPDEV="$(losetup --find --show "${IMAGE}")"; then
156-
raise "Failed to setup loop device. Please try again. Ensure loop module is loaded."
156+
sleep 2
157+
if ! LOOPDEV="$(losetup --find --show "${IMAGE}")"; then
158+
sleep 5
159+
if ! LOOPDEV="$(losetup --find --show "${IMAGE}")"; then
160+
raise "Failed to setup loop device. Are you inside a LXC container? Ensure loop module is loaded."
161+
fi
162+
fi
157163
fi
158164

159165
partprobe "${LOOPDEV}"

0 commit comments

Comments
 (0)