Travis fixes
v2 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
- add ARM Thumb mode tests
- verify that on demand module and config loading from TFTP works
That way we should hopefully catch even more problems going forward.
v1 -> v2:
- add ARM Thumb mode tests
- verify that on demand module and config loading from TFTP works
- use local gnulib (saves ~3m git checkout time)
Alexander Graf (8):
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: Add ARM thumb target to tests
travis: Test module loading from tftp as well
.travis.yml | 45 +++++++++++++++++++++++++++++++++++++-------- util/mkimage.c | 4 ++-- 2 files changed, 39 insertions(+), 10 deletions(-)
Signature · 1 line
2.16.4
PATCH v2 1/8 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.
---
v1 -> v2:
- use local gnulib copy (saves ~3m git checkout time)
--- .travis.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
.travis.yml +6 -1
@@ -18,6 +18,7 @@ addons: - python - qemu-system - unifont + - gnulib env: global:
@@ -35,7 +36,11 @@ before_script: script: # Comments must be outside the command strings below, or the Travis parser # will get confused. - - ./autogen.sh + + # The Ubuntu gnulib does not compile with gcc8, so only use it with the system compiler + - if [ ! "$CROSS_TARGETS" ]; then rm -rf gnulib; ln -s /usr/share/gnulib; fi + # Initialize build system + - ./bootstrap # Build all selected GRUB targets. - for target in $GRUB_TARGETS; do
Signature · 1 line
2.16.4
Re: [PATCH v2 1/8] travis: Run bootstrap instead of autogen.sh
Quoted 29 lines · Alexander Graf
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")Signed-off-by Alexander Graf <[email protected]>---
v1 -> v2:
- use local gnulib copy (saves ~3m git checkout time)
--- .travis.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-).travis.yml +1
-0@@ -18,6 +18,7 @@ addons: - python - qemu-system - unifont + - gnulib env: global:
.travis.yml before_script: · line 41
Quoted 7 lines
.travis.yml +3
-1@@ -35,7 +36,11 @@ before_script: script: # Comments must be outside the command strings below, or the Travis parser # will get confused. - - ./autogen.sh + + # The Ubuntu gnulib does not compile with gcc8, so only use it with the system compiler + - if [ ! "$CROSS_TARGETS" ]; then rm -rf gnulib; ln -s /usr/share/gnulib; fi
I would not depend on it at all. Could you drop this and gnulib package addition above?
Daniel
Re: [PATCH v2 1/8] travis: Run bootstrap instead of autogen.sh
Quoted 27 lines · Daniel Kiper
Quoted 26 lines · Alexander Graf
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")Signed-off-by Alexander Graf <[email protected]>---
v1 -> v2:
- use local gnulib copy (saves ~3m git checkout time)
--- .travis.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-).travis.yml +1
-0@@ -18,6 +18,7 @@ addons: - python - qemu-system - unifont + - gnulib
Quoted 12 lines
.travis.yml before_script: · line 41
Quoted 10 lines
.travis.yml +3
-1env: global:@@ -35,7 +36,11 @@ before_script: script: # Comments must be outside the command strings below, or the Travis parser # will get confused. - - ./autogen.sh + + # The Ubuntu gnulib does not compile with gcc8, so only use it with the system compiler + - if [ ! "$CROSS_TARGETS" ]; then rm -rf gnulib; ln -s /usr/share/gnulib; fiI would not depend on it at all. Could you drop this and gnulib package addition above?
The gnulib package dependency gets us all the other dependencies that gnulib pulls in - and is much more obvious than listing them explicitly.
The hack here shaves down compilation time by a few minutes for x86 targets - and latency is definitely important. I'd really prefer to leave it in.
Alex
Re: [PATCH v2 1/8] travis: Run bootstrap instead of autogen.sh
Quoted 42 lines · Alexander Graf
Quoted 27 lines · Daniel Kiper
Quoted 26 lines · Alexander Graf
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")Signed-off-by Alexander Graf <[email protected]>---
v1 -> v2:
- use local gnulib copy (saves ~3m git checkout time)
--- .travis.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-).travis.yml +1
-0@@ -18,6 +18,7 @@ addons: - python - qemu-system - unifont + - gnulibQuoted 12 lines
.travis.yml before_script: · line 41
Quoted 10 lines
.travis.yml +3
-1env: global:@@ -35,7 +36,11 @@ before_script: script: # Comments must be outside the command strings below, or the Travis parser # will get confused. - - ./autogen.sh + + # The Ubuntu gnulib does not compile with gcc8, so only use it with the system compiler + - if [ ! "$CROSS_TARGETS" ]; then rm -rf gnulib; ln -s /usr/share/gnulib; fiI would not depend on it at all. Could you drop this and gnulib package addition above?
Quoted 6 lines
The gnulib package dependency gets us all the other dependencies that gnulib pulls in - and is much more obvious than listing them explicitly.
The hack here shaves down compilation time by a few minutes for x86 targets - and latency is definitely important. I'd really prefer to leave it in.
OK but please add somewhere a comment similar to above.
Daniel
PATCH v2 2/8 travis: Fix sparc64 test
In reply to Alexander GrafFor 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
@@ -45,7 +45,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;
@@ -85,7 +86,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
PATCH v2 3/8 travis: Fix mips QEMU target
In reply to Alexander GrafThe 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
@@ -94,7 +94,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
PATCH v2 4/8 travis: Fix arm coreboot test and make loop more robus
In reply to Alexander GrafWe 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
@@ -66,7 +66,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
@@ -98,7 +98,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
PATCH v2 5/8 arm coreboot: Use common directory path
In reply to Alexander GrafThe 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
@@ -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
PATCH v2 6/8 travis: Add smoke tests for arm and aarch64
In reply to Alexander GrafWe'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
@@ -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
@@ -69,7 +73,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
Re: [PATCH v2 6/8] travis: Add smoke tests for arm and aarch64
Just noticed this hadn't been merged, so time for a comment :)
Quoted 26 lines · 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.
Signed-off-by Alexander Graf <[email protected]>--- .travis.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-).travis.yml +2
-0@@ -11,6 +11,8 @@ language: c addons: apt: + sources: + - sourceline: 'ppa:jacob/virtualisation' packages: - libsdl1.2-dev - lzop
.travis.yml before_script: · line 38
Quoted 5 lines
.travis.yml +2
-0@@ -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
Probably don't want to use images from snapshots - they get garbage collected after a few months.
http://releases.linaro.org/reference-platform/enterprise/firmware/open-source/19.03/release/qemu-aarch64/QEMU_EFI.fd
and
http://releases.linaro.org/reference-platform/enterprise/firmware/open-source/19.03/release/qemu-arm/QEMU_EFI.fd
aren't going anywhere, so are possibly better options.
/
Leif
Quoted 22 lines
.travis.yml +3
-1script: # Comments must be outside the command strings below, or the Travis parser@@ -69,7 +73,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 · 7 lines
2.16.4 _______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel
PATCH v2 7/8 travis: Add ARM thumb target to tests
In reply to Alexander GrafWe hit an error case which only got triggered on ARM Thumb code. So let's make sure we test that combination as well.
--- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+)
.travis.yml +5 -0
@@ -106,6 +106,11 @@ matrix: env: - GRUB_TARGETS="arm-coreboot-vexpress arm-efi arm-uboot" - CROSS_TARGETS="arm-linux-gnueabi" + - name: "arm_thumb" + env: + - GRUB_TARGETS="arm-coreboot-vexpress arm-efi arm-uboot" + - CROSS_TARGETS="arm-linux-gnueabi" + - TARGET_CFLAGS="-mthumb" - name: "arm64" env: - GRUB_TARGETS="arm64-efi"
Signature · 1 line
2.16.4
Re: [PATCH v2 7/8] travis: Add ARM thumb target to tests
Comment here as well:
Quoted 2 lines · Alexander Graf
We hit an error case which only got triggered on ARM Thumb code. So let's make sure we test that combination as well.
This is the default for at least several and possibly most ARMv7-A distributions/prebuilt toolchains.
So while a good idea, if you want to specifically force instruction set use, the opposite case needs to be set up with -marm.
.travis.yml matrix: · line 108
Quoted 13 lines
Signed-off-by Alexander Graf <[email protected]>--- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+).travis.yml +0
-0@@ -106,6 +106,11 @@ matrix: env: - GRUB_TARGETS="arm-coreboot-vexpress arm-efi arm-uboot" - CROSS_TARGETS="arm-linux-gnueabi"
But, wait...
arm-linux-gnueabi is the softfloat (v5te) toolchain - if we want to test that, fine - but we definitely need to test arm-linux-gnueabihf.
First of all, I would expect that this toolchain will not use T32 (Thumb-2) instructions by default, so much of the code will end up being compiled as A32 anyway.
/
Leif
Quoted 16 lines
.travis.yml +5
-0+ - name: "arm_thumb" + env: + - GRUB_TARGETS="arm-coreboot-vexpress arm-efi arm-uboot" + - CROSS_TARGETS="arm-linux-gnueabi" + - TARGET_CFLAGS="-mthumb" - name: "arm64" env: - GRUB_TARGETS="arm64-efi"Signature · 7 lines
2.16.4 _______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel
Re: [PATCH v2 7/8] travis: Add ARM thumb target to tests
Quoted 28 lines · Leif Lindholm
Comment here as well:
Quoted 2 lines · Alexander Graf
We hit an error case which only got triggered on ARM Thumb code. So let's make sure we test that combination as well.
This is the default for at least several and possibly most ARMv7-A distributions/prebuilt toolchains.
So while a good idea, if you want to specifically force instruction set use, the opposite case needs to be set up with -marm.
.travis.yml matrix: · line 108
Quoted 13 lines
Signed-off-by Alexander Graf <[email protected]>--- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+).travis.yml +0
-0@@ -106,6 +106,11 @@ matrix: env: - GRUB_TARGETS="arm-coreboot-vexpress arm-efi arm-uboot" - CROSS_TARGETS="arm-linux-gnueabi"But, wait...
arm-linux-gnueabi is the softfloat (v5te) toolchain - if we want to test that, fine - but we definitely need to test arm-linux-gnueabihf.
Quoted 3 lines
First of all, I would expect that this toolchain will not use T32 (Thumb-2) instructions by default, so much of the code will end up being compiled as A32 anyway.
Yeah, that's why we don't need to pass in -marm I guess. But I also don't see an explicit hardfloat cross gcc on kernel.org?
https://mirrors.kernel.org/pub/tools/crosstool/files/bin/x86_64/8.1.0/
Alex
Re: [PATCH v2 7/8] travis: Add ARM thumb target to tests
Quoted 9 lines · Alexander Graf
Quoted 7 lines
But, wait...
arm-linux-gnueabi is the softfloat (v5te) toolchain - if we want to test that, fine - but we definitely need to test arm-linux-gnueabihf.First of all, I would expect that this toolchain will not use T32 (Thumb-2) instructions by default, so much of the code will end up being compiled as A32 anyway.
Quoted 4 lines
Yeah, that's why we don't need to pass in -marm I guess. But I also don't see an explicit hardfloat cross gcc on kernel.org?
https://mirrors.kernel.org/pub/tools/crosstool/files/bin/x86_64/8.1.0/
Urgh.
Yeah, so the default output of that toolchain gives
File Attributes
Tag_CPU_name: "5T"
Tag_CPU_arch: v5T
Tag_ARM_ISA_use: Yes
Tag_THUMB_ISA_use: Thumb-1
In theory, you should be OK just adding
"-mfloat-abi=hard -march=armv7-a+vfpv3-d16" to CFLAGS, since we're not using any toolchain-provided libraries:
Tag_CPU_name: "7-A"
Tag_CPU_arch: v7
Tag_CPU_arch_profile: Application
Tag_ARM_ISA_use: Yes
Tag_THUMB_ISA_use: Thumb-2
Tag_FP_arch: VFPv3-D16
Tag_ABI_PCS_wchar_t: 4
Tag_ABI_FP_denormal: Needed
Tag_ABI_FP_exceptions: Needed
Tag_ABI_FP_number_model: IEEE 754
Tag_ABI_align_needed: 8-byte
Tag_ABI_align_preserved: 8-byte, except leaf SP
Tag_ABI_enum_size: int
Tag_ABI_VFP_args: VFP registers
/
Leif
Re: [PATCH v2 7/8] travis: Add ARM thumb target to tests
Quoted 21 lines · Leif Lindholm
Quoted 4 lines · Alexander Graf
Quoted 4 lines
But, wait...
arm-linux-gnueabi is the softfloat (v5te) toolchain - if we want to test that, fine - but we definitely need to test arm-linux-gnueabihf.Quoted 8 lines
Quoted 3 lines
First of all, I would expect that this toolchain will not use T32 (Thumb-2) instructions by default, so much of the code will end up being compiled as A32 anyway.
Yeah, that's why we don't need to pass in -marm I guess. But I also don't see an explicit hardfloat cross gcc on kernel.org?
https://mirrors.kernel.org/pub/tools/crosstool/files/bin/x86_64/8.1.0/
Urgh.
Yeah, so the default output of that toolchain gives
File Attributes
Tag_CPU_name: "5T"
Tag_CPU_arch: v5T
Tag_ARM_ISA_use: Yes
Tag_THUMB_ISA_use: Thumb-1
Quoted 3 lines
In theory, you should be OK just adding
"-mfloat-abi=hard -march=armv7-a+vfpv3-d16" to CFLAGS, since we're not using any toolchain-provided libraries:
In configure we're already forcing soft float, so there's little point in adding these cflags :). In fact, when I do add them, I only get configure errors because setting both -mhard-float and -msoft-float at the same time confuses gcc.
Alex
Re: [PATCH v2 7/8] travis: Add ARM thumb target to tests
Quoted 22 lines · Alexander Graf
Quoted 21 lines · Leif Lindholm
Quoted 4 lines · Alexander Graf
Quoted 4 lines
But, wait...
arm-linux-gnueabi is the softfloat (v5te) toolchain - if we want to test that, fine - but we definitely need to test arm-linux-gnueabihf.Quoted 8 lines
Quoted 3 lines
First of all, I would expect that this toolchain will not use T32 (Thumb-2) instructions by default, so much of the code will end up being compiled as A32 anyway.
Yeah, that's why we don't need to pass in -marm I guess. But I also don't see an explicit hardfloat cross gcc on kernel.org?
https://mirrors.kernel.org/pub/tools/crosstool/files/bin/x86_64/8.1.0/
Urgh.
Yeah, so the default output of that toolchain gives
File Attributes
Tag_CPU_name: "5T"
Tag_CPU_arch: v5T
Tag_ARM_ISA_use: Yes
Tag_THUMB_ISA_use: Thumb-1
Quoted 8 lines
Quoted 3 lines
In theory, you should be OK just adding
"-mfloat-abi=hard -march=armv7-a+vfpv3-d16" to CFLAGS, since we're not using any toolchain-provided libraries:In configure we're already forcing soft float, so there's little point in adding these cflags :). In fact, when I do add them, I only get configure errors because setting both -mhard-float and -msoft-float at the same time confuses gcc.
OK, that bit is less of an issue then.
We only need -march=armv7-a.
/
Leif
PATCH v2 8/8 travis: Test module loading from tftp as well
In reply to Alexander GrafThe travis test today only uses modules that are delivered with the grub.efi binary. Let's drop echo and reboot and see if grub can load them dynamically.
For this, we need to ensure that all modules required to load additional modules are included in the grub binary. Some of these are target specific (like efinet), so only include them conditionally.
Furthermore, the iPXE option rom included in Ubuntu Xenial seems to be broken, so we need to ensure that we only use the OVMF built-in network driver and not pass in an option rom.
---
v1 -> v2:
- new patch
--- .travis.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-)
.travis.yml +17 -5
@@ -67,15 +67,27 @@ script: done # Our test canary. - - echo -e "insmod echo\\ninsmod reboot\\necho hello world\\nreboot" > grub.cfg + - echo -e "insmod echo\\ninsmod reboot\\necho hello world\\nreboot" > /tmp/grub/lib/grub/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 || exit; done ) + - ( for target in $GRUB_TARGETS; do + pushd /tmp/grub/lib/grub/; + if [ -f $target/efinet.mod ]; then + EXTMODULES="efinet"; + else + EXTMODULES=""; + fi; + grub-mkimage -p / -O $target -o grub-$target normal tftp $EXTMODULES || exit; + popd; + 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" == *"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 + - if [[ "$GRUB_TARGETS" == *"x86_64-efi"* ]]; then qemu-system-x86_64 -bios /usr/share/ovmf/OVMF.fd + -m 512 -no-reboot -nographic -net none -netdev user,id=nd,tftp=/tmp/grub/lib/grub/,bootfile=grub-x86_64-efi -device virtio-net-pci,netdev=nd,romfile="" | 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 none -netdev user,id=nd,tftp=/tmp/grub/lib/grub/,bootfile=grub-arm64-efi -device virtio-net-pci,netdev=nd,romfile="" | 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 none -netdev user,id=nd,tftp=/tmp/grub/lib/grub/,bootfile=grub-arm-efi -device virtio-net-pci,netdev=nd,romfile="" | tee grub.log && grep "hello world" grub.log; fi matrix: include:
Signature · 1 line
2.16.4
Re: [PATCH v2 8/8] travis: Test module loading from tftp as well
Quoted 47 lines · Alexander Graf
The travis test today only uses modules that are delivered with the grub.efi binary. Let's drop echo and reboot and see if grub can load them dynamically.
For this, we need to ensure that all modules required to load additional modules are included in the grub binary. Some of these are target specific (like efinet), so only include them conditionally.
Furthermore, the iPXE option rom included in Ubuntu Xenial seems to be broken, so we need to ensure that we only use the OVMF built-in network driver and not pass in an option rom.
Signed-off-by Alexander Graf <[email protected]>---
v1 -> v2:
- new patch
--- .travis.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-).travis.yml +11
-2@@ -67,15 +67,27 @@ script: done # Our test canary. - - echo -e "insmod echo\\ninsmod reboot\\necho hello world\\nreboot" > grub.cfg + - echo -e "insmod echo\\ninsmod reboot\\necho hello world\\nreboot" > /tmp/grub/lib/grub/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 || exit; done ) + - ( for target in $GRUB_TARGETS; do + pushd /tmp/grub/lib/grub/; + if [ -f $target/efinet.mod ]; then + EXTMODULES="efinet"; + else + EXTMODULES=""; + fi; + grub-mkimage -p / -O $target -o grub-$target normal tftp $EXTMODULES || exit; + popd; + done )
.travis.yml script: · line 90
Quoted 10 lines
.travis.yml +6
-3# 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" == *"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 + - if [[ "$GRUB_TARGETS" == *"x86_64-efi"* ]]; then qemu-system-x86_64 -bios /usr/share/ovmf/OVMF.fd + -m 512 -no-reboot -nographic -net none -netdev user,id=nd,tftp=/tmp/grub/lib/grub/,bootfile=grub-x86_64-efi -device virtio-net-pci,netdev=nd,romfile="" | 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 none -netdev user,id=nd,tftp=/tmp/grub/lib/grub/,bootfile=grub-arm64-efi -device virtio-net-pci,netdev=nd,romfile="" | 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 none -netdev user,id=nd,tftp=/tmp/grub/lib/grub/,bootfile=grub-arm-efi -device virtio-net-pci,netdev=nd,romfile="" | tee grub.log && grep "hello world" grub.log; fi
I am not sure why you do not use grep directly on the output. Could you drop tee? If yes please drop it from all commands.
Daniel
Re: [PATCH v2 8/8] travis: Test module loading from tftp as well
Quoted 48 lines · Daniel Kiper
Quoted 47 lines · Alexander Graf
The travis test today only uses modules that are delivered with the grub.efi binary. Let's drop echo and reboot and see if grub can load them dynamically.
For this, we need to ensure that all modules required to load additional modules are included in the grub binary. Some of these are target specific (like efinet), so only include them conditionally.
Furthermore, the iPXE option rom included in Ubuntu Xenial seems to be broken, so we need to ensure that we only use the OVMF built-in network driver and not pass in an option rom.
Signed-off-by Alexander Graf <[email protected]>---
v1 -> v2:
- new patch
--- .travis.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-).travis.yml +11
-2@@ -67,15 +67,27 @@ script: done # Our test canary. - - echo -e "insmod echo\\ninsmod reboot\\necho hello world\\nreboot" > grub.cfg + - echo -e "insmod echo\\ninsmod reboot\\necho hello world\\nreboot" > /tmp/grub/lib/grub/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 || exit; done ) + - ( for target in $GRUB_TARGETS; do + pushd /tmp/grub/lib/grub/; + if [ -f $target/efinet.mod ]; then + EXTMODULES="efinet"; + else + EXTMODULES=""; + fi; + grub-mkimage -p / -O $target -o grub-$target normal tftp $EXTMODULES || exit; + popd; + done )
Quoted 12 lines
.travis.yml script: · line 90
Quoted 10 lines
.travis.yml +6
-3# 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" == *"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 + - if [[ "$GRUB_TARGETS" == *"x86_64-efi"* ]]; then qemu-system-x86_64 -bios /usr/share/ovmf/OVMF.fd + -m 512 -no-reboot -nographic -net none -netdev user,id=nd,tftp=/tmp/grub/lib/grub/,bootfile=grub-x86_64-efi -device virtio-net-pci,netdev=nd,romfile="" | 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 none -netdev user,id=nd,tftp=/tmp/grub/lib/grub/,bootfile=grub-arm64-efi -device virtio-net-pci,netdev=nd,romfile="" | 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 none -netdev user,id=nd,tftp=/tmp/grub/lib/grub/,bootfile=grub-arm-efi -device virtio-net-pci,netdev=nd,romfile="" | tee grub.log && grep "hello world" grub.log; fiI am not sure why you do not use grep directly on the output. Could you drop tee? If yes please drop it from all commands.
This way you can see the VM output on the log. Without that, it becomes really hard to debug when something goes wrong.
Alex
Re: [PATCH v2 8/8] travis: Test module loading from tftp as well
Quoted 63 lines · Alexander Graf
Quoted 48 lines · Daniel Kiper
Quoted 47 lines · Alexander Graf
The travis test today only uses modules that are delivered with the grub.efi binary. Let's drop echo and reboot and see if grub can load them dynamically.
For this, we need to ensure that all modules required to load additional modules are included in the grub binary. Some of these are target specific (like efinet), so only include them conditionally.
Furthermore, the iPXE option rom included in Ubuntu Xenial seems to be broken, so we need to ensure that we only use the OVMF built-in network driver and not pass in an option rom.
Signed-off-by Alexander Graf <[email protected]>---
v1 -> v2:
- new patch
--- .travis.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-).travis.yml +11
-2@@ -67,15 +67,27 @@ script: done # Our test canary. - - echo -e "insmod echo\\ninsmod reboot\\necho hello world\\nreboot" > grub.cfg + - echo -e "insmod echo\\ninsmod reboot\\necho hello world\\nreboot" > /tmp/grub/lib/grub/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 || exit; done ) + - ( for target in $GRUB_TARGETS; do + pushd /tmp/grub/lib/grub/; + if [ -f $target/efinet.mod ]; then + EXTMODULES="efinet"; + else + EXTMODULES=""; + fi; + grub-mkimage -p / -O $target -o grub-$target normal tftp $EXTMODULES || exit; + popd; + done )Quoted 12 lines
.travis.yml script: · line 90
Quoted 10 lines
.travis.yml +6
-3# 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" == *"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 + - if [[ "$GRUB_TARGETS" == *"x86_64-efi"* ]]; then qemu-system-x86_64 -bios /usr/share/ovmf/OVMF.fd + -m 512 -no-reboot -nographic -net none -netdev user,id=nd,tftp=/tmp/grub/lib/grub/,bootfile=grub-x86_64-efi -device virtio-net-pci,netdev=nd,romfile="" | 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 none -netdev user,id=nd,tftp=/tmp/grub/lib/grub/,bootfile=grub-arm64-efi -device virtio-net-pci,netdev=nd,romfile="" | 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 none -netdev user,id=nd,tftp=/tmp/grub/lib/grub/,bootfile=grub-arm-efi -device virtio-net-pci,netdev=nd,romfile="" | tee grub.log && grep "hello world" grub.log; fiI am not sure why you do not use grep directly on the output. Could you drop tee? If yes please drop it from all commands.
Quoted 2 lines
This way you can see the VM output on the log. Without that, it becomes really hard to debug when something goes wrong.
OK, Reviewed-by: Daniel Kiper <[email protected]>
Daniel
Quoted 28 lines · Alexander Graf
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
- add ARM Thumb mode tests
- verify that on demand module and config loading from TFTP worksThat way we should hopefully catch even more problems going forward.
v1 -> v2:
- add ARM Thumb mode tests
- verify that on demand module and config loading from TFTP works
- use local gnulib (saves ~3m git checkout time)Alexander Graf (8):
travis: Run bootstrap instead ofautogen.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: Add ARM thumb target to tests
travis: Test module loading from tftp as well
Quoted 3 lines
.travis.yml | 45 +++++++++++++++++++++++++++++++++++++-------- util/mkimage.c | 4 ++-- 2 files changed, 39 insertions(+), 10 deletions(-)
Except two patches you can add Reviewed-by: Daniel Kiper <[email protected]>
Daniel