Skip to content

Commit

Permalink
Merge pull request #34362 from kolyshkin/update-libdevmapper
Browse files Browse the repository at this point in the history
Dockerfile*: bump devmapper library version
  • Loading branch information
cpuguy83 authored Aug 14, 2017
2 parents bb6fc72 + c4fde49 commit 31d8d22
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 62 deletions.
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,21 @@ RUN apt-get update && apt-get install -y \
zip \
--no-install-recommends \
&& pip install awscli==1.10.15
# Get lvm2 source for compiling statically
ENV LVM2_VERSION 2.02.103

# Get lvm2 sources to build statically linked devmapper library
ENV LVM2_VERSION 2.02.173
RUN mkdir -p /usr/local/lvm2 \
&& curl -fsSL "https://mirrors.kernel.org/sourceware/lvm2/LVM2.${LVM2_VERSION}.tgz" \
| tar -xzC /usr/local/lvm2 --strip-components=1
# See https://git.fedorahosted.org/cgit/lvm2.git/refs/tags for release tags

# Compile and install lvm2
# Compile and install (only the needed library)
RUN cd /usr/local/lvm2 \
&& ./configure \
--build="$(gcc -print-multiarch)" \
--enable-static_link \
&& make device-mapper \
&& make install_device-mapper
# See https://git.fedorahosted.org/cgit/lvm2.git/tree/INSTALL
--enable-pkgconfig \
&& make -C include \
&& make -C libdm install_device-mapper

# Install seccomp: the version shipped upstream is too old
ENV SECCOMP_VERSION 2.3.2
Expand Down
20 changes: 6 additions & 14 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -54,28 +54,20 @@ RUN apt-get update && apt-get install -y \
vim-common \
--no-install-recommends

# Get lvm2 source for compiling statically
ENV LVM2_VERSION 2.02.103
# Get lvm2 sources to build statically linked devmapper library
ENV LVM2_VERSION 2.02.173
RUN mkdir -p /usr/local/lvm2 \
&& curl -fsSL "https://mirrors.kernel.org/sourceware/lvm2/LVM2.${LVM2_VERSION}.tgz" \
| tar -xzC /usr/local/lvm2 --strip-components=1
# See https://git.fedorahosted.org/cgit/lvm2.git/refs/tags for release tags

# Fix platform enablement in lvm2 to support aarch64 properly
RUN set -e \
&& for f in config.guess config.sub; do \
curl -fsSL -o "/usr/local/lvm2/autoconf/$f" "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=$f;hb=HEAD"; \
done
# "arch.c:78:2: error: #error the arch code needs to know about your machine type"

# Compile and install lvm2
# Compile and install (only the needed library)
RUN cd /usr/local/lvm2 \
&& ./configure \
--build="$(gcc -print-multiarch)" \
--enable-static_link \
&& make device-mapper \
&& make install_device-mapper
# See https://git.fedorahosted.org/cgit/lvm2.git/tree/INSTALL
--enable-pkgconfig \
&& make -C include \
&& make -C libdm install_device-mapper

# Install seccomp: the version shipped upstream is too old
ENV SECCOMP_VERSION 2.3.2
Expand Down
14 changes: 7 additions & 7 deletions Dockerfile.armhf
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,21 @@ RUN apt-get update && apt-get install -y \
--no-install-recommends \
&& pip install awscli==1.10.15

# Get lvm2 source for compiling statically
ENV LVM2_VERSION 2.02.103
# Get lvm2 sources to build statically linked devmapper library
ENV LVM2_VERSION 2.02.173
RUN mkdir -p /usr/local/lvm2 \
&& curl -fsSL "https://mirrors.kernel.org/sourceware/lvm2/LVM2.${LVM2_VERSION}.tgz" \
| tar -xzC /usr/local/lvm2 --strip-components=1
# See https://git.fedorahosted.org/cgit/lvm2.git/refs/tags for release tags

# Compile and install lvm2
# Compile and install (only the needed library)
RUN cd /usr/local/lvm2 \
&& ./configure \
--build="$(gcc -print-multiarch)" \
--enable-static_link \
&& make device-mapper \
&& make install_device-mapper
# See https://git.fedorahosted.org/cgit/lvm2.git/tree/INSTALL
--enable-pkgconfig \
&& make -C include \
&& make -C libdm install_device-mapper


# Install Go
# IMPORTANT: When updating this please note that stdlib archive/tar pkg is vendored
Expand Down
20 changes: 6 additions & 14 deletions Dockerfile.ppc64le
Original file line number Diff line number Diff line change
Expand Up @@ -53,28 +53,20 @@ RUN apt-get update && apt-get install -y \
vim-common \
--no-install-recommends

