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