From e38ca400821dce676e97fbfdcb0c6571d7372b99 Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Wed, 5 Apr 2023 12:45:39 -0700 Subject: [PATCH] ci: Make a variable for the repeated rootfs directory name. Part-of: --- .gitlab-ci/container/lava_build.sh | 63 +++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/.gitlab-ci/container/lava_build.sh b/.gitlab-ci/container/lava_build.sh index 1a133a7..f50badb 100755 --- a/.gitlab-ci/container/lava_build.sh +++ b/.gitlab-ci/container/lava_build.sh @@ -143,69 +143,70 @@ if [[ "$DEBIAN_ARCH" = "armhf" ]]; then libxkbcommon-dev:armhf fi -mkdir -p "/lava-files/rootfs-${DEBIAN_ARCH}" +ROOTFS=/lava-files/rootfs-${DEBIAN_ARCH} +mkdir -p $ROOTFS ############### Setuping if [ "$DEBIAN_ARCH" = "amd64" ]; then . .gitlab-ci/container/setup-wine.sh "/dxvk-wine64" . .gitlab-ci/container/install-wine-dxvk.sh - mv /dxvk-wine64 "/lava-files/rootfs-${DEBIAN_ARCH}/" + mv /dxvk-wine64 $ROOTFS fi ############### Installing . .gitlab-ci/container/install-wine-apitrace.sh -mkdir -p "/lava-files/rootfs-${DEBIAN_ARCH}/apitrace-msvc-win64" -mv /apitrace-msvc-win64/bin "/lava-files/rootfs-${DEBIAN_ARCH}/apitrace-msvc-win64" +mkdir -p "$ROOTFS/apitrace-msvc-win64" +mv /apitrace-msvc-win64/bin "$ROOTFS/apitrace-msvc-win64" rm -rf /apitrace-msvc-win64 ############### Building STRIP_CMD="${GCC_ARCH}-strip" -mkdir -p /lava-files/rootfs-${DEBIAN_ARCH}/usr/lib/$GCC_ARCH +mkdir -p $ROOTFS/usr/lib/$GCC_ARCH ############### Build apitrace . .gitlab-ci/container/build-apitrace.sh -mkdir -p /lava-files/rootfs-${DEBIAN_ARCH}/apitrace -mv /apitrace/build /lava-files/rootfs-${DEBIAN_ARCH}/apitrace +mkdir -p $ROOTFS/apitrace +mv /apitrace/build $ROOTFS/apitrace rm -rf /apitrace ############### Build dEQP runner . .gitlab-ci/container/build-deqp-runner.sh -mkdir -p /lava-files/rootfs-${DEBIAN_ARCH}/usr/bin -mv /usr/local/bin/*-runner /lava-files/rootfs-${DEBIAN_ARCH}/usr/bin/. +mkdir -p $ROOTFS/usr/bin +mv /usr/local/bin/*-runner $ROOTFS/usr/bin/. ############### Build dEQP DEQP_TARGET=surfaceless . .gitlab-ci/container/build-deqp.sh -mv /deqp /lava-files/rootfs-${DEBIAN_ARCH}/. +mv /deqp $ROOTFS/. ############### Build SKQP if [[ "$DEBIAN_ARCH" = "arm64" ]] \ || [[ "$DEBIAN_ARCH" = "amd64" ]]; then . .gitlab-ci/container/build-skqp.sh - mv /skqp /lava-files/rootfs-${DEBIAN_ARCH}/. + mv /skqp $ROOTFS/. fi ############### Build piglit PIGLIT_OPTS="-DPIGLIT_BUILD_DMA_BUF_TESTS=ON -DPIGLIT_BUILD_GLX_TESTS=ON" . .gitlab-ci/container/build-piglit.sh -mv /piglit /lava-files/rootfs-${DEBIAN_ARCH}/. +mv /piglit $ROOTFS/. ############### Build libva tests if [[ "$DEBIAN_ARCH" = "amd64" ]]; then . .gitlab-ci/container/build-va-tools.sh - mv /va/bin/* /lava-files/rootfs-${DEBIAN_ARCH}/usr/bin/ + mv /va/bin/* $ROOTFS/usr/bin/ fi ############### Build Crosvm if [[ ${DEBIAN_ARCH} = "amd64" ]]; then . .gitlab-ci/container/build-crosvm.sh - mv /usr/local/bin/crosvm /lava-files/rootfs-${DEBIAN_ARCH}/usr/bin/ - mv /usr/local/lib/$GCC_ARCH/libvirglrenderer.* /lava-files/rootfs-${DEBIAN_ARCH}/usr/lib/$GCC_ARCH/ - mkdir -p /lava-files/rootfs-${DEBIAN_ARCH}/usr/local/libexec/ - mv /usr/local/libexec/virgl* /lava-files/rootfs-${DEBIAN_ARCH}/usr/local/libexec/ + mv /usr/local/bin/crosvm $ROOTFS/usr/bin/ + mv /usr/local/lib/$GCC_ARCH/libvirglrenderer.* $ROOTFS/usr/lib/$GCC_ARCH/ + mkdir -p $ROOTFS/usr/local/libexec/ + mv /usr/local/libexec/virgl* $ROOTFS/usr/local/libexec/ fi ############### Build libdrm @@ -235,20 +236,20 @@ if ! debootstrap \ --arch=${DEBIAN_ARCH} \ --components main,contrib,non-free \ bullseye \ - /lava-files/rootfs-${DEBIAN_ARCH}/ \ + $ROOTFS/ \ http://deb.debian.org/debian; then - cat /lava-files/rootfs-${DEBIAN_ARCH}/debootstrap/debootstrap.log + cat $ROOTFS/debootstrap/debootstrap.log exit 1 fi set -e -cp .gitlab-ci/container/create-rootfs.sh /lava-files/rootfs-${DEBIAN_ARCH}/. -cp .gitlab-ci/container/debian/llvm-snapshot.gpg.key /lava-files/rootfs-${DEBIAN_ARCH}/. -cp .gitlab-ci/container/debian/winehq.gpg.key /lava-files/rootfs-${DEBIAN_ARCH}/. -chroot /lava-files/rootfs-${DEBIAN_ARCH} sh /create-rootfs.sh -rm /lava-files/rootfs-${DEBIAN_ARCH}/{llvm-snapshot,winehq}.gpg.key -rm /lava-files/rootfs-${DEBIAN_ARCH}/create-rootfs.sh -cp /etc/wgetrc /lava-files/rootfs-${DEBIAN_ARCH}/etc/. +cp .gitlab-ci/container/create-rootfs.sh $ROOTFS/. +cp .gitlab-ci/container/debian/llvm-snapshot.gpg.key $ROOTFS/. +cp .gitlab-ci/container/debian/winehq.gpg.key $ROOTFS/. +chroot $ROOTFS sh /create-rootfs.sh +rm $ROOTFS/{llvm-snapshot,winehq}.gpg.key +rm $ROOTFS/create-rootfs.sh +cp /etc/wgetrc $ROOTFS/etc/. ############### Install the built libdrm @@ -256,9 +257,9 @@ cp /etc/wgetrc /lava-files/rootfs-${DEBIAN_ARCH}/etc/. # the built libdrm. Hence, we add it after the rootfs has been already # created. find /libdrm/ -name lib\*\.so\* \ - -exec cp -t /lava-files/rootfs-${DEBIAN_ARCH}/usr/lib/$GCC_ARCH/. {} \; -mkdir -p /lava-files/rootfs-${DEBIAN_ARCH}/libdrm/ -cp -Rp /libdrm/share /lava-files/rootfs-${DEBIAN_ARCH}/libdrm/share + -exec cp -t $ROOTFS/usr/lib/$GCC_ARCH/. {} \; +mkdir -p $ROOTFS/libdrm/ +cp -Rp /libdrm/share $ROOTFS/libdrm/share rm -rf /libdrm @@ -268,8 +269,8 @@ if [ ${DEBIAN_ARCH} = arm64 ]; then KERNEL_IMAGE_NAME+=" Image.gz" fi -du -ah /lava-files/rootfs-${DEBIAN_ARCH} | sort -h | tail -100 -pushd /lava-files/rootfs-${DEBIAN_ARCH} +du -ah $ROOTFS | sort -h | tail -100 +pushd $ROOTFS tar --zstd -cf /lava-files/lava-rootfs.tar.zst . popd -- 2.7.4