Skip to contentSkip to conversation

Travis fixes

PATCH Superseded Alexander Graf 1 participant 8 messages Apr 27, 2019

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover Travis fixes

This patch set collects a few fixes for Travis CI since the initial commit was applied:

- catch up with the tree
- fix targets that need a board specified
- make mkimage loop more robust
- add QEMU tests for ARM and AArch64 EFI targets

That way we should hopefully catch even more problems going forward.

Alexander Graf (6):
travis: Run bootstrap instead of autogen.sh
travis: Fix sparc64 test
travis: Fix mips QEMU target
travis: Fix arm coreboot test and make loop more robus arm coreboot: Use common directory path
travis: Add smoke tests for arm and aarch64

 .travis.yml    | 22 +++++++++++++++-------
 util/mkimage.c |  4 ++--
 2 files changed, 17 insertions(+), 9 deletions(-)
Signature · 1 line
2.16.4
#1 lore raw

PATCH 1/6 travis: Run bootstrap instead of autogen.sh

Commit 35b909062e7b3 ("gnulib: Upgrade Gnulib and switch to bootstrap tool") changed the build flow from running ./autogen.sh to running ./bootstrap but missed to update .travis.yml. Adapt it accordingly.

Fixes 35b909062e7b3 ("gnulib: Upgrade Gnulib and switch to bootstrap tool")
---
 .travis.yml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
.travis.yml +2 -1
index 81de20fa3..6184a373f 100644
@@ -18,6 +18,7 @@ addons:
     - python
     - qemu-system
     - unifont
+    - gnulib
 
 env:
   global:
@@ -35,7 +36,7 @@ before_script:
 script:
   # Comments must be outside the command strings below, or the Travis parser
   # will get confused.
-  - ./autogen.sh
+  - ./bootstrap
 
   # Build all selected GRUB targets.
   - for target in $GRUB_TARGETS; do
Signature · 1 line
2.16.4
#2 lore raw

PATCH 2/6 travis: Fix sparc64 test

In reply to Alexander Graf

For sparc64, we were not selecting the correct mkimage output type. Just pick aout at random. Also, make sure the rest of the variable logic can deal with the 3rd element.

---
 .travis.yml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
