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 | 62c6288 | 2023-06-25 22:59:38 +0200 | [diff] [blame] | 38 | gnat \ |
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 \ |
Martin Roth | 215bc53 | 2018-01-28 16:13:38 -0700 | [diff] [blame] | 48 | libftdi1-dev \ |
Martin Roth | bea2d75 | 2017-09-17 17:35:52 -0600 | [diff] [blame] | 49 | libglib2.0-dev \ |
50 | libgmp-dev \ | ||||
Martin Roth | 0cbc352 | 2023-01-20 16:58:54 -0700 | [diff] [blame] | 51 | libgpiod-dev \ |
Nico Huber | 885d963 | 2018-08-16 23:11:55 +0200 | [diff] [blame] | 52 | libjaylink-dev \ |
Martin Roth | bea2d75 | 2017-09-17 17:35:52 -0600 | [diff] [blame] | 53 | liblzma-dev \ |
Martin Roth | baf8280 | 2023-07-21 14:36:59 -0600 | [diff] [blame] | 54 | libncurses-dev \ |
Martin Roth | bea2d75 | 2017-09-17 17:35:52 -0600 | [diff] [blame] | 55 | libpci-dev \ |
56 | libreadline-dev \ | ||||
Martin Roth | d727fb5 | 2019-04-05 09:53:16 -0600 | [diff] [blame] | 57 | libssl-dev \ |
Martin Roth | bea2d75 | 2017-09-17 17:35:52 -0600 | [diff] [blame] | 58 | libusb-1.0-0-dev \ |
Martin Roth | bea2d75 | 2017-09-17 17:35:52 -0600 | [diff] [blame] | 59 | libxml2-dev \ |
60 | libyaml-dev \ | ||||
61 | m4 \ | ||||
62 | make \ | ||||
Martin Roth | bf78d07 | 2018-01-22 21:29:06 -0700 | [diff] [blame] | 63 | msitools \ |
Piotr Król | f57f131 | 2017-10-09 00:46:24 +0200 | [diff] [blame] | 64 | nasm \ |
Martin Roth | bea2d75 | 2017-09-17 17:35:52 -0600 | [diff] [blame] | 65 | openssl \ |
Martin Roth | bea2d75 | 2017-09-17 17:35:52 -0600 | [diff] [blame] | 66 | patch \ |
Martin Roth | bd8e6dd | 2020-10-25 15:07:07 -0600 | [diff] [blame] | 67 | pbzip2 \ |
Martin Roth | bea2d75 | 2017-09-17 17:35:52 -0600 | [diff] [blame] | 68 | pkg-config \ |
Martin Roth | 1ba86f6 | 2020-09-10 08:59:35 -0600 | [diff] [blame] | 69 | python3 \ |
Elyes Haouas | fda10a4 | 2023-06-17 10:36:53 +0200 | [diff] [blame] | 70 | python-is-python3 \ |
Felix Singer | acbdc4d | 2022-08-20 11:16:05 +0200 | [diff] [blame] | 71 | qemu-system-arm \ |
72 | qemu-system-misc \ | ||||
73 | qemu-system-ppc \ | ||||
74 | qemu-system-x86 \ | ||||
Martin Roth | bf78d07 | 2018-01-22 21:29:06 -0700 | [diff] [blame] | 75 | rsync \ |
Martin Roth | bea2d75 | 2017-09-17 17:35:52 -0600 | [diff] [blame] | 76 | shellcheck \ |
Martin Roth | bea2d75 | 2017-09-17 17:35:52 -0600 | [diff] [blame] | 77 | unifont \ |
Martin Roth | bea2d75 | 2017-09-17 17:35:52 -0600 | [diff] [blame] | 78 | uuid-dev \ |
79 | vim-common \ | ||||
80 | wget \ | ||||
81 | xz-utils \ | ||||
82 | zlib1g-dev \ | ||||
Elyes Haouas | 33201ab | 2023-07-24 19:44:12 +0200 | [diff] [blame^] | 83 | && apt-get clean |
Martin Roth | 2d97cb1 | 2016-05-16 11:27:56 -0600 | [diff] [blame] | 84 | |
85 | RUN \ | ||||
Martin Roth | ebeec5a | 2020-10-25 15:16:00 -0600 | [diff] [blame] | 86 | cd /tmp && \ |
Paul Menzel | a8843de | 2017-06-05 12:33:23 +0200 | [diff] [blame] | 87 | git clone https://review.coreboot.org/coreboot && \ |
Nico Huber | dd477e9 | 2018-11-04 16:16:29 +0100 | [diff] [blame] | 88 | cd coreboot && \ |
Martin Roth | ebeec5a | 2020-10-25 15:16:00 -0600 | [diff] [blame] | 89 | git checkout {{DOCKER_COMMIT}}; \ |
Nico Huber | dd477e9 | 2018-11-04 16:16:29 +0100 | [diff] [blame] | 90 | if echo {{CROSSGCC_PARAM}} | grep -q ^all; then \ |
Martin Roth | ebeec5a | 2020-10-25 15:16:00 -0600 | [diff] [blame] | 91 | make -C /tmp/coreboot/util/crossgcc/ build_clang \ |
Nico Huber | dd477e9 | 2018-11-04 16:16:29 +0100 | [diff] [blame] | 92 | BUILD_LANGUAGES=c,ada CPUS=$(nproc) DEST=/opt/xgcc; \ |
Martin Roth | ebeec5a | 2020-10-25 15:16:00 -0600 | [diff] [blame] | 93 | fi; \ |
94 | make -C /tmp/coreboot/util/crossgcc/ {{CROSSGCC_PARAM}} \ | ||||
Martin Roth | f0eda82 | 2017-03-23 16:13:58 -0600 | [diff] [blame] | 95 | BUILD_LANGUAGES=c,ada CPUS=$(nproc) DEST=/opt/xgcc && \ |
Martin Roth | ebeec5a | 2020-10-25 15:16:00 -0600 | [diff] [blame] | 96 | rm -rf /tmp/coreboot |
Martin Roth | 2d97cb1 | 2016-05-16 11:27:56 -0600 | [diff] [blame] | 97 | |
98 | RUN mkdir /home/coreboot/.ccache && \ | ||||
99 | chown coreboot:coreboot /home/coreboot/.ccache && \ | ||||
100 | mkdir /home/coreboot/cb_build && \ | ||||
Martin Roth | bea2d75 | 2017-09-17 17:35:52 -0600 | [diff] [blame] | 101 | chown coreboot:coreboot /home/coreboot/cb_build && \ |
102 | echo "export PATH=$PATH:/opt/xgcc/bin" >> /home/coreboot/.bashrc && \ | ||||
103 | echo "export SDK_VERSION={{SDK_VERSION}}" >> /home/coreboot/.bashrc && \ | ||||
104 | echo "export SDK_COMMIT={{DOCKER_COMMIT}}" >> /home/coreboot/.bashrc | ||||
105 | |||||
Martin Roth | f75d1df | 2016-05-16 11:27:56 -0600 | [diff] [blame] | 106 | ENV PATH $PATH:/opt/xgcc/bin |
Martin Roth | 561f368 | 2016-12-30 17:00:19 -0700 | [diff] [blame] | 107 | ENV SDK_VERSION={{SDK_VERSION}} |
108 | ENV SDK_COMMIT={{DOCKER_COMMIT}} | ||||
Martin Roth | f75d1df | 2016-05-16 11:27:56 -0600 | [diff] [blame] | 109 | USER coreboot |
Martin Roth | 7d520ff | 2020-10-25 15:19:40 -0600 | [diff] [blame] | 110 | |
Patrick Georgi | c9e5294 | 2021-01-27 12:34:35 +0100 | [diff] [blame] | 111 | FROM coreboot-sdk |
Patrick Georgi | c9e5294 | 2021-01-27 12:34:35 +0100 | [diff] [blame] | 112 | VOLUME /home/coreboot/.ccache |