diff options
author | Ilias Apalodimas <ilias.apalodimas@linaro.org> | 2019-08-07 15:52:59 +0300 |
---|---|---|
committer | Ilias Apalodimas <ilias.apalodimas@linaro.org> | 2019-08-07 12:58:55 +0000 |
commit | a297542e9af6c16157417c78269f414e87e6e2b7 (patch) | |
tree | e5644e5d6ffea067e809bd2a70b960022e03c098 /ledge-debian | |
parent | 5d92c38add4b1218748d912e18cbb77283b2a520 (diff) |
ledge: debian: replace kpartx with losetup
kpartx was causing issues on the host leaving stale loop device files
on random occasions. Replace is with losetup
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Change-Id: I4d232f46b8a8185c23398ae01bf3d88f886249ec
Diffstat (limited to 'ledge-debian')
-rw-r--r-- | ledge-debian/builders-fai.sh | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/ledge-debian/builders-fai.sh b/ledge-debian/builders-fai.sh index 891e7ec7..3e3bcac8 100644 --- a/ledge-debian/builders-fai.sh +++ b/ledge-debian/builders-fai.sh @@ -4,12 +4,12 @@ set -ex trap cleanup_exit INT TERM EXIT BUILDDIR='/tmp' +LOOPDEV='loop0' cleanup_exit() { cd ${WORKSPACE} - sudo kpartx -dv "$BUILDDIR"/work.raw || true - sudo umount -f "$BUILDDIR"||true + sudo umount -f "$BUILDDIR" || true } if ! sudo DEBIAN_FRONTEND=noninteractive apt-get -q=2 update; then @@ -44,7 +44,7 @@ EOF # speed up FAI test -d "$BUILDDIR" || mkdir "$BUILDDIR" -sudo mount -t tmpfs -o size=6G tmpfs "$BUILDDIR" +sudo mount -t tmpfs tmpfs "$BUILDDIR" sudo cp tools/udevadm /sbin @@ -73,16 +73,17 @@ for rootfs in ${ROOTFS}; do # create rootfs # TODO add kernel from OE builds + EFI directory structure - sudo kpartx -as "$BUILDDIR"/work.raw - # rootfs is on the last partition - device=$(sudo kpartx -l $BUILDDIR/work.raw | cut -d : -f1 | tail -n1) + sudo losetup -P /dev/"$LOOPDEV" + # rootfs is on the last partition. This might need to change depending on + # our build procedure in the future + device="$LOOPDEV"'p2' - sudo mount -o loop /dev/mapper/$device /mnt/ + sudo mount -o loop /dev/"$device" /mnt/ sudo tar caf out/rootfs-${image_name}.tar /mnt sudo chroot /mnt dpkg -l > out/${image_name}.packages sudo umount -f /mnt - sudo kpartx -dv "$BUILDDIR"/work.raw + sudo losetup -d /dev/"$LOOPDEV" # cp "$BUILDDIR"/work.raw out/${image_name}.sd # Compress image(s) |