.travis.yml +3 -2
index 6184a373f..c3e6513f2 100644
@@ -41,7 +41,8 @@ script:
   # Build all selected GRUB targets.
   - for target in $GRUB_TARGETS; do
       plat=${target#*-};
-      arch=${target%-*};
+      plat=${plat%-*};
+      arch=${target%%-*};
       [ "$arch" = "arm64" ] && arch=aarch64-linux;
       [ "$arch" = "arm" ] && arch=arm-linux-gnueabi;
       [ "$arch" = "ia64" ] && arch=ia64-linux;
@@ -81,7 +82,7 @@ matrix:
         - CROSS_TARGETS="powerpc64-linux"
     - name: "sparc64"
       env:
-        - GRUB_TARGETS="sparc64-ieee1275"
+        - GRUB_TARGETS="sparc64-ieee1275-aout"
         - CROSS_TARGETS="sparc64-linux"
     - name: "ia64"
       env:
Signature · 1 line
2.16.4
#3 lore raw

PATCH 5/5 travis: Add smoke tests for arm and aarch64

In reply to Alexander Graf

We've had an arm regression in grub recently where grub would not even be able to boot up anymore. So let's include arm and aarch64 in our simple "hello world" smoke tests as well.

For OVMF on ARM to work, we need a newer version of QEMU, add a PPA dependency for it.

---
 .travis.yml | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
.travis.yml +7 -1
index bce1c6daf..d089383c4 100644
@@ -11,6 +11,8 @@ language: c
 
 addons:
   apt:
+    sources:
+    - sourceline: 'ppa:jacob/virtualisation'
     packages:
     - libsdl1.2-dev
     - lzop
@@ -32,6 +34,8 @@ before_script:
   - for i in $CROSS_TARGETS; do
         ( cd /tmp/cross; wget -t 3 -O - https://mirrors.kernel.org/pub/tools/crosstool/files/bin/x86_64/8.1.0/x86_64-gcc-8.1.0-nolibc-$i.tar.xz | tar xJ );
     done
+  - if [[ "$GRUB_TARGETS" == *"arm64-efi"* ]]; then wget http://snapshots.linaro.org/components/kernel/leg-virt-tianocore-edk2-upstream/3525/QEMU-AARCH64/RELEASE_GCC5/QEMU_EFI.fd -O QEMU_EFI.aarch64.fd; fi
+  - if [[ "$GRUB_TARGETS" == *"arm-efi"* ]]; then wget http://snapshots.linaro.org/components/kernel/leg-virt-tianocore-edk2-upstream/3525/QEMU-ARM/RELEASE_GCC5/QEMU_EFI.fd -O QEMU_EFI.arm.fd; fi
 
 script:
   # Comments must be outside the command strings below, or the Travis parser
@@ -65,7 +69,9 @@ script:
   - for target in $GRUB_TARGETS; do grub-mkimage -c grub.cfg -p / -O $target -o grub-$target echo reboot normal || break; done
 
   # Run images we know how to run.
-  - if [[ "$GRUB_TARGETS" == *"x86_64-efi"* ]]; then qemu-system-x86_64 -bios /usr/share/ovmf/OVMF.fd -m 512 -no-reboot -nographic -net nic -net user,tftp=.,bootfile=grub-x86_64-efi | tee grub.log && grep "hello world" grub.log; fi
+  - if [[ "$GRUB_TARGETS" == *"x86_64-efi"* ]]; then qemu-system-x86_64                          -bios /usr/share/ovmf/OVMF.fd -m 512 -no-reboot -nographic -net nic -net user,tftp=.,bootfile=grub-x86_64-efi | tee grub.log && grep "hello world" grub.log; fi
+  - if [[ "$GRUB_TARGETS" == *"arm64-efi"* ]];  then qemu-system-aarch64 -M virt -cpu cortex-a57 -bios QEMU_EFI.aarch64.fd     -m 512 -no-reboot -nographic -net nic -net user,tftp=.,bootfile=grub-arm64-efi  | tee grub.log && grep "hello world" grub.log; fi
+  - if [[ "$GRUB_TARGETS" == *"arm-efi"* ]];    then qemu-system-arm     -M virt -cpu cortex-a15 -bios QEMU_EFI.arm.fd         -m 512 -no-reboot -nographic -net nic -net user,tftp=.,bootfile=grub-arm-efi    | tee grub.log && grep "hello world" grub.log; fi
 
 matrix:
   include:
Signature · 1 line
2.16.4
#4 lore raw

PATCH 3/6 travis: Fix mips QEMU target

In reply to Alexander Graf

The MIPS QEMU targets can be built as either elf binary or flash image. Build one each for BE/LE and make sure we pass the correct one into mkimage.

---
 .travis.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
.travis.yml +1 -1
index c3e6513f2..570181e81 100644
@@ -90,7 +90,7 @@ matrix:
         - CROSS_TARGETS="ia64-linux"
     - name: "mips"
       env:
-        - GRUB_TARGETS="mips-arc mipsel-arc mipsel-qemu_mips mips-qemu_mips"
+        - GRUB_TARGETS="mips-arc mipsel-arc mipsel-qemu_mips-elf mips-qemu_mips-flash"
         - CROSS_TARGETS="mips64-linux"
     - name: "arm"
       env:
Signature · 1 line
2.16.4
#5 lore raw

PATCH 4/6 travis: Fix arm coreboot test and make loop more robus

In reply to Alexander Graf

We missed the fact that the coreboot target did not succeed on mkimage. Properly abort the loop if we see a failure and fix the coreboot target to also indicate the board target.

---
 .travis.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
.travis.yml +2 -2
index 570181e81..29013bb9b 100644
@@ -62,7 +62,7 @@ script:
   - echo -e "insmod echo\\ninsmod reboot\\necho hello world\\nreboot" > grub.cfg
 
   # Assemble images and possibly run them.
-  - for target in $GRUB_TARGETS; do grub-mkimage -c grub.cfg -p / -O $target -o grub-$target echo reboot normal; done
+  - ( for target in $GRUB_TARGETS; do grub-mkimage -c grub.cfg -p / -O $target -o grub-$target echo reboot normal || exit; done )
 
   # Run images we know how to run.
   - if [[ "$GRUB_TARGETS" == *"x86_64-efi"* ]]; then qemu-system-x86_64 -bios /usr/share/ovmf/OVMF.fd -m 512 -no-reboot -nographic -net nic -net user,tftp=.,bootfile=grub-x86_64-efi | tee grub.log && grep "hello world" grub.log; fi
@@ -94,7 +94,7 @@ matrix:
         - CROSS_TARGETS="mips64-linux"
     - name: "arm"
       env:
-        - GRUB_TARGETS="arm-coreboot arm-efi arm-uboot"
+        - GRUB_TARGETS="arm-coreboot-vexpress arm-efi arm-uboot"
         - CROSS_TARGETS="arm-linux-gnueabi"
     - name: "arm64"
       env:
Signature · 1 line
2.16.4
#6 lore raw

PATCH 5/6 arm coreboot: Use common directory path

In reply to Alexander Graf

The ARM coreboot target supports multiple boards, but they are all built using the same object path. The only difference in target boards is done in mkimage to determine the load address.

Currently, mkimage is looking at a board specific path (/usr/lib/grub/arm-coreboot-vexpress) for modules while it installs it at a non-specific path (/usr/lib/grub/arm-coreboot).

So let's sync the two up again and tell mkimage to look for coreboot modules at a board agnostic path, syncing it up with all other targets.

---
 util/mkimage.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
util/mkimage.c +2 -2
index 37d6249f1..f1a9c9c86 100644
@@ -553,7 +553,7 @@ static const struct grub_install_image_target_desc image_targets[] =
     },
     /* For coreboot versions that don't support self-relocating images. */
     {
-      .dirname = "arm-coreboot-vexpress",
+      .dirname = "arm-coreboot",
       .names = { "arm-coreboot-vexpress", NULL },
       .voidp_sizeof = 4,
       .bigendian = 0,
@@ -572,7 +572,7 @@ static const struct grub_install_image_target_desc image_targets[] =
       .link_addr = 0x62000000,
     },
     {
-      .dirname = "arm-coreboot-veyron",
+      .dirname = "arm-coreboot",
       .names = { "arm-coreboot-veyron", NULL },
       .voidp_sizeof = 4,
       .bigendian = 0,
Signature · 1 line
2.16.4
#7 lore raw

PATCH 6/6 travis: Add smoke tests for arm and aarch64

In reply to Alexander Graf

We've had an arm regression in grub recently where grub would not even be able to boot up anymore. So let's include arm and aarch64 in our simple "hello world" smoke tests as well.

For OVMF on ARM to work, we need a newer version of QEMU, add a PPA dependency for it.

---
 .travis.yml | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
.travis.yml +7 -1
index 29013bb9b..e6eab6ecf 100644
@@ -11,6 +11,8 @@ language: c
 
 addons:
   apt:
+    sources:
+    - sourceline: 'ppa:jacob/virtualisation'
     packages:
     - libsdl1.2-dev
     - lzop
@@ -32,6 +34,8 @@ before_script:
   - for i in $CROSS_TARGETS; do
         ( cd /tmp/cross; wget -t 3 -O - https://mirrors.kernel.org/pub/tools/crosstool/files/bin/x86_64/8.1.0/x86_64-gcc-8.1.0-nolibc-$i.tar.xz | tar xJ );
     done
+  - if [[ "$GRUB_TARGETS" == *"arm64-efi"* ]]; then wget http://snapshots.linaro.org/components/kernel/leg-virt-tianocore-edk2-upstream/3525/QEMU-AARCH64/RELEASE_GCC5/QEMU_EFI.fd -O QEMU_EFI.aarch64.fd; fi
+  - if [[ "$GRUB_TARGETS" == *"arm-efi"* ]]; then wget http://snapshots.linaro.org/components/kernel/leg-virt-tianocore-edk2-upstream/3525/QEMU-ARM/RELEASE_GCC5/QEMU_EFI.fd -O QEMU_EFI.arm.fd; fi
 
 script:
   # Comments must be outside the command strings below, or the Travis parser
@@ -65,7 +69,9 @@ script:
   - ( for target in $GRUB_TARGETS; do grub-mkimage -c grub.cfg -p / -O $target -o grub-$target echo reboot normal || exit; done )
 
   # Run images we know how to run.
-  - if [[ "$GRUB_TARGETS" == *"x86_64-efi"* ]]; then qemu-system-x86_64 -bios /usr/share/ovmf/OVMF.fd -m 512 -no-reboot -nographic -net nic -net user,tftp=.,bootfile=grub-x86_64-efi | tee grub.log && grep "hello world" grub.log; fi
+  - if [[ "$GRUB_TARGETS" == *"x86_64-efi"* ]]; then qemu-system-x86_64                          -bios /usr/share/ovmf/OVMF.fd -m 512 -no-reboot -nographic -net nic -net user,tftp=.,bootfile=grub-x86_64-efi | tee grub.log && grep "hello world" grub.log; fi
+  - if [[ "$GRUB_TARGETS" == *"arm64-efi"* ]];  then qemu-system-aarch64 -M virt -cpu cortex-a57 -bios QEMU_EFI.aarch64.fd     -m 512 -no-reboot -nographic -net nic -net user,tftp=.,bootfile=grub-arm64-efi  | tee grub.log && grep "hello world" grub.log; fi
+  - if [[ "$GRUB_TARGETS" == *"arm-efi"* ]];    then qemu-system-arm     -M virt -cpu cortex-a15 -bios QEMU_EFI.arm.fd         -m 512 -no-reboot -nographic -net nic -net user,tftp=.,bootfile=grub-arm-efi    | tee grub.log && grep "hello world" grub.log; fi
 
 matrix:
   include:
Signature · 1 line
2.16.4