summary refs log tree commit diff
path: root/docker/Dockerfile
diff options
context:
space:
mode:
authorJianxun Zhang <jianxun.zhang@intel.com>2019-10-04 13:53:44 -0700
committerCommit Bot <commit-bot@chromium.org>2019-10-10 18:33:45 +0000
commit34533fe3ee2a0e0c6100c1fda43c9f29ff8f2222 (patch)
treef6f9521f09c76b81962b6bd38026cb952a24adff /docker/Dockerfile
parenta8adff0ff14f66570a3aa86f6106b55081526be1 (diff)
downloadcrosvm-34533fe3ee2a0e0c6100c1fda43c9f29ff8f2222.tar
crosvm-34533fe3ee2a0e0c6100c1fda43c9f29ff8f2222.tar.gz
crosvm-34533fe3ee2a0e0c6100c1fda43c9f29ff8f2222.tar.bz2
crosvm-34533fe3ee2a0e0c6100c1fda43c9f29ff8f2222.tar.lz
crosvm-34533fe3ee2a0e0c6100c1fda43c9f29ff8f2222.tar.xz
crosvm-34533fe3ee2a0e0c6100c1fda43c9f29ff8f2222.tar.zst
crosvm-34533fe3ee2a0e0c6100c1fda43c9f29ff8f2222.zip
docker: fix minigbm failure when building base image
Running ./build_crosvm_base.sh failed with the below error:

...
/scratch/minigbm/helpers.c: In function 'layout_from_format':
/scratch/minigbm/helpers.c:156:7: error: \
'DRM_FORMAT_ABGR16161616F' undeclared (first use in this function)
  case DRM_FORMAT_ABGR16161616F:
...

The header file in the libdrm-dev package from debian distro hasn't
included the missed macro. This change builds libdrm from the
upstream source to fix the issue.

BUG=None
TEST=./build_crosvm_base.sh
echo $?

Change-Id: Ifaae4313781ea02ebac9658ab8be9d990a3d5d25
Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1841890
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Diffstat (limited to 'docker/Dockerfile')
-rw-r--r--docker/Dockerfile25
1 files changed, 17 insertions, 8 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile
index b934a24..7a52ac4 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -16,12 +16,12 @@ RUN apt-get update && apt-get install -y \
     kmod \
     libcap-dev \
     libdbus-1-dev \
-    libdrm-dev \
     libegl1-mesa-dev \
     libfdt-dev \
     libgl1-mesa-dev \
     libgles1-mesa-dev \
     libgles2-mesa-dev \
+    libpciaccess-dev \
     libssl1.0-dev \
     libtool \
     libusb-1.0-0-dev \
@@ -65,6 +65,22 @@ RUN git clone https://android.googlesource.com/platform/external/minijail \
     && make -j$(nproc) \
     && cp libminijail.so /usr/lib/x86_64-linux-gnu/
 
+# New libepoxy and libdrm-dev requires newer meson than is in Debian stretch.
+ARG MESON_COMMIT=master
+RUN git clone https://github.com/mesonbuild/meson \
+    && cd meson \
+    && git checkout $MESON_COMMIT \
+    && ln -s $PWD/meson.py /usr/bin/meson
+
+# The libdrm-dev in distro can be too old to build minigbm,
+# so we build it from upstream.
+ARG DRM_COMMIT=master
+RUN git clone https://gitlab.freedesktop.org/mesa/drm \
+    && cd drm \
+    && git checkout $DRM_COMMIT \
+    && meson build \
+    && ninja -C build/ install
+
 # The gbm used by upstream linux distros is not compatible with crosvm, which must use Chrome OS's
 # minigbm.
 RUN dpkg --force-depends -r libgbm1
@@ -73,13 +89,6 @@ RUN git clone https://chromium.googlesource.com/chromiumos/platform/minigbm \
     && sed 's/-Wall/-Wno-maybe-uninitialized/g' -i Makefile \
     && make install -j$(nproc)
 
-# New libepoxy requires newer meson than is in Debian stretch.
-ARG MESON_COMMIT=master
-RUN git clone https://github.com/mesonbuild/meson \
-    && cd meson \
-    && git checkout $MESON_COMMIT \
-    && ln -s $PWD/meson.py /usr/bin/meson
-
 # New libepoxy has EGL_KHR_DEBUG entry points needed by crosvm.
 ARG LIBEPOXY_COMMIT=master
 RUN git clone https://github.com/anholt/libepoxy.git \