-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
123 lines (87 loc) · 3.94 KB
/
Dockerfile
File metadata and controls
123 lines (87 loc) · 3.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# NOTE: Docker Server to fetch docker images
ARG DOCKER_SERVER
# defines the tag of the image we should base on
ARG DOCKER_IN_TAG
# NOTE: Default build for the fdvio modules
# with its different variants
FROM ${DOCKER_SERVER}/iccom:${DOCKER_IN_TAG} AS fdvio
# Base (default) version
ARG kernel_source_dir_x86=/repos/linux_x86/
ARG kernel_source_dir_arm=/repos/linux_arm/
## Prepare the fdvio sources
ENV repo_path=/repos/linux-fdvio
RUN rm -rf ${repo_path} && mkdir -p ${repo_path}
# TODO: MOVE THIS TO KERNEL MODULES BASE IMAGE
RUN apt-get update && apt-get install --yes --fix-missing gdb libncurses-dev
# add only for the container, not for an image
WORKDIR ${repo_path}
COPY . .
## Fdvio Variants Builds
# x86
RUN make -C ${kernel_source_dir_x86} M=${repo_path} \
KDIR=${kernel_source_dir_x86} \
CONFIG_BOSCH_DRIVERS=y \
CONFIG_BOSCH_FDVIO_DRIVER=m \
CONFIG_CHECK_SIGNATURE=n \
CONFIG_BOSCH_FDVIO_THEIR_DATA_WAIT_TIMEOUT_MSEC=5000 \
CONFIG_BOSCH_FDVIO_ERROR_SILENCE_TIME_MSEC=30
RUN mkdir -p ${INITRAMFS_CHROOT_X86}/modules \
&& cp ${repo_path}/src/fdvio.ko \
${INITRAMFS_CHROOT_X86}/modules/ \
&& cp ${repo_path}/src/loopback_rpmsg_proc.ko \
${INITRAMFS_CHROOT_X86}/modules/
# ARM
RUN make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- \
-C ${kernel_source_dir_arm} \
M=${repo_path} \
KDIR=${kernel_source_dir_arm} \
CONFIG_BOSCH_DRIVERS=y \
CONFIG_BOSCH_FDVIO_DRIVER=m \
CONFIG_CHECK_SIGNATURE=n \
CONFIG_BOSCH_FDVIO_THEIR_DATA_WAIT_TIMEOUT_MSEC=5000 \
CONFIG_BOSCH_FDVIO_ERROR_SILENCE_TIME_MSEC=30
RUN mkdir -p ${INITRAMFS_CHROOT_ARM}/modules \
&& cp ${repo_path}/src/fdvio.ko \
${INITRAMFS_CHROOT_ARM}/modules/ \
&& cp ${repo_path}/src/loopback_rpmsg_proc.ko \
${INITRAMFS_CHROOT_ARM}/modules/
###################### TEST PREPARATION BLOCK #######################
FROM fdvio AS fdvio-test
## SIMPLE INSERTION / REMOVAL TEST
RUN python-to-initramfs-x86 ${repo_path}/tests/fdvio_tests.py
COPY tests/insmod_rmmod_test.sh /builds/shell-tests/
RUN shell-to-initramfs-arm /builds/shell-tests/insmod_rmmod_test.sh
COPY tests/arm_basic_test.sh /builds/shell-tests/
RUN shell-to-initramfs-arm /repos/linux-fdvio/tests/arm_basic_test.sh
######################### TEST RUN BLOCK ############################
# x86
RUN run-qemu-tests-x86
RUN grep "fdvio: PASS" /qemu_run_x86.log > /dev/null
## ARM
# TODO: here must be the testing up to userspace level
#RUN cd /repos \
# && git clone ssh://git@sourcecode.socialcoding.bosch.com:7999/cm_ci2_linux/libiccom.git
#RUN mkdir -p /builds/libiccom && cd /builds/libiccom \
# && cmake -DCMAKE_CXX_COMPILER=arm-linux-gnueabi-g++ /repos/libiccom \
# && make && cmake --install . --prefix /builds/initramfs_arm/content
##################### MANUAL STACK IN ARM ###################
# Create the dtb file
RUN mkdir -p /builds/linux_arm/device_tree
COPY ./device_tree/ast2500.dts /builds/linux_arm/device_tree/
RUN dtc -I dts -O dtb /builds/linux_arm/device_tree/ast2500.dts \
> /builds/linux_arm/device_tree/ast2500.dtb
RUN rm /builds/initramfs_arm/content/tests/*
RUN shell-to-initramfs-arm /repos/linux-fdvio/tests/arm_basic_test.sh
RUN run-qemu-tests-arm /builds/linux_arm/device_tree/ast2500.dtb
# Check the expected results
RUN grep "fdvio: PASS" /qemu_run_arm.log > /dev/null
######################### DT STACK IN ARM ###################
# Create the dtb file
RUN mkdir -p /builds/linux_arm/device_tree
COPY ./device_tree/ast2500-auto.dts /builds/linux_arm/device_tree/
RUN dtc -I dts -O dtb /builds/linux_arm/device_tree/ast2500-auto.dts \
> /builds/linux_arm/device_tree/ast2500-auto.dtb
RUN rm /builds/initramfs_arm/content/tests/*
RUN shell-to-initramfs-arm /repos/linux-fdvio/tests/arm_dt_test.sh
RUN run-qemu-tests-arm /builds/linux_arm/device_tree/ast2500-auto.dtb
RUN grep "fdvio: PASS" /qemu_run_arm.log > /dev/null