aboutsummaryrefslogtreecommitdiff
path: root/lt-qcom-debian-images/builders-fai.sh
diff options
context:
space:
mode:
authorNicolas Dechesne <nicolas.dechesne@linaro.org>2018-09-13 09:04:32 +0200
committerFathi Boudra <fathi.boudra@linaro.org>2018-09-13 07:09:33 +0000
commit88b43642043cce07af76931a2541391fd7104a13 (patch)
treedfda2926a83be01c638b2c1f940b0736b77f5eab /lt-qcom-debian-images/builders-fai.sh
parentc7627a8656d1be9c0458291efcf1e9a8978b62e3 (diff)
lt-qcom-debian-images: avoid using /tmp as tmpfs
we remount /tmp as tmpfs to speed up FAI execution time, however hijacking /tmp is breaking things, at least it breaks ssh-agent, which prevents the script from doing any authenticated git access. Change-Id: If0a511c62291ab4197c983a0363ad614785791dd Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Diffstat (limited to 'lt-qcom-debian-images/builders-fai.sh')
-rw-r--r--lt-qcom-debian-images/builders-fai.sh20
1 files changed, 15 insertions, 5 deletions
diff --git a/lt-qcom-debian-images/builders-fai.sh b/lt-qcom-debian-images/builders-fai.sh
index 88d62a5995..a0f506adb0 100644
--- a/lt-qcom-debian-images/builders-fai.sh
+++ b/lt-qcom-debian-images/builders-fai.sh
@@ -2,6 +2,14 @@
set -e
+trap cleanup_exit INT TERM EXIT
+
+cleanup_exit()
+{
+ echo "INFO: umount ${WORKSPACE}/builddir"
+ sudo umount ${WORKSPACE}/builddir
+}
+
if ! sudo DEBIAN_FRONTEND=noninteractive apt-get -q=2 update; then
echo "INFO: apt update error - try again in a moment"
sleep 15
@@ -42,7 +50,9 @@ Build description:
* FAI commit: "$GIT_COMMIT":$GIT_URL/commit/?id=$GIT_COMMIT
EOF
-sudo mount -t tmpfs tmpfs /tmp
+# speed up FAI
+test -d builddir || mkdir builddir
+sudo mount -t tmpfs -o size=6G tmpfs builddir
# dumb utility to parse dpkg -l output
wget https://git.linaro.org/ci/job/configs.git/blob_plain/HEAD:/lt-qcom-debian-images/debpkgdiff.py
@@ -59,7 +69,7 @@ for rootfs in ${ROOTFS}; do
--hostname linaro-${rootfs} \
-S ${rootfs_sz} \
--class $(echo SAVECACHE,${OS_FLAVOUR},DEBIAN,LINARO,QCOM,${rootfs},${FAI_BOARD_CLASS},RAW | tr '[:lower:]' '[:upper:]') \
- /tmp/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${BUILD_NUMBER}.img.raw
+ builddir/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${BUILD_NUMBER}.img.raw
sudo cp /var/log/fai/linaro-${rootfs}/last/fai.log fai-${rootfs}.log
if grep -E '^(ERROR:|WARNING: These unknown packages are removed from the installation list|Exit code task_)' fai-${rootfs}.log
@@ -69,7 +79,7 @@ for rootfs in ${ROOTFS}; do
exit 1
fi
- rootfs_sz_real=$(du -h /tmp/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${BUILD_NUMBER}.img.raw | cut -f1)
+ rootfs_sz_real=$(du -h builddir/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${BUILD_NUMBER}.img.raw | cut -f1)
# make sure that there are the same for all images, in case we build more than 1 image
if [ -f MD5SUM ]; then
@@ -78,8 +88,8 @@ for rootfs in ${ROOTFS}; do
md5sum out/{vmlinuz-*,config-*,$(basename ${DTBS})} > MD5SUM
fi
- img2simg /tmp/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${BUILD_NUMBER}.img.raw out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${BUILD_NUMBER}.img
- sudo rm -f /tmp/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${BUILD_NUMBER}.img.raw
+ img2simg builddir/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${BUILD_NUMBER}.img.raw out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${BUILD_NUMBER}.img
+ sudo rm -f builddir/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${BUILD_NUMBER}.img.raw
# Compress image(s)
pigz -9 out/${VENDOR}-${OS_FLAVOUR}-${rootfs}-${PLATFORM_NAME}-${BUILD_NUMBER}.img