aboutsummaryrefslogtreecommitdiff
path: root/ledge-debian
diff options
context:
space:
mode:
authorIlias Apalodimas <ilias.apalodimas@linaro.org>2019-08-06 18:06:43 +0300
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2019-08-06 16:40:44 +0000
commit7a5f93a5ca53a1a80181d4e81fc8628793a6ce62 (patch)
tree7a38e05814a9673f209a16fe3823bd496b2b4f1d /ledge-debian
parentc0405d941ec124d8f1d52f639566d1eab969b38d (diff)
ledge: debian: only create rootfs on output image
Only create rootfs context on the output dir and strip out boot related files since we'll provide them via OE. Fix the kpartx script that was running in a loop mapping and dd'ing data before mounting them. Just mount and tar the partition we need directly Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Change-Id: I8defbada4e4f69bdea7e61a57d752b2d085b3ab4
Diffstat (limited to 'ledge-debian')
-rw-r--r--ledge-debian/builders-fai.sh31
1 files changed, 13 insertions, 18 deletions
diff --git a/ledge-debian/builders-fai.sh b/ledge-debian/builders-fai.sh
index 668b6f4b..41a70ceb 100644
--- a/ledge-debian/builders-fai.sh
+++ b/ledge-debian/builders-fai.sh
@@ -71,25 +71,20 @@ for rootfs in ${ROOTFS}; do
exit 1
fi
- # snatch the rootfs and bootfs for lava
- for device in $(sudo kpartx -avs "$BUILDDIR"/work.raw | cut -d' ' -f3); do
- partition=$(echo ${device} | cut -d'p' -f3)
- sudo dd if=/dev/mapper/${device} of=${BUILDDIR}/partition.raw bs=512
- if [ "${partition}" = "2" ]; then
- sudo mount -o loop "$BUILDDIR"/partition.raw /mnt
- #kvers=$(ls /mnt/boot/vmlinuz-*|sed -e 's,.*vmlinuz-,,'|sort -rV|head -1)
- #cp /mnt/boot/vmlinuz-${kvers} out/vmlinuz
- #cp /mnt/boot/initrd.img-${kvers} out/initrd
- #cp /mnt/usr/lib/linux-image-$kvers/tih410-b2260.dtb out/
- sudo tar caf out/rootfs-${image_name}.tar /mnt
- sudo chroot /mnt dpkg -l > out/${image_name}.packages
- sudo umount -f /mnt
- fi
- sudo rm -f "$BUILDDIR"/partition.raw
- done
+ # 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 mount -o loop /dev/mapper/$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
- cp "$BUILDDIR"/work.raw out/${image_name}.sd
+ # cp "$BUILDDIR"/work.raw out/${image_name}.sd
# Compress image(s)
- pigz -9 out/rootfs-${image_name}.tar out/${image_name}.sd
+ pigz -9 out/rootfs-${image_name}.tar
done