.travis.yml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. # SPDX-License-Identifier: GPL-3.0+
  2. # Originally Copyright Roger Meier <r.meier@siemens.com>
  3. # Adapted for GRUB by Alexander Graf <agraf@suse.de>
  4. #
  5. # Build GRUB on Travis CI - https://www.travis-ci.org/
  6. #
  7. dist: xenial
  8. language: c
  9. addons:
  10. apt:
  11. packages:
  12. - autopoint
  13. - libsdl1.2-dev
  14. - lzop
  15. - ovmf
  16. - python
  17. - qemu-system
  18. - unifont
  19. env:
  20. global:
  21. # Include all cross toolchain paths, so we can just call them later down.
  22. - PATH=/tmp/qemu-install/bin:/tmp/grub/bin:/usr/bin:/bin:/tmp/cross/gcc-8.1.0-nolibc/aarch64-linux/bin:/tmp/cross/gcc-8.1.0-nolibc/arm-linux-gnueabi/bin:/tmp/cross/gcc-8.1.0-nolibc/ia64-linux/bin:/tmp/cross/gcc-8.1.0-nolibc/mips64-linux/bin:/tmp/cross/gcc-8.1.0-nolibc/powerpc64-linux/bin:/tmp/cross/gcc-8.1.0-nolibc/riscv32-linux/bin:/tmp/cross/gcc-8.1.0-nolibc/riscv64-linux/bin:/tmp/cross/gcc-8.1.0-nolibc/sparc64-linux/bin
  23. before_script:
  24. # Install necessary toolchains based on $CROSS_TARGETS variable.
  25. - mkdir /tmp/cross
  26. # These give us binaries like /tmp/cross/gcc-8.1.0-nolibc/ia64-linux/bin/ia64-linux-gcc
  27. - for i in $CROSS_TARGETS; do
  28. ( 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 );
  29. done
  30. script:
  31. # Comments must be outside the command strings below, or the Travis parser
  32. # will get confused.
  33. - ./bootstrap
  34. # Build all selected GRUB targets.
  35. - for target in $GRUB_TARGETS; do
  36. plat=${target#*-};
  37. arch=${target%-*};
  38. [ "$arch" = "arm64" ] && arch=aarch64-linux;
  39. [ "$arch" = "arm" ] && arch=arm-linux-gnueabi;
  40. [ "$arch" = "ia64" ] && arch=ia64-linux;
  41. [ "$arch" = "mipsel" ] && arch=mips64-linux;
  42. [ "$arch" = "powerpc" ] && arch=powerpc64-linux;
  43. [ "$arch" = "riscv32" ] && arch=riscv32-linux;
  44. [ "$arch" = "riscv64" ] && arch=riscv64-linux;
  45. [ "$arch" = "sparc64" ] && arch=sparc64-linux;
  46. echo "Building $target";
  47. mkdir obj-$target;
  48. JOBS=`getconf _NPROCESSORS_ONLN 2> /dev/null || echo 1`;
  49. [ "$JOBS" == 1 ] || JOBS=$(($JOBS + 1));
  50. ( cd obj-$target && ../configure --target=$arch --with-platform=$plat --prefix=/tmp/grub && make -j$JOBS && make -j$JOBS install ) &> log || ( cat log; false );
  51. done
  52. # Our test canary.
  53. - echo -e "insmod echo\\ninsmod reboot\\necho hello world\\nreboot" > grub.cfg
  54. # Assemble images and possibly run them.
  55. - for target in $GRUB_TARGETS; do grub-mkimage -c grub.cfg -p / -O $target -o grub-$target echo reboot normal; done
  56. # Run images we know how to run.
  57. - 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
  58. matrix:
  59. include:
  60. # Each env setting here is a dedicated build.
  61. - name: "x86_64"
  62. env:
  63. - GRUB_TARGETS="x86_64-efi x86_64-xen"
  64. - name: "i386"
  65. env:
  66. - GRUB_TARGETS="i386-coreboot i386-efi i386-ieee1275 i386-multiboot i386-pc i386-qemu i386-xen i386-xen_pvh"
  67. - name: "powerpc"
  68. env:
  69. - GRUB_TARGETS="powerpc-ieee1275"
  70. - CROSS_TARGETS="powerpc64-linux"
  71. - name: "sparc64"
  72. env:
  73. - GRUB_TARGETS="sparc64-ieee1275"
  74. - CROSS_TARGETS="sparc64-linux"
  75. - name: "ia64"
  76. env:
  77. - GRUB_TARGETS="ia64-efi"
  78. - CROSS_TARGETS="ia64-linux"
  79. - name: "mips"
  80. env:
  81. - GRUB_TARGETS="mips-arc mipsel-arc mipsel-qemu_mips mips-qemu_mips"
  82. - CROSS_TARGETS="mips64-linux"
  83. - name: "arm"
  84. env:
  85. - GRUB_TARGETS="arm-coreboot arm-efi arm-uboot"
  86. - CROSS_TARGETS="arm-linux-gnueabi"
  87. - name: "arm64"
  88. env:
  89. - GRUB_TARGETS="arm64-efi"
  90. - CROSS_TARGETS="aarch64-linux"
  91. - name: "riscv32"
  92. env:
  93. - GRUB_TARGETS="riscv32-efi"
  94. - CROSS_TARGETS="riscv32-linux"
  95. - name: "riscv64"
  96. env:
  97. - GRUB_TARGETS="riscv64-efi"
  98. - CROSS_TARGETS="riscv64-linux"