Martin Roth | 561f368 | 2016-12-30 17:00:19 -0700 | [diff] [blame] | 1 | # This dockerfile is not meant to be used directly by docker. The |
Martin Roth | bea2d75 | 2017-09-17 17:35:52 -0600 | [diff] [blame] | 2 | # {{}} variables are replaced with values by the makefile. Please generate |
Martin Roth | 561f368 | 2016-12-30 17:00:19 -0700 | [diff] [blame] | 3 | # the docker image for this file by running: |
| 4 | # |
| 5 | # make coreboot-sdk |
| 6 | # |
| 7 | # Variables can be updated on the make command line or left blank to use |
| 8 | # the default values set by the makefile. |
| 9 | # |
| 10 | # SDK_VERSION is used to name the version of the coreboot sdk to use. |
| 11 | # Typically, this corresponds to the toolchain version. This |
| 12 | # is used to identify this docker image. |
| 13 | # DOCKER_COMMIT is the coreboot Commit-ID to build the toolchain from. |
| 14 | |
Patrick Georgi | c9e5294 | 2021-01-27 12:34:35 +0100 | [diff] [blame] | 15 | FROM debian:sid AS coreboot-sdk |
Martin Roth | 2d97cb1 | 2016-05-16 11:27:56 -0600 | [diff] [blame] | 16 | |
Martin Roth | f75d1df | 2016-05-16 11:27:56 -0600 | [diff] [blame] | 17 | RUN \ |
| 18 | useradd -p locked -m coreboot && \ |
| 19 | apt-get -qq update && \ |
Martin Roth | bea2d75 | 2017-09-17 17:35:52 -0600 | [diff] [blame] | 20 | apt-get -qqy install \ |
Martin Roth | e7d9248 | 2017-10-04 20:53:18 -0600 | [diff] [blame] | 21 | bc \ |
Martin Roth | bea2d75 | 2017-09-17 17:35:52 -0600 | [diff] [blame] | 22 | bison \ |
Martin Roth | 93e6bba | 2021-11-08 07:55:09 -0700 | [diff] [blame] | 23 | bsdextrautils \ |
Martin Roth | bea2d75 | 2017-09-17 17:35:52 -0600 | [diff] [blame] | 24 | bzip2 \ |
| 25 | ccache \ |
| 26 | cmake \ |
Martin Roth | bd8e6dd | 2020-10-25 15:07:07 -0600 | [diff] [blame] | 27 | cscope \ |
Martin Roth | bea2d75 | 2017-09-17 17:35:52 -0600 | [diff] [blame] | 28 | curl \ |
Patrick Rudolph | b90c0d9 | 2018-04-04 15:54:26 +0200 | [diff] [blame] | 29 | device-tree-compiler \ |
Martin Roth | bea2d75 | 2017-09-17 17:35:52 -0600 | [diff] [blame] | 30 | dh-autoreconf \ |
| 31 | diffutils \ |
Martin Roth | bd8e6dd | 2020-10-25 15:07:07 -0600 | [diff] [blame] | 32 | exuberant-ctags \ |
Martin Roth | bea2d75 | 2017-09-17 17:35:52 -0600 | [diff] [blame] | 33 | flex \ |
| 34 | g++ \ |
| 35 | gawk \ |
| 36 | gcc \ |
| 37 | git \ |
Felix Singer | feab41b | 2022-08-20 11:17:46 +0200 | [diff] [blame] | 38 | gnat-12 \ |
Wim Vervoorn | 01bfa53 | 2020-02-03 15:59:07 +0100 | [diff] [blame] | 39 | golang \ |
Tom Hiller | 520c8c0 | 2022-08-28 19:57:00 -0400 | [diff] [blame] | 40 | graphicsmagick-imagemagick-compat \ |
Martin Roth | 67403ed | 2018-05-18 21:53:24 -0600 | [diff] [blame] | 41 | graphviz \ |
Martin Roth | 93e6bba | 2021-11-08 07:55:09 -0700 | [diff] [blame] | 42 | lcov \ |
Martin Roth | d727fb5 | 2019-04-05 09:53:16 -0600 | [diff] [blame] | 43 | libcrypto++-dev \ |
Martin Roth | 92bc836 | 2019-12-23 15:07:03 -0700 | [diff] [blame] | 44 | libcurl4 \ |
| 45 | libcurl4-openssl-dev \ |
Wim Vervoorn | 01bfa53 | 2020-02-03 15:59:07 +0100 | [diff] [blame] | 46 | libelf-dev \ |
Martin Roth | bea2d75 | 2017-09-17 17:35:52 -0600 | [diff] [blame] | 47 | libfreetype6-dev \ |
| 48 | libftdi-dev \ |
Martin Roth | 215bc53 | 2018-01-28 16:13:38 -0700 | [diff] [blame] | 49 | libftdi1-dev \ |
Martin Roth | bea2d75 | 2017-09-17 17:35:52 -0600 | [diff] [blame] | 50 | libglib2.0-dev \ |
| 51 | libgmp-dev \ |
Martin Roth | 0cbc352 | 2023-01-20 16:58:54 -0700 | [diff] [blame] | 52 | libgpiod-dev \ |
Nico Huber | 885d963 | 2018-08-16 23:11:55 +0200 | [diff] [blame] | 53 | libjaylink-dev \ |
Martin Roth | bea2d75 | 2017-09-17 17:35:52 -0600 | [diff] [blame] | 54 | liblzma-dev \ |
| 55 | libncurses5-dev \ |
| 56 | libpci-dev \ |
| 57 | libreadline-dev \ |
Martin Roth | d727fb5 | 2019-04-05 09:53:16 -0600 | [diff] [blame] | 58 | libssl-dev \ |
Martin Roth | bea2d75 | 2017-09-17 17:35:52 -0600 | [diff] [blame] | 59 | libusb-1.0-0-dev \ |
| 60 | libusb-dev \ |
| 61 | libxml2-dev \ |
| 62 | libyaml-dev \ |
| 63 | m4 \ |
| 64 | make \ |
Martin Roth | bf78d07 | 2018-01-22 21:29:06 -0700 | [diff] [blame] | 65 | msitools \ |
Piotr Król | f57f131 | 2017-10-09 00:46:24 +0200 | [diff] [blame] | 66 | nasm \ |
Martin Roth | bea2d75 | 2017-09-17 17:35:52 -0600 | [diff] [blame] | 67 | openssl \ |
Martin Roth | bea2d75 | 2017-09-17 17:35:52 -0600 | [diff] [blame] | 68 | patch \ |
Martin Roth | bd8e6dd | 2020-10-25 15:07:07 -0600 | [diff] [blame] | 69 | pbzip2 \ |
Martin Roth | bea2d75 | 2017-09-17 17:35:52 -0600 | [diff] [blame] | 70 | pkg-config \ |
Martin Roth | 1ba86f6 | 2020-09-10 08:59:35 -0600 | [diff] [blame] | 71 | python3 \ |
Felix Singer | acbdc4d | 2022-08-20 11:16:05 +0200 | [diff] [blame] | 72 | qemu-system-arm \ |
| 73 | qemu-system-misc \ |
| 74 | qemu-system-ppc \ |
| 75 | qemu-system-x86 \ |
Martin Roth | bf78d07 | 2018-01-22 21:29:06 -0700 | [diff] [blame] | 76 | rsync \ |
Martin Roth | bea2d75 | 2017-09-17 17:35:52 -0600 | [diff] [blame] | 77 | shellcheck \ |
| 78 | subversion \ |
| 79 | unifont \ |
Martin Roth | bea2d75 | 2017-09-17 17:35:52 -0600 | [diff] [blame] | 80 | uuid-dev \ |
| 81 | vim-common \ |
| 82 | wget \ |
| 83 | xz-utils \ |
| 84 | zlib1g-dev \ |
Martin Roth | b0fe89d | 2018-09-09 11:14:53 -0600 | [diff] [blame] | 85 | && apt-get clean \ |
Felix Singer | 0fb7740 | 2023-01-06 08:02:50 +0100 | [diff] [blame^] | 86 | && update-alternatives --install /usr/bin/python python /usr/bin/python3 1 \ |
Martin Roth | b0fe89d | 2018-09-09 11:14:53 -0600 | [diff] [blame] | 87 | && ln -s /usr/bin/automake /usr/bin/automake-1.15 \ |
| 88 | && ln -s /usr/bin/aclocal /usr/bin/aclocal-1.15 |
Martin Roth | 2d97cb1 | 2016-05-16 11:27:56 -0600 | [diff] [blame] | 89 | |
| 90 | RUN \ |
Martin Roth | ebeec5a | 2020-10-25 15:16:00 -0600 | [diff] [blame] | 91 | cd /tmp && \ |
Paul Menzel | a8843de | 2017-06-05 12:33:23 +0200 | [diff] [blame] | 92 | git clone https://review.coreboot.org/coreboot && \ |
Nico Huber | dd477e9 | 2018-11-04 16:16:29 +0100 | [diff] [blame] | 93 | cd coreboot && \ |
Martin Roth | ebeec5a | 2020-10-25 15:16:00 -0600 | [diff] [blame] | 94 | git checkout {{DOCKER_COMMIT}}; \ |
Nico Huber | dd477e9 | 2018-11-04 16:16:29 +0100 | [diff] [blame] | 95 | if echo {{CROSSGCC_PARAM}} | grep -q ^all; then \ |
Martin Roth | ebeec5a | 2020-10-25 15:16:00 -0600 | [diff] [blame] | 96 | make -C /tmp/coreboot/util/crossgcc/ build_clang \ |
Nico Huber | dd477e9 | 2018-11-04 16:16:29 +0100 | [diff] [blame] | 97 | BUILD_LANGUAGES=c,ada CPUS=$(nproc) DEST=/opt/xgcc; \ |
Martin Roth | ebeec5a | 2020-10-25 15:16:00 -0600 | [diff] [blame] | 98 | fi; \ |
| 99 | make -C /tmp/coreboot/util/crossgcc/ {{CROSSGCC_PARAM}} \ |
Martin Roth | f0eda82 | 2017-03-23 16:13:58 -0600 | [diff] [blame] | 100 | BUILD_LANGUAGES=c,ada CPUS=$(nproc) DEST=/opt/xgcc && \ |
Martin Roth | ebeec5a | 2020-10-25 15:16:00 -0600 | [diff] [blame] | 101 | rm -rf /tmp/coreboot |
Martin Roth | 2d97cb1 | 2016-05-16 11:27:56 -0600 | [diff] [blame] | 102 | |
| 103 | RUN mkdir /home/coreboot/.ccache && \ |
| 104 | chown coreboot:coreboot /home/coreboot/.ccache && \ |
| 105 | mkdir /home/coreboot/cb_build && \ |
Martin Roth | bea2d75 | 2017-09-17 17:35:52 -0600 | [diff] [blame] | 106 | chown coreboot:coreboot /home/coreboot/cb_build && \ |
| 107 | echo "export PATH=$PATH:/opt/xgcc/bin" >> /home/coreboot/.bashrc && \ |
| 108 | echo "export SDK_VERSION={{SDK_VERSION}}" >> /home/coreboot/.bashrc && \ |
| 109 | echo "export SDK_COMMIT={{DOCKER_COMMIT}}" >> /home/coreboot/.bashrc |
| 110 | |
Martin Roth | f75d1df | 2016-05-16 11:27:56 -0600 | [diff] [blame] | 111 | ENV PATH $PATH:/opt/xgcc/bin |
Martin Roth | 561f368 | 2016-12-30 17:00:19 -0700 | [diff] [blame] | 112 | ENV SDK_VERSION={{SDK_VERSION}} |
| 113 | ENV SDK_COMMIT={{DOCKER_COMMIT}} |
Martin Roth | f75d1df | 2016-05-16 11:27:56 -0600 | [diff] [blame] | 114 | USER coreboot |
Martin Roth | 7d520ff | 2020-10-25 15:19:40 -0600 | [diff] [blame] | 115 | |
Patrick Georgi | c9e5294 | 2021-01-27 12:34:35 +0100 | [diff] [blame] | 116 | FROM coreboot-sdk |
Martin Roth | 7d520ff | 2020-10-25 15:19:40 -0600 | [diff] [blame] | 117 | # Test the built image |
| 118 | RUN mkdir -p /tmp/work && \ |
| 119 | cd /tmp/work && \ |
| 120 | git clone https://review.coreboot.org/bios_extract.git && \ |
| 121 | make -C bios_extract && \ |
| 122 | git clone https://review.coreboot.org/memtest86plus.git && \ |
| 123 | make -C memtest86plus && \ |
| 124 | git clone https://review.coreboot.org/flashrom.git && \ |
| 125 | CONFIG_EVERYTHING=yes make -C flashrom && \ |
| 126 | git clone https://review.coreboot.org/em100.git && \ |
| 127 | make -C em100 && \ |
| 128 | git clone https://review.coreboot.org/coreboot.git && \ |
Patrick Georgi | 157f9f5 | 2021-01-26 23:21:20 +0100 | [diff] [blame] | 129 | (cd coreboot && git submodule update --init --checkout ) && \ |
Patrick Georgi | c9e5294 | 2021-01-27 12:34:35 +0100 | [diff] [blame] | 130 | make -C coreboot CPUS=$(nproc) test-abuild |
| 131 | |
| 132 | RUN \ |
| 133 | cd /tmp/work && \ |
Martin Roth | 7d520ff | 2020-10-25 15:19:40 -0600 | [diff] [blame] | 134 | make -C coreboot olddefconfig && \ |
| 135 | make -C coreboot all -j && \ |
| 136 | make -C coreboot printall && \ |
| 137 | make -C coreboot filelist && \ |
| 138 | make -C coreboot ctags-project && \ |
Patrick Georgi | c9e5294 | 2021-01-27 12:34:35 +0100 | [diff] [blame] | 139 | make -C coreboot cscope-project |
| 140 | |
| 141 | RUN \ |
| 142 | cd /tmp/work && \ |
Martin Roth | 7d520ff | 2020-10-25 15:19:40 -0600 | [diff] [blame] | 143 | make -C coreboot test-payloads&& \ |
| 144 | make -C coreboot test-tools -j && \ |
| 145 | make -C coreboot test-lint -j && \ |
| 146 | make -C coreboot test-cleanup -j && \ |
Martin Roth | 7d520ff | 2020-10-25 15:19:40 -0600 | [diff] [blame] | 147 | cd && \ |
| 148 | rm -rf /tmp/work/ |
Patrick Georgi | c9e5294 | 2021-01-27 12:34:35 +0100 | [diff] [blame] | 149 | |
| 150 | FROM coreboot-sdk |
| 151 | VOLUME /home/coreboot/.ccache |