File tree 3 files changed +52
-5
lines changed
docker/s390x-unknown-linux-gnu
3 files changed +52
-5
lines changed Original file line number Diff line number Diff line change 1
1
FROM ubuntu:17.10
2
2
3
3
RUN apt-get update && apt-get install -y --no-install-recommends \
4
- gcc libc6-dev qemu-user ca-certificates \
5
- gcc-s390x-linux-gnu libc6-dev-s390x-cross
4
+ curl ca-certificates \
5
+ gcc libc6-dev \
6
+ gcc-s390x-linux-gnu libc6-dev-s390x-cross \
7
+ qemu-system-s390x \
8
+ cpio
9
+
10
+ COPY linux-s390x.sh /
11
+ RUN bash /linux-s390x.sh
12
+
13
+ COPY test-runner-linux /
6
14
7
15
ENV CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_LINKER=s390x-linux-gnu-gcc \
8
- # TODO: in theory we should execute this, but qemu segfaults immediately :(
9
- # CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_RUNNER="qemu-s390x -L /usr/s390x-linux-gnu" \
10
- CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_RUNNER=true \
16
+ CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_RUNNER="/test-runner-linux s390x" \
11
17
CC_s390x_unknown_linux_gnu=s390x-linux-gnu-gcc \
12
18
PATH=$PATH:/rust/bin
Original file line number Diff line number Diff line change
1
+ set -ex
2
+
3
+ mkdir -m 777 /qemu
4
+ cd /qemu
5
+
6
+ curl -LO https://github.com/qemu/qemu/raw/master/pc-bios/s390-ccw.img
7
+ curl -LO http://ftp.debian.org/debian/dists/testing/main/installer-s390x/20170828/images/generic/kernel.debian
8
+ curl -LO http://ftp.debian.org/debian/dists/testing/main/installer-s390x/20170828/images/generic/initrd.debian
9
+
10
+ mv kernel.debian kernel
11
+ mv initrd.debian initrd.gz
12
+
13
+ mkdir init
14
+ cd init
15
+ gunzip -c ../initrd.gz | cpio -id
16
+ rm ../initrd.gz
17
+ cp /usr/s390x-linux-gnu/lib/libgcc_s.so.1 usr/lib/
18
+ chmod a+w .
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -e
4
+
5
+ arch=$1
6
+ prog=$2
7
+
8
+ cd /qemu/init
9
+ cp -f $2 prog
10
+ find . | cpio --create --format=' newc' --quiet | gzip > ../initrd.gz
11
+ cd ..
12
+
13
+ timeout 30s qemu-system-$arch \
14
+ -m 1024 \
15
+ -nographic \
16
+ -kernel kernel \
17
+ -initrd initrd.gz \
18
+ -append init=/prog > output || true
19
+
20
+ # remove kernel messages
21
+ tr -d ' \r' < output | egrep -v ' ^\['
22
+
23
+ grep PASSED output > /dev/null
You can’t perform that action at this time.
0 commit comments