Skip to content

Commit

Permalink
Update build-image.sh for dynamic loopback
Browse files Browse the repository at this point in the history
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
  • Loading branch information
lkundrak committed Feb 6, 2014
1 parent 0a5fa6a commit 6c9ef41
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ if [ "$(id -u)" != 0 ]; then
exit 1
fi

LOOP=loop5
IMG_IN="$1"
IMG_OUT="$2"
UBOOT="$(pwd)/uboot"
Expand All @@ -39,7 +38,8 @@ if [ -z "$NOCOPY" ]; then
fi

echo "Setting up loopback mount of $IMG_OUT and its partitions"
losetup "/dev/$LOOP" "$IMG_OUT"
losetup -f "$IMG_OUT"
LOOP="$(losetup -j "$IMG_OUT" |sed 's/:.*//;s,.*/,,' |tail -1)"
kpartx -a "/dev/$LOOP"
udevadm settle
e2label "/dev/mapper/${LOOP}p1" uboot
Expand Down

0 comments on commit 6c9ef41

Please sign in to comment.