diff options
author | Maxim Uvarov <maxim.uvarov@linaro.org> | 2019-08-09 14:48:20 +0300 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2019-08-09 15:04:02 +0300 |
commit | 44363f9532fbd48e44692056e6992ba8c9a38a4e (patch) | |
tree | a3df5490ef138f52f77bca7cfad50b95bd6559be /ledge-debian | |
parent | dddf8ffb3004f956e1ba868e338d82f3d8956b00 (diff) |
ledge-debian/builders-fai.sh: fix loop device find
Between searching for empty loop device and attaching
to it might be someother mounts. Do this atomically.
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Change-Id: I84814dae74a320d56ac7156d2d5d9cccedd784ed
Diffstat (limited to 'ledge-debian')
-rw-r--r-- | ledge-debian/builders-fai.sh | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/ledge-debian/builders-fai.sh b/ledge-debian/builders-fai.sh index 56a475c5..165194fb 100644 --- a/ledge-debian/builders-fai.sh +++ b/ledge-debian/builders-fai.sh @@ -70,10 +70,9 @@ for rootfs in ${ROOTFS}; do exit 1 fi - LOOPDEV=$(sudo losetup --find) # create rootfs # TODO add kernel from OE builds + EFI directory structure - sudo losetup -P "$LOOPDEV" "$BUILDDIR"/work.raw + LOOPDEV=$(sudo losetup -f -P --show ${BUILDDIR}/work.raw) # rootfs is on the last partition. This might need to change depending on # our build procedure in the future device="$LOOPDEV"'p2' |