Skip to contentSkip to conversation

package/btrfs-progs: install to staging directory

PATCH New Christian Stewart 3 participants 11 messages Jul 24, 2016 – Jul 28, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v11 1/2 package/btrfs-progs: install to staging directory

Other packages when building against btrfs-progs require headers in the staging directory under /usr/include/btrfs. This patch enables installing btrfs-progs to the staging directory to enable other packages to build against the btrfs-progs headers.

---
 package/btrfs-progs/btrfs-progs.mk | 1 +
 1 file changed, 1 insertion(+)
package/btrfs-progs/btrfs-progs.mk +1 -0
index 2c3dc50..8d50eb4 100644
@@ -11,6 +11,7 @@ BTRFS_PROGS_DEPENDENCIES = host-pkgconf e2fsprogs lzo util-linux zlib
 BTRFS_PROGS_CONF_OPTS = --disable-backtrace
 BTRFS_PROGS_LICENSE = GPLv2
 BTRFS_PROGS_LICENSE_FILES = COPYING
+BTRFS_PROGS_INSTALL_STAGING = YES
 
 # Doesn't autodetect static-only and tries to build both
 ifeq ($(BR2_STATIC_LIBS),y)
Signature · 1 line
2.7.3
#1 lore raw

PATCH v11 2/2 docker-engine: new package

Docker is a platform to build, ship, and run applications in portable containers.

---

Changes since v1:
- use call github to build source URL
Changes since v3:
- fix help indentation in Config.in
- use HOST_GO_TARGET_ENV as a base for build env vars
- cleanup build commands
- cleanup GOPATH and vendor directory setup
- Remove selections for graph drivers. Docker will gracefully degrade at runtime to the best available graphdriver. It is unnecessary to disable these at build time, or to pull in any other dependencies like aufs-util or btrfs tools. The daemon will use whatever is available at runtime.
Changes since v4:
- remove commit hash from version scheme
Changes since v5:
- re-introduce graphdriver selections
- these selections are required for btrfs and devicemapper
- there are buildtime dependencies on headers.
- bump to v1.12.0-rc3
- remove hack/vendor.sh call, it is unnecessary, dependencies are pre-vendored into the source tree.
Changes since v6:
- remove build-time dependency on docker-containerd and runc
- install dockerd only if daemon is enabled
- move all daemon dependencies into daemon selection
- only install sysv, users, etc if daemon is enabled
- add a proper sysv init file
- remove DOCKER_OPTS in init file
- remove test for $BASH as bash is never used for init
- use hash for documentation link in sysv init file
- remove unnecessary path change in sysv init file
- remove exit on error line in sysv init file
- remove init info comment from sysv init file
Changes since v7:
- remove "-static" cgo flag which fixes build of btrfs and other additional filesystem drivers.
- build + run test with alternate filesystem drivers.
Changes since v8:
- Bump to v1.12.0-rc4
Changes since v9:
- Introduce patch to fix docker log file rotation issue
- Restructure build targets to use a foreach loop
- Remove "select" duplicates from docker-containerd
- Added BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
- Rename docker.init to S61docker
- Add -static if BR2_STATIC_LIBS is enabled.
- Remove sysv init file to be added in later patch
Changes since v10:
- Add note about reason for extra patch
- Remove requirement on MMU and WCHAR
- Fix indentation on foreach loop
- Select docker-containerd
- Remove CPATH modification due to btrfs-progs patch

---
 package/Config.in                                  |   1 +
 ...-issues-with-tailing-rotated-jsonlog-file.patch | 297 +++++++++++++++++++++
 package/docker-engine/Config.in                    |  64 +++++
 package/docker-engine/docker-engine.hash           |   2 +
 package/docker-engine/docker-engine.mk             | 108 ++++++++
 5 files changed, 472 insertions(+)
 create mode 100644 package/docker-engine/0001-Fix-issues-with-tailing-rotated-jsonlog-file.patch
 create mode 100644 package/docker-engine/Config.in
 create mode 100644 package/docker-engine/docker-engine.hash
 create mode 100644 package/docker-engine/docker-engine.mk