# Get lvm2 source for compiling statically
ENV LVM2_VERSION 2.02.103
# Get lvm2 sources to build statically linked devmapper library
ENV LVM2_VERSION 2.02.173
RUN mkdir -p /usr/local/lvm2 \
&& curl -fsSL "https://mirrors.kernel.org/sourceware/lvm2/LVM2.${LVM2_VERSION}.tgz" \
| tar -xzC /usr/local/lvm2 --strip-components=1
# See https://git.fedorahosted.org/cgit/lvm2.git/refs/tags for release tags

# Fix platform enablement in lvm2 to support ppc64le properly
RUN set -e \
&& for f in config.guess config.sub; do \
curl -fsSL -o "/usr/local/lvm2/autoconf/$f" "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=$f;hb=HEAD"; \
done
# "arch.c:78:2: error: #error the arch code needs to know about your machine type"

# Compile and install lvm2
# Compile and install (only the needed library)
RUN cd /usr/local/lvm2 \
&& ./configure \
--build="$(gcc -print-multiarch)" \
--enable-static_link \
&& make device-mapper \
&& make install_device-mapper
# See https://git.fedorahosted.org/cgit/lvm2.git/tree/INSTALL
--enable-pkgconfig \
&& make -C include \
&& make -C libdm install_device-mapper

# Install seccomp: the version shipped upstream is too old
ENV SECCOMP_VERSION 2.3.2
Expand Down
20 changes: 6 additions & 14 deletions Dockerfile.s390x
Original file line number Diff line number Diff line change
Expand Up @@ -64,28 +64,20 @@ RUN set -x \
) \
&& rm -rf "$SECCOMP_PATH"

# Get lvm2 source for compiling statically
ENV LVM2_VERSION 2.02.103
# Get lvm2 sources to build statically linked devmapper library
ENV LVM2_VERSION 2.02.173
RUN mkdir -p /usr/local/lvm2 \
&& curl -fsSL "https://mirrors.kernel.org/sourceware/lvm2/LVM2.${LVM2_VERSION}.tgz" \
| tar -xzC /usr/local/lvm2 --strip-components=1
# See https://git.fedorahosted.org/cgit/lvm2.git/refs/tags for release tags

# Fix platform enablement in lvm2 to support s390x properly
RUN set -e \
&& for f in config.guess config.sub; do \
curl -fsSL -o "/usr/local/lvm2/autoconf/$f" "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=$f;hb=HEAD"; \
done
# "arch.c:78:2: error: #error the arch code needs to know about your machine type"

# Compile and install lvm2
# Compile and install (only the needed library)
RUN cd /usr/local/lvm2 \
&& ./configure \
--build="$(gcc -print-multiarch)" \
--enable-static_link \
&& make device-mapper \
&& make install_device-mapper
# See https://git.fedorahosted.org/cgit/lvm2.git/tree/INSTALL
--enable-pkgconfig \
&& make -C include \
&& make -C libdm install_device-mapper

# IMPORTANT: When updating this please note that stdlib archive/tar pkg is vendored
ENV GO_VERSION 1.8.3
Expand Down
2 changes: 1 addition & 1 deletion hack/make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ fi
# functionality.
if \
command -v gcc &> /dev/null \
&& ! ( echo -e '#include <libdevmapper.h>\nint main() { dm_task_deferred_remove(NULL); }'| gcc -xc - -o /dev/null -ldevmapper &> /dev/null ) \
&& ! ( echo -e '#include <libdevmapper.h>\nint main() { dm_task_deferred_remove(NULL); }'| gcc -xc - -o /dev/null $(pkg-config --libs devmapper) &> /dev/null ) \
; then
DOCKER_BUILDTAGS+=' libdm_no_deferred_remove'
fi
Expand Down
1 change: 0 additions & 1 deletion pkg/devicemapper/devmapper_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
package devicemapper

/*
#cgo LDFLAGS: -L. -ldevmapper
#define _GNU_SOURCE
#include <libdevmapper.h>
#include <linux/fs.h> // FIXME: present only for BLKGETSIZE64, maybe we can remove it?
Expand Down
5 changes: 1 addition & 4 deletions pkg/devicemapper/devmapper_wrapper_deferred_remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

package devicemapper

/*
#cgo LDFLAGS: -L. -ldevmapper
#include <libdevmapper.h>
*/
// #include <libdevmapper.h>
import "C"

// LibraryDeferredRemovalSupport tells if the feature is enabled in the build
Expand Down
6 changes: 6 additions & 0 deletions pkg/devicemapper/devmapper_wrapper_dynamic.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// +build linux,cgo,!static_build

package devicemapper

// #cgo pkg-config: devmapper
import "C"
6 changes: 6 additions & 0 deletions pkg/devicemapper/devmapper_wrapper_static.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// +build linux,cgo,static_build

package devicemapper

// #cgo pkg-config: --static devmapper
import "C"

0 comments on commit 31d8d22

Please sign in to comment.