Update buidlroot to version 2016.08.1

This commit is contained in:
2016-11-16 22:07:29 +01:00
parent 807ab03547
commit a1061efbc2
3636 changed files with 59539 additions and 25783 deletions

View File

@@ -0,0 +1,53 @@
From d8d70559a279706c206761dfaf665d2197934123 Mon Sep 17 00:00:00 2001
From: Gustavo Zacarias <gustavo@zacarias.com.ar>
Date: Sun, 6 Mar 2016 22:52:02 +0100
Subject: [PATCH] build-system: fixes for cross-compilation
Avoid the libcap buildsys forcing CC/CFLAGS/LDFLAGS/AR/RANLIB
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
[yann.morin.1998@free.fr: dont chmod +x the shared lib]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
diff --git a/Make.Rules b/Make.Rules
index 8347b26..8a07a3f 100644
--- a/Make.Rules
+++ b/Make.Rules
@@ -48,26 +48,26 @@ MINOR=25
KERNEL_HEADERS := $(topdir)/libcap/include/uapi
IPATH += -fPIC -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include
-CC := gcc
-CFLAGS := -O2 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-BUILD_CC := $(CC)
-BUILD_CFLAGS := $(CFLAGS) $(IPATH)
-AR := ar
-RANLIB := ranlib
+CC ?= gcc
+CFLAGS ?= -O2 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+BUILD_CC ?= $(CC)
+BUILD_CFLAGS ?= $(CFLAGS) $(IPATH)
+AR ?= ar
+RANLIB ?= ranlib
DEBUG = -g #-DDEBUG
WARNINGS=-Wall -Wwrite-strings \
-Wpointer-arith -Wcast-qual -Wcast-align \
-Wstrict-prototypes -Wmissing-prototypes \
-Wnested-externs -Winline -Wshadow
LD=$(CC) -Wl,-x -shared
-LDFLAGS := #-g
+LDFLAGS ?= #-g
BUILD_GPERF := $(shell which gperf >/dev/null 2>/dev/null && echo yes)
SYSTEM_HEADERS = /usr/include
INCS=$(topdir)/libcap/include/sys/capability.h
LDFLAGS += -L$(topdir)/libcap
CFLAGS += -Dlinux $(WARNINGS) $(DEBUG)
-PAM_CAP := $(shell if [ -f /usr/include/security/pam_modules.h ]; then echo yes ; else echo no ; fi)
+PAM_CAP = no
INDENT := $(shell if [ -n "$$(which indent 2>/dev/null)" ]; then echo "| indent -kr" ; fi)
DYNAMIC := $(shell if [ ! -d "$(topdir)/.git" ]; then echo yes; fi)
--
1.9.1

View File

@@ -1,54 +0,0 @@
Avoid the libcap buildsys forcing CC/CFLAGS/LDFLAGS/AR/RANLIB
Also install the shared lib +x
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
diff -Nura libcap-2.22.orig/libcap/Makefile libcap-2.22/libcap/Makefile
--- libcap-2.22.orig/libcap/Makefile 2010-08-08 19:26:04.000000000 -0300
+++ libcap-2.22/libcap/Makefile 2011-12-14 11:33:51.761800334 -0300
@@ -65,7 +65,7 @@
install -m 0644 include/sys/capability.h $(INCDIR)/sys
mkdir -p -m 0755 $(LIBDIR)
install -m 0644 $(STALIBNAME) $(LIBDIR)/$(STALIBNAME)
- install -m 0644 $(MINLIBNAME) $(LIBDIR)/$(MINLIBNAME)
+ install -m 0755 $(MINLIBNAME) $(LIBDIR)/$(MINLIBNAME)
ln -sf $(MINLIBNAME) $(LIBDIR)/$(MAJLIBNAME)
ln -sf $(MAJLIBNAME) $(LIBDIR)/$(LIBNAME)
ifeq ($(FAKEROOT),)
diff -Nura libcap-2.22.orig/Make.Rules libcap-2.22/Make.Rules
--- libcap-2.22.orig/Make.Rules 2011-07-24 23:18:23.000000000 -0300
+++ libcap-2.22/Make.Rules 2011-12-14 11:33:28.707278685 -0300
@@ -47,25 +47,25 @@
KERNEL_HEADERS := $(topdir)/libcap/include
IPATH += -fPIC -I$(topdir)/libcap/include -I$(KERNEL_HEADERS)
-CC := gcc
-CFLAGS := -O2 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-BUILD_CC := $(CC)
-BUILD_CFLAGS := $(CFLAGS) $(IPATH)
-AR := ar
-RANLIB := ranlib
+CC ?= gcc
+CFLAGS ?= -O2 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+BUILD_CC ?= $(CC)
+BUILD_CFLAGS ?= $(CFLAGS) $(IPATH)
+AR ?= ar
+RANLIB ?= ranlib
DEBUG = -g #-DDEBUG
WARNINGS=-Wall -Wwrite-strings \
-Wpointer-arith -Wcast-qual -Wcast-align \
-Wstrict-prototypes -Wmissing-prototypes \
-Wnested-externs -Winline -Wshadow
LD=$(CC) -Wl,-x -shared
-LDFLAGS := #-g
+LDFLAGS ?= #-g
SYSTEM_HEADERS = /usr/include
INCS=$(topdir)/libcap/include/sys/capability.h
LDFLAGS += -L$(topdir)/libcap
CFLAGS += -Dlinux $(WARNINGS) $(DEBUG)
-PAM_CAP := $(shell if [ -f /usr/include/security/pam_modules.h ]; then echo yes ; else echo no ; fi)
+PAM_CAP = no
INDENT := $(shell if [ -n "$(which indent 2>/dev/null)" ]; then echo "| indent -kr" ; fi)
DYNAMIC := $(shell if [ ! -d "$(topdir)/.git" ]; then echo yes; fi)
LIBATTR := yes

View File

@@ -0,0 +1,48 @@
From af21635665ab568f3333ff9fe8b474f4950e5acb Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Date: Sun, 6 Mar 2016 22:53:24 +0100
Subject: [PATCH] libcap: split install into install-shared/install-static
In order to support static only builds, split the install target into
install-shared and install-static targets.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[yann.morin.1998@free.fr: install the .pc file in the common rule]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
diff --git a/libcap/Makefile b/libcap/Makefile
index d189777..44ddb27 100644
--- a/libcap/Makefile
+++ b/libcap/Makefile
@@ -62,19 +62,25 @@ $(MINLIBNAME): $(OBJS)
cap_text.o: cap_text.c $(USE_GPERF_OUTPUT) $(INCLS)
$(CC) $(CFLAGS) $(IPATH) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
-install: all
+install: install-shared install-static
+
+install-common:
mkdir -p -m 0755 $(FAKEROOT)$(INCDIR)/sys
install -m 0644 include/sys/capability.h $(FAKEROOT)$(INCDIR)/sys
+ mkdir -p -m 0755 $(FAKEROOT)$(PKGCONFIGDIR)
+ install -m 0644 libcap.pc $(FAKEROOT)$(PKGCONFIGDIR)/libcap.pc
+
+install-static: $(STALIBNAME) install-common
mkdir -p -m 0755 $(FAKEROOT)$(LIBDIR)
install -m 0644 $(STALIBNAME) $(FAKEROOT)$(LIBDIR)/$(STALIBNAME)
+
+install-shared: $(MINLIBNAME) install-common
install -m 0644 $(MINLIBNAME) $(FAKEROOT)$(LIBDIR)/$(MINLIBNAME)
ln -sf $(MINLIBNAME) $(FAKEROOT)$(LIBDIR)/$(MAJLIBNAME)
ln -sf $(MAJLIBNAME) $(FAKEROOT)$(LIBDIR)/$(LIBNAME)
ifeq ($(FAKEROOT),)
-/sbin/ldconfig
endif
- mkdir -p -m 0755 $(FAKEROOT)$(PKGCONFIGDIR)
- install -m 0644 libcap.pc $(FAKEROOT)$(PKGCONFIGDIR)/libcap.pc
clean:
$(LOCALCLEAN)
--
1.9.1

View File

@@ -1,30 +0,0 @@
libcap: split install into install-shared/install-static
In order to support static only builds, split the install target into
install-shared and install-static targets.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Index: b/libcap/Makefile
===================================================================
--- a/libcap/Makefile
+++ b/libcap/Makefile
@@ -60,11 +60,17 @@
cap_text.o: cap_text.c $(USE_GPERF_OUTPUT) $(INCLS)
$(CC) $(CFLAGS) $(IPATH) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
-install: all
+install: install-shared install-static
+
+install-common:
mkdir -p -m 0755 $(INCDIR)/sys
install -m 0644 include/sys/capability.h $(INCDIR)/sys
mkdir -p -m 0755 $(LIBDIR)
+
+install-static: install-common
install -m 0644 $(STALIBNAME) $(LIBDIR)/$(STALIBNAME)
+
+install-shared: install-common
install -m 0755 $(MINLIBNAME) $(LIBDIR)/$(MINLIBNAME)
ln -sf $(MINLIBNAME) $(LIBDIR)/$(MAJLIBNAME)
ln -sf $(MAJLIBNAME) $(LIBDIR)/$(LIBNAME)

View File

@@ -1,46 +0,0 @@
From 84fb6007dcc7f6b6da9f6dab77a487c22b6c7beb Mon Sep 17 00:00:00 2001
From: Andrew G Morgan <morgan@kernel.org>
Date: Sun, 9 Mar 2014 16:33:15 -0700
Subject: [PATCH] Change the location we include linux/xattr.h
This header stuff seems a bit fragile, but Serge reports including
it in sys/capability.h was causing a lot of trouble building dependent
app packages.
From the perspective of libcap, this API is only needed internally in
cap_file.c so we put an include there.
Status: upstream.
Signed-off-by: Andrew G Morgan <morgan@kernel.org>
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
diff --git a/libcap/cap_file.c b/libcap/cap_file.c
index d3dc1d0..553c2d2 100644
--- a/libcap/cap_file.c
+++ b/libcap/cap_file.c
@@ -10,6 +10,8 @@
#include <sys/stat.h>
#include <unistd.h>
+#include <linux/xattr.h>
+
#define XATTR_SECURITY_PREFIX "security."
#include "libcap.h"
diff --git a/libcap/include/sys/capability.h b/libcap/include/sys/capability.h
index 64ac50e..dddc75b 100644
--- a/libcap/include/sys/capability.h
+++ b/libcap/include/sys/capability.h
@@ -27,7 +27,6 @@ extern "C" {
#define __user
#endif
#include <linux/capability.h>
-#include <linux/xattr.h>
/*
* POSIX capability types
--
2.0.4

View File

@@ -0,0 +1,51 @@
From ace694e9574eb38e07cfe0db235434eb40003f47 Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Date: Mon, 14 Mar 2016 22:39:15 +0100
Subject: [PATCH] libcap/cap_file.c: fix build with old kernel headers
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
libcap/cap_file.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/libcap/cap_file.c b/libcap/cap_file.c
index 40756ea..e3d54dd 100644
--- a/libcap/cap_file.c
+++ b/libcap/cap_file.c
@@ -23,6 +23,33 @@ extern int fsetxattr(int, const char *, const void *, size_t, int);
extern int removexattr(const char *, const char *);
extern int fremovexattr(int, const char *);
+
+/*
+ * Old kernels (before 2.6.36) were defining XATTR_NAME_CAPS in
+ * <linux/capability.h>, but using XATTR_SECURITY_PREFIX and
+ * XATTR_CAPS_SUFFIX which were defined in the kernel-only part of
+ * <linux/xattr.h>.
+ *
+ * In kernel 2.6.36 (commit af4f136056c984b0aa67feed7d3170b958370b2f),
+ * the XATTR_NAME_CAPS definition was moved to the kernel-only part of
+ * <linux/xattr.h>. It's only in kernel 3.0 (commit
+ * 1dbe39424a43e56a6c9aed12661192af51dcdb9f) that <linux/xattr.h> was
+ * fixed to expose XATTR_NAME_CAPS and the related definitions to
+ * userspace.
+ *
+ * In order to cope with kernels < 3.0, we define here the appropriate
+ * values, which we assume haven't changed over history.
+ */
+#ifndef XATTR_CAPS_SUFFIX
+#define XATTR_CAPS_SUFFIX "capability"
+#endif
+#ifndef XATTR_SECURITY_PREFIX
+#define XATTR_SECURITY_PREFIX "security."
+#endif
+#ifndef XATTR_NAME_CAPS
+#define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX
+#endif
+
#include "libcap.h"
#ifdef VFS_CAP_U32
--
2.6.4

View File

@@ -1,6 +1,5 @@
config BR2_PACKAGE_LIBCAP
bool "libcap"
depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0 # XATTR_NAME_CAPS
help
This library implements the user-space interfaces to the
POSIX 1003.1e capabilities available in Linux kernels. These
@@ -23,6 +22,3 @@ config BR2_PACKAGE_LIBCAP_TOOLS
CONFIG_EXT2_FS_XATTR and CONFIG_EXT2_FS_SECURITY for ext2).
endif
comment "libcap needs a toolchain w/ headers >= 3.0"
depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0

View File

@@ -1,2 +1,2 @@
# https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/sha256sums.asc
sha256 cee4568f78dc851d726fc93f25f4ed91cc223b1fe8259daa4a77158d174e6c65 libcap-2.24.tar.xz
sha256 693c8ac51e983ee678205571ef272439d83afe62dd8e424ea14ad9790bc35162 libcap-2.25.tar.xz

View File

@@ -4,27 +4,19 @@
#
################################################################################
LIBCAP_VERSION = 2.24
LIBCAP_VERSION = 2.25
LIBCAP_SITE = https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2
LIBCAP_SOURCE = libcap-$(LIBCAP_VERSION).tar.xz
LIBCAP_LICENSE = GPLv2 or BSD-3c
LIBCAP_LICENSE_FILES = License
LIBCAP_DEPENDENCIES = host-libcap
LIBCAP_DEPENDENCIES = host-libcap host-gperf
LIBCAP_INSTALL_STAGING = YES
ifeq ($(BR2_PACKAGE_ATTR),y)
LIBCAP_DEPENDENCIES += attr
LIBCAP_HAVE_LIBATTR = yes
else
LIBCAP_HAVE_LIBATTR = no
endif
# we don't have host-attr
HOST_LIBCAP_DEPENDENCIES =
HOST_LIBCAP_DEPENDENCIES = host-gperf
ifeq ($(BR2_STATIC_LIBS),y)
LIBCAP_MAKE_TARGET = libcap.a
LIBCAP_MAKE_TARGET = libcap.a libcap.pc
LIBCAP_MAKE_INSTALL_TARGET = install-static
else
LIBCAP_MAKE_TARGET = all
@@ -32,7 +24,6 @@ LIBCAP_MAKE_INSTALL_TARGET = install
endif
LIBCAP_MAKE_FLAGS = \
LIBATTR=$(LIBCAP_HAVE_LIBATTR) \
BUILD_CC="$(HOSTCC)" \
BUILD_CFLAGS="$(HOST_CFLAGS)"
@@ -67,12 +58,13 @@ define LIBCAP_INSTALL_TARGET_CMDS
endef
define HOST_LIBCAP_BUILD_CMDS
$(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) LIBATTR=no
$(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D)\
RAISE_SETFCAP=no
endef
define HOST_LIBCAP_INSTALL_CMDS
$(HOST_MAKE_ENV) $(MAKE) -C $(@D) LIBATTR=no DESTDIR=$(HOST_DIR) \
prefix=/usr lib=lib install
$(HOST_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(HOST_DIR) \
RAISE_SETFCAP=no prefix=/usr lib=lib install
endef
$(eval $(generic-package))