package/Config.in +1 -0
index 814141f..42a9ff5 100644
@@ -1675,6 +1675,7 @@ menu "System tools"
 	source "package/dcron/Config.in"
 	source "package/debianutils/Config.in"
 	source "package/docker-containerd/Config.in"
+	source "package/docker-engine/Config.in"
 	source "package/dsp-tools/Config.in"
 	source "package/efibootmgr/Config.in"
 	source "package/efivar/Config.in"
package/docker-engine/0001-Fix-issues-with-tailing-rotated-jsonlog-file.patch new file +297 -0

297 lines not on this page · raw message

package/docker-engine/Config.in new file +64 -0

64 lines not on this page · raw message

package/docker-engine/docker-engine.hash new file +2 -0
new file mode 100644
index 0000000..1de09f8
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256 bc256d2a348efbf236eab991254c925fa1917dd1e29cb40586f1696f4e24852e  docker-engine-v1.12.0-rc4.tar.gz
package/docker-engine/docker-engine.mk new file +108 -0

108 lines not on this page · raw message

Signature · 1 line
2.7.3
#2 lore raw

PATCH v11 2/2 docker-engine: new package

Thomas,

package/docker-engine/docker-engine.mk line 21

Quoted 2 lines · Christian Stewart
package/docker-engine/docker-engine.mk new file +2 -0
+       GOPATH="$(DOCKER_ENGINE_GOPATH)" \
+       LIBRARY_PATH=$$LIBRARY_PATH:$(TARGET_DIR)/usr/lib/

The last line here can also be removed.

This version tested on aarch64, arm, and amd64 with the aufs and overlayfs drivers, no problems.

Best,
Christian

#3 lore raw

PATCH v11 2/2 docker-engine: new package

In reply to Christian Stewart

Hello,

Quoted 4 lines · Christian Stewart

Docker is a platform to build, ship, and run applications in portable containers.

I've applied after removing the LIBRARY_PATH variable, as you suggested.

However, there is still one thing I'm not happy with: dockerd is linked statically against libbtrfs. It links dynamically against libdevmapper.so, because there is no libdevmapper.a installed. However, since libbtrfs is available in STAGING_DIR as both a shared library *and* a static library, the Go build logic seems to prefer the static library. This is definitely *not* what we want in the context of Buildroot.

See:

$ arm-linux-gnueabihf-readelf -d output/target/usr/bin/dockerd | grep NEEDED
 0x00000001 (NEEDED)                     Shared library: [libpthread.so.0]
 0x00000001 (NEEDED)                     Shared library: [libdl.so.0]
 0x00000001 (NEEDED)                     Shared library: [libdevmapper.so.1.02]
 0x00000001 (NEEDED)                     Shared library: [libc.so.0]
$ grep DOCKER_ENGINE .config
BR2_PACKAGE_DOCKER_ENGINE=y
BR2_PACKAGE_DOCKER_ENGINE_DAEMON=y
# BR2_PACKAGE_DOCKER_ENGINE_EXPERIMENTAL is not set
BR2_PACKAGE_DOCKER_ENGINE_DRIVER_BTRFS=y
BR2_PACKAGE_DOCKER_ENGINE_DRIVER_DEVICEMAPPER=y
BR2_PACKAGE_DOCKER_ENGINE_DRIVER_VFS=y
$ ls -l output/staging/usr/lib/libbtrfs.*
-rwxr-xr-x 1 thomas thomas 49938 juil. 27 23:26 output/staging/usr/lib/libbtrfs.a
lrwxrwxrwx 1 thomas thomas    15 juil. 27 23:26 output/staging/usr/lib/libbtrfs.so -> libbtrfs.so.0.1
lrwxrwxrwx 1 thomas thomas    15 juil. 27 23:26 output/staging/usr/lib/libbtrfs.so.0 -> libbtrfs.so.0.1
-rwxr-xr-x 1 thomas thomas 44012 juil. 27 23:26 output/staging/usr/lib/libbtrfs.so.0.1
$ ls -l output/staging/usr/lib/libdevmapper.*
lrwxrwxrwx 1 thomas thomas     20 juil. 27 23:32 output/staging/usr/lib/libdevmapper.so -> libdevmapper.so.1.02
-rwxr-xr-x 1 thomas thomas 454192 juil. 27 23:32 output/staging/usr/lib/libdevmapper.so.1.02

Could you investigate this?

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#4 lore raw

PATCH v11 2/2 docker-engine: new package

Thomas,

Quoted 1 line · Thomas Petazzoni

I've applied after removing the LIBRARY_PATH variable, as you suggested.

Great, thanks.

Quoted 7 lines

However, there is still one thing I'm not happy with: dockerd is linked statically against libbtrfs. It links dynamically against libdevmapper.so, because there is no libdevmapper.a installed. However, since libbtrfs is available in STAGING_DIR as both a shared library *and* a static library, the Go build logic seems to prefer the static library. This is definitely *not* what we want in the context of Buildroot.

This is more of Geoff's expertise, I'll defer to him but will investigate down the line if he is unavailable to comment.

Thanks,
Christian

#5 lore raw

PATCH v11 2/2 docker-engine: new package

In reply to Thomas Petazzoni
Quoted 13 lines · Thomas Petazzoni

Hello,

Quoted 4 lines · Christian Stewart

Docker is a platform to build, ship, and run applications in portable containers.

I've applied after removing the LIBRARY_PATH variable, as you suggested.

Quoted 7 lines

However, there is still one thing I'm not happy with: dockerd is linked statically against libbtrfs. It links dynamically against libdevmapper.so, because there is no libdevmapper.a installed. However, since libbtrfs is available in STAGING_DIR as both a shared library *and* a static library, the Go build logic seems to prefer the static library. This is definitely *not* what we want in the context of Buildroot.

you would need atleast go 1.5+ for dynamic libraries support. If thats not an issue then simply change the build cmds to something like

go build -linkshared ...

Quoted 26 lines

See:

$ arm-linux-gnueabihf-readelf -d output/target/usr/bin/dockerd | grep NEEDED
0x00000001 (NEEDED)                     Shared library: [libpthread.so.0]
0x00000001 (NEEDED)                     Shared library: [libdl.so.0]
0x00000001 (NEEDED)                     Shared library: [libdevmapper.so.1.02]
0x00000001 (NEEDED)                     Shared library: [libc.so.0]
$ grep DOCKER_ENGINE .config
BR2_PACKAGE_DOCKER_ENGINE=y
BR2_PACKAGE_DOCKER_ENGINE_DAEMON=y
# BR2_PACKAGE_DOCKER_ENGINE_EXPERIMENTAL is not set
BR2_PACKAGE_DOCKER_ENGINE_DRIVER_BTRFS=y
BR2_PACKAGE_DOCKER_ENGINE_DRIVER_DEVICEMAPPER=y
BR2_PACKAGE_DOCKER_ENGINE_DRIVER_VFS=y
$ ls -l output/staging/usr/lib/libbtrfs.*
-rwxr-xr-x 1 thomas thomas 49938 juil. 27 23:26 output/staging/usr/lib/libbtrfs.a
lrwxrwxrwx 1 thomas thomas    15 juil. 27 23:26 output/staging/usr/lib/libbtrfs.so -> libbtrfs.so.0.1
lrwxrwxrwx 1 thomas thomas    15 juil. 27 23:26 output/staging/usr/lib/libbtrfs.so.0 -> libbtrfs.so.0.1
-rwxr-xr-x 1 thomas thomas 44012 juil. 27 23:26 output/staging/usr/lib/libbtrfs.so.0.1
$ ls -l output/staging/usr/lib/libdevmapper.*
lrwxrwxrwx 1 thomas thomas     20 juil. 27 23:32 output/staging/usr/lib/libdevmapper.so -> libdevmapper.so.1.02
-rwxr-xr-x 1 thomas thomas 454192 juil. 27 23:32 output/staging/usr/lib/libdevmapper.so.1.02

Could you investigate this?

Quoted 9 lines

Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160727/9fb13439/attachment.asc>

#6 lore raw

PATCH v11 2/2 docker-engine: new package

Hello,

Quoted 4 lines · Khem Raj

you would need atleast go 1.5+ for dynamic libraries support. If thats not an issue then simply change the build cmds to something like

go build -linkshared ...

We have go 1.6.2, and it *does* link with dynamic libraries, see below:

Quoted 5 lines
Quoted 5 lines
$ arm-linux-gnueabihf-readelf -d output/target/usr/bin/dockerd | grep NEEDED
0x00000001 (NEEDED)                     Shared library: [libpthread.so.0]
0x00000001 (NEEDED)                     Shared library: [libdl.so.0]
0x00000001 (NEEDED)                     Shared library: [libdevmapper.so.1.02]
0x00000001 (NEEDED)                     Shared library: [libc.so.0]

However, it doesn't link some libraries as dynamic, and some others as static, for some reason.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#7 lore raw

PATCH v11 1/2 package/btrfs-progs: install to staging directory

In reply to Christian Stewart

Hello,

package/btrfs-progs/btrfs-progs.mk BTRFS_PROGS_DEPENDENCIES = host-pkgconf e2fsprogs lzo util-linux zlib · line 17

Quoted 12 lines · Christian Stewart
package/btrfs-progs/btrfs-progs.mk +1 -0
index 2c3dc50..8d50eb4 100644
@@ -11,6 +11,7 @@ BTRFS_PROGS_DEPENDENCIES = host-pkgconf e2fsprogs lzo util-linux zlib
 BTRFS_PROGS_CONF_OPTS = --disable-backtrace
 BTRFS_PROGS_LICENSE = GPLv2
 BTRFS_PROGS_LICENSE_FILES = COPYING
+BTRFS_PROGS_INSTALL_STAGING = YES
 
 # Doesn't autodetect static-only and tries to build both
 ifeq ($(BR2_STATIC_LIBS),y)

Unfortunately, this breaks the build in a BR2_STATIC_LIBS=y configuration. So I've tried adding:

BTRFS_PROGS_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) install-static

in the existing ifeq ($(BR2_STATIC_LIBS),y). It fixes the build but it isn't correct: it only installs the programs, and not the headers and the static library.

So it seems like a btrfs-progs patch is needed to make this whole thing work properly :-/

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#8 lore raw

PATCH v11 1/2 package/btrfs-progs: install to staging directory

Thomas,

Quoted 2 lines · Thomas Petazzoni

So it seems like a btrfs-progs patch is needed to make this whole thing work properly :-/

A few short term solutions are:

- Remove btrfs support from docker-engine temporarily until a fix is
made to btrfs-progs
- Source the headers from $(TARGET_DIR) as before temporarily,
resorting to bad practice
- Copy the headers from $(TARGET_DIR) to $(STAGING_DIR) in a
post-build hook of btrfs-progs.

Would any of these options be acceptable to you?

Thanks!
Christian

#9 lore raw

PATCH v11 1/2 package/btrfs-progs: install to staging directory

Hello,

Quoted 8 lines · Christian Stewart

- Remove btrfs support from docker-engine temporarily until a fix is
made to btrfs-progs
- Source the headers from $(TARGET_DIR) as before temporarily,
resorting to bad practice
- Copy the headers from $(TARGET_DIR) to $(STAGING_DIR) in a
post-build hook of btrfs-progs.

Would any of these options be acceptable to you?

Not really no. The good solution is:

- Patch the btrfs-progs Makefile to support installing the headers and static library

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#10 lore raw

PATCH v11 1/2 package/btrfs-progs: install to staging directory

In reply to Christian Stewart

Hello,

Quoted 9 lines · Christian Stewart

Other packages when building against btrfs-progs require headers in the staging directory under /usr/include/btrfs. This patch enables installing btrfs-progs to the staging directory to enable other packages to build against the btrfs-progs headers.

---
 package/btrfs-progs/btrfs-progs.mk | 1 +
 1 file changed, 1 insertion(+)

I've applied after fixing the BR2_STATIC_LIBS=y case, by:

1/ Adding a BTRFS_PROGS_INSTALL_STAGING_OPTS variable

2/ Adding a patch that installs the static lib and the headers during
"make install-static".

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com