All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 0/6] Add support for AMD Catalyst graphics driver
@ 2016-07-12  9:30 Romain Perier
  2016-07-12  9:30 ` [Buildroot] [PATCH v2 1/6] support/download: Add support to pass options directly to downloaders Romain Perier
                   ` (5 more replies)
  0 siblings, 6 replies; 19+ messages in thread
From: Romain Perier @ 2016-07-12  9:30 UTC (permalink / raw)
  To: buildroot

The AMD Catalyst Proprietary Linux Graphics Driver 15.9 supports GPUs
AMD Radeon HD 5xxx and newer graphics. It requires at least glibc 2.2
or 2.3 and is compatible up to Xorg 1.17. This serie adds the required
changes to support this driver.

The fglrx kernel module is compatible up to Linux kernel 4.4 LTS.
All the graphical stack has been tested on a x86_64 system with an
AMD-GT40N (w/ Radeon HD 6290 GPU).

Romain Perier (6):
  support/download: Add support for the referer option to wget
  pkg-download: Allow packages to pass an URL referer to the wget method
  docs/manual: Document the variable $(PKG)_DL_REFERER
  package/xserver_xorg-server: add version 1.17.4
  qt: Add option for enabling the accessibility support
  package/amd-catalyst-driver: Add AMD proprietary graphic stack support

 docs/manual/adding-packages-generic.txt            |  75 +++++----
 package/Config.in                                  |   1 +
 .../0001-Add-support-for-Linux-4.0.patch           |  45 ++++++
 .../0002-Add-support-for-Linux-4.1.patch           |  31 ++++
 .../0003-Add-support-for-Linux-4.2.patch           | 121 ++++++++++++++
 ...0004-Use-fpregs_active-instead-of-has_fpu.patch |  33 ++++
 ...-Use-a-local-copy-of-copy_xregs_to_kernel.patch |  79 ++++++++++
 .../0006-Add-support-for-Linux-4.4.patch           |  78 +++++++++
 package/amd-catalyst-driver/20-fglrx.conf          |   4 +
 package/amd-catalyst-driver/Config.in              |  89 +++++++++++
 .../amd-catalyst-driver/amd-catalyst-driver.hash   |   2 +
 package/amd-catalyst-driver/amd-catalyst-driver.mk | 175 +++++++++++++++++++++
 package/amd-catalyst-driver/gl.pc                  |  12 ++
 package/pkg-download.mk                            |   3 +-
 package/qt/Config.in                               |   5 +
 package/qt/qt.mk                                   |   7 +-
 package/x11r7/xserver_xorg-server/Config.in        |  10 ++
 .../xserver_xorg-server/xserver_xorg-server.hash   |   2 +
 support/download/wget                              |  10 +-
 19 files changed, 744 insertions(+), 38 deletions(-)
 create mode 100644 package/amd-catalyst-driver/0001-Add-support-for-Linux-4.0.patch
 create mode 100644 package/amd-catalyst-driver/0002-Add-support-for-Linux-4.1.patch
 create mode 100644 package/amd-catalyst-driver/0003-Add-support-for-Linux-4.2.patch
 create mode 100644 package/amd-catalyst-driver/0004-Use-fpregs_active-instead-of-has_fpu.patch
 create mode 100644 package/amd-catalyst-driver/0005-Use-a-local-copy-of-copy_xregs_to_kernel.patch
 create mode 100644 package/amd-catalyst-driver/0006-Add-support-for-Linux-4.4.patch
 create mode 100644 package/amd-catalyst-driver/20-fglrx.conf
 create mode 100644 package/amd-catalyst-driver/Config.in
 create mode 100644 package/amd-catalyst-driver/amd-catalyst-driver.hash
 create mode 100644 package/amd-catalyst-driver/amd-catalyst-driver.mk
 create mode 100644 package/amd-catalyst-driver/gl.pc

-- 
2.8.1

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH v2 1/6] support/download: Add support to pass options directly to downloaders
  2016-07-12  9:30 [Buildroot] [PATCH v2 0/6] Add support for AMD Catalyst graphics driver Romain Perier
@ 2016-07-12  9:30 ` Romain Perier
  2016-07-15 15:54   ` Yann E. MORIN
  2016-07-15 20:47   ` Yann E. MORIN
  2016-07-12  9:30 ` [Buildroot] [PATCH v2 2/6] pkg-download: Allow packages to pass generic options to download methods Romain Perier
                   ` (4 subsequent siblings)
  5 siblings, 2 replies; 19+ messages in thread
From: Romain Perier @ 2016-07-12  9:30 UTC (permalink / raw)
  To: buildroot

This adds support to pass options to the underlying command that is used
by downloader. Useful for retrieving data with server-side checking for
user login or passwords, use a proxy or use specific options for cloning
a repository via git and hg.

Signed-off-by: Romain Perier <romain.perier@free-electrons.com>
---

Changes in v2:
 - Replaced the variable $(PKG)_DL_REFERER by $(PKG)_DL_OPTS
 - Add modification to all downloaders

 support/download/bzr  | 3 ++-
 support/download/cp   | 3 ++-
 support/download/cvs  | 3 ++-
 support/download/git  | 3 ++-
 support/download/hg   | 3 ++-
 support/download/scp  | 3 ++-
 support/download/svn  | 3 ++-
 support/download/wget | 5 +++--
 8 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/support/download/bzr b/support/download/bzr
index e18b01f..9443e03 100755
--- a/support/download/bzr
+++ b/support/download/bzr
@@ -25,6 +25,7 @@ output="${1}"
 repo="${2}"
 rev="${3}"
 basename="${4}"
+dl_opts="${5}"
 
 # Caller needs to single-quote its arguments to prevent them from
 # being expanded a second time (in case there are spaces in them)
@@ -49,5 +50,5 @@ if [ ${bzr_version} -ge ${bzr_min_version} ]; then
 fi
 
 _bzr export ${verbose} --root="'${basename}/'" --format=tgz \
-    ${timestamp_opt} - "'${repo}'" -r "'${rev}'" \
+    ${timestamp_opt} - "${dl_opts}" "'${repo}'" -r "'${rev}'" \
     >"${output}"
diff --git a/support/download/cp b/support/download/cp
index 09ce3d1..8864a9d 100755
--- a/support/download/cp
+++ b/support/download/cp
@@ -27,6 +27,7 @@ shift $((OPTIND-1))
 
 output="${1}"
 source="${2}"
+dl_opts="${3}"
 
 # Caller needs to single-quote its arguments to prevent them from
 # being expanded a second time (in case there are spaces in them)
@@ -34,4 +35,4 @@ _localfiles() {
     eval ${LOCALFILES} "${@}"
 }
 
-_localfiles ${verbose} "'${source}'" "'${output}'"
+_localfiles ${verbose} "${dl_opts}""'${source}'" "'${output}'"
diff --git a/support/download/cvs b/support/download/cvs
index 7980389..e02c58e 100755
--- a/support/download/cvs
+++ b/support/download/cvs
@@ -25,6 +25,7 @@ repo="${2}"
 rev="${3}"
 rawname="${4}"
 basename="${5}"
+dl_opts="${6}"
 
 # Caller needs to single-quote its arguments to prevent them from
 # being expanded a second time (in case there are spaces in them)
@@ -48,6 +49,6 @@ fi
 
 export TZ=UTC
 _cvs ${verbose} -z3 -d"'${repo}'" \
-     co -d "'${basename}'" ${select} "'${rev}'" -P "'${rawname}'"
+     co "${dl_opts}" -d "'${basename}'" ${select} "'${rev}'" -P "'${rawname}'"
 
 tar czf "${output}" "${basename}"
diff --git a/support/download/git b/support/download/git
index 314b388..7fd7563 100755
--- a/support/download/git
+++ b/support/download/git
@@ -24,6 +24,7 @@ output="${1}"
 repo="${2}"
 cset="${3}"
 basename="${4}"
+dl_opts="${5}"
 
 # Caller needs to single-quote its arguments to prevent them from
 # being expanded a second time (in case there are spaces in them)
@@ -49,7 +50,7 @@ if [ -n "$(_git ls-remote "'${repo}'" "'${cset}'" 2>&1)" ]; then
 fi
 if [ ${git_done} -eq 0 ]; then
     printf "Doing full clone\n"
-    _git clone ${verbose} --mirror "'${repo}'" "'${basename}'"
+    _git clone ${verbose} "${dl_opts}" --mirror "'${repo}'" "'${basename}'"
 fi
 
 GIT_DIR="${basename}" \
diff --git a/support/download/hg b/support/download/hg
index 25cb4e9..04ca7a0 100755
--- a/support/download/hg
+++ b/support/download/hg
@@ -24,6 +24,7 @@ output="${1}"
 repo="${2}"
 cset="${3}"
 basename="${4}"
+dl_opts="${5}"
 
 # Caller needs to single-quote its arguments to prevent them from
 # being expanded a second time (in case there are spaces in them)
@@ -31,7 +32,7 @@ _hg() {
     eval ${HG} "${@}"
 }
 
-_hg clone ${verbose} --noupdate "'${repo}'" "'${basename}'"
+_hg clone ${verbose} "${dl_opts}" --noupdate "'${repo}'" "'${basename}'"
 
 _hg archive ${verbose} --repository "'${basename}'" --type tgz \
             --prefix "'${basename}'" --rev "'${cset}'" \
diff --git a/support/download/scp b/support/download/scp
index 95cf502..7ecc0d0 100755
--- a/support/download/scp
+++ b/support/download/scp
@@ -22,6 +22,7 @@ shift $((OPTIND-1))
 
 output="${1}"
 url="${2}"
+dl_opts="${3}"
 
 # Caller needs to single-quote its arguments to prevent them from
 # being expanded a second time (in case there are spaces in them)
@@ -29,4 +30,4 @@ _scp() {
     eval ${SCP} "${@}"
 }
 
-_scp ${verbose} "'${url}'" "'${output}'"
+_scp ${verbose} "${dl_opts}" "'${url}'" "'${output}'"
diff --git a/support/download/svn b/support/download/svn
index 4dcdd06..695762e 100755
--- a/support/download/svn
+++ b/support/download/svn
@@ -24,6 +24,7 @@ output="${1}"
 repo="${2}"
 rev="${3}"
 basename="${4}"
+dl_opts="${5}"
 
 # Caller needs to single-quote its arguments to prevent them from
 # being expanded a second time (in case there are spaces in them)
@@ -31,6 +32,6 @@ _svn() {
     eval ${SVN} "${@}"
 }
 
-_svn export ${verbose} "'${repo}@${rev}'" "'${basename}'"
+_svn export ${verbose} "${dl_opts}" "'${repo}@${rev}'" "'${basename}'"
 
 tar czf "${output}" "${basename}"
diff --git a/support/download/wget b/support/download/wget
index 0fc7ffa..95019dc 100755
--- a/support/download/wget
+++ b/support/download/wget
@@ -6,7 +6,7 @@ set -e
 # Download helper for wget, to be called from the download wrapper script
 #
 # Call it as:
-#   .../wget [-q] OUT_FILE URL
+#   .../wget [-q] OUT_FILE URL [DL_OPTS]
 #
 # Environment:
 #   WGET     : the wget command to call
@@ -22,6 +22,7 @@ shift $((OPTIND-1))
 
 output="${1}"
 url="${2}"
+dl_opts="${3}"
 
 # Caller needs to single-quote its arguments to prevent them from
 # being expanded a second time (in case there are spaces in them)
@@ -29,4 +30,4 @@ _wget() {
     eval ${WGET} "${@}"
 }
 
-_wget ${verbose} -O "'${output}'" "'${url}'"
+_wget ${verbose} "${dl_opts}" -O "'${output}'" "'${url}'"
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH v2 2/6] pkg-download: Allow packages to pass generic options to download methods
  2016-07-12  9:30 [Buildroot] [PATCH v2 0/6] Add support for AMD Catalyst graphics driver Romain Perier
  2016-07-12  9:30 ` [Buildroot] [PATCH v2 1/6] support/download: Add support to pass options directly to downloaders Romain Perier
@ 2016-07-12  9:30 ` Romain Perier
  2016-07-15 15:56   ` Yann E. MORIN
  2016-07-12  9:30 ` [Buildroot] [PATCH v2 3/6] docs/manual: Document the variable $(PKG)_DL_OPTS Romain Perier
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 19+ messages in thread
From: Romain Perier @ 2016-07-12  9:30 UTC (permalink / raw)
  To: buildroot

Introduce a new package variable $(PKG)_DL_OPTS. When this variable
is defined, its value is passed to the downloader as options to
the underlying command. Packages can now retrieve archives from server
expecting logins and passwords, use referer url, proxy or specific
options for cloning a repository.

Signed-off-by: Romain Perier <romain.perier@free-electrons.com>
---

Changes in v2:
 - Replaced $(PKG)_DL_REFERER by $(PKG)_DL_OPTS
 - Add support for this options to all downloaders


 package/pkg-download.mk | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/package/pkg-download.mk b/package/pkg-download.mk
index a0f694d..00fbe6c 100644
--- a/package/pkg-download.mk
+++ b/package/pkg-download.mk
@@ -80,7 +80,8 @@ define DOWNLOAD_GIT
 		-- \
 		$($(PKG)_SITE) \
 		$($(PKG)_DL_VERSION) \
-		$($(PKG)_BASE_NAME)
+		$($(PKG)_BASE_NAME) \
+		$($(PKG)_DL_OPTS)
 endef
 
 # TODO: improve to check that the given PKG_DL_VERSION exists on the remote
@@ -96,7 +97,8 @@ define DOWNLOAD_BZR
 		-- \
 		$($(PKG)_SITE) \
 		$($(PKG)_DL_VERSION) \
-		$($(PKG)_BASE_NAME)
+		$($(PKG)_BASE_NAME) \
+		$($(PKG)_DL_OPTS)
 endef
 
 define SOURCE_CHECK_BZR
@@ -111,7 +113,8 @@ define DOWNLOAD_CVS
 		$(call stripurischeme,$(call qstrip,$($(PKG)_SITE))) \
 		$($(PKG)_DL_VERSION) \
 		$($(PKG)_RAWNAME) \
-		$($(PKG)_BASE_NAME)
+		$($(PKG)_BASE_NAME) \
+		$($(PKG)_DL_OPTS)
 endef
 
 # Not all CVS servers support ls/rls, use login to see if we can connect
@@ -126,7 +129,8 @@ define DOWNLOAD_SVN
 		-- \
 		$($(PKG)_SITE) \
 		$($(PKG)_DL_VERSION) \
-		$($(PKG)_BASE_NAME)
+		$($(PKG)_BASE_NAME) \
+		$($(PKG)_DL_OPTS)
 endef
 
 define SOURCE_CHECK_SVN
@@ -142,7 +146,8 @@ define DOWNLOAD_SCP
 		-H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
 		$(QUIET) \
 		-- \
-		'$(call stripurischeme,$(call qstrip,$(1)))'
+		'$(call stripurischeme,$(call qstrip,$(1)))' \
+		$($(PKG)_DL_OPTS)
 endef
 
 define SOURCE_CHECK_SCP
@@ -156,7 +161,8 @@ define DOWNLOAD_HG
 		-- \
 		$($(PKG)_SITE) \
 		$($(PKG)_DL_VERSION) \
-		$($(PKG)_BASE_NAME)
+		$($(PKG)_BASE_NAME) \
+		$($(PKG)_DL_OPTS)
 endef
 
 # TODO: improve to check that the given PKG_DL_VERSION exists on the remote
@@ -171,7 +177,8 @@ define DOWNLOAD_WGET
 		-H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
 		$(QUIET) \
 		-- \
-		'$(call qstrip,$(1))'
+		'$(call qstrip,$(1))' \
+		$($(PKG)_DL_OPTS)
 endef
 
 define SOURCE_CHECK_WGET
@@ -184,7 +191,8 @@ define DOWNLOAD_LOCALFILES
 		-H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
 		$(QUIET) \
 		-- \
-		$(call stripurischeme,$(call qstrip,$(1)))
+		$(call stripurischeme,$(call qstrip,$(1))) \
+		$($(PKG)_DL_OPTS)
 endef
 
 define SOURCE_CHECK_LOCALFILES
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH v2 3/6] docs/manual: Document the variable $(PKG)_DL_OPTS
  2016-07-12  9:30 [Buildroot] [PATCH v2 0/6] Add support for AMD Catalyst graphics driver Romain Perier
  2016-07-12  9:30 ` [Buildroot] [PATCH v2 1/6] support/download: Add support to pass options directly to downloaders Romain Perier
  2016-07-12  9:30 ` [Buildroot] [PATCH v2 2/6] pkg-download: Allow packages to pass generic options to download methods Romain Perier
@ 2016-07-12  9:30 ` Romain Perier
  2016-07-15 16:00   ` Yann E. MORIN
  2016-07-12  9:30 ` [Buildroot] [PATCH v2 4/6] package/xserver_xorg-server: add version 1.17.4 Romain Perier
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 19+ messages in thread
From: Romain Perier @ 2016-07-12  9:30 UTC (permalink / raw)
  To: buildroot

This adds a description of the optional variable $(PKG)_DL_OPTS. When it
is set, this option passes additional options to the downloader.

Signed-off-by: Romain Perier <romain.perier@free-electrons.com>
---

Changes in v2:
 - Don't include the example in the snippet of code
 - Replaced $(PKG)_DL_REFERER by $(PKG)_DL_OPTS

 docs/manual/adding-packages-generic.txt | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/docs/manual/adding-packages-generic.txt b/docs/manual/adding-packages-generic.txt
index 8ed7fe8..1ee983f 100644
--- a/docs/manual/adding-packages-generic.txt
+++ b/docs/manual/adding-packages-generic.txt
@@ -250,6 +250,11 @@ information is (assuming the package name is +libfoo+) :
     +LIBFOO_SITE=/opt/software/libfoo.tar.gz+ +
     +LIBFOO_SITE=$(TOPDIR)/../src/libfoo+
 
+* +LIBFOO_DL_OPTS+ is a space-separated list of additional options to
+  pass to the downloader. Useful for retrieving documents with
+  server-side checking for user logins and passwords, or to use a proxy.
+  All download methods are supported.
+
 * +LIBFOO_EXTRA_DOWNLOADS+ is a space-separated list of additional
   files that Buildroot should download. If an entry contains +://+
   then Buildroot will assume it is a complete URL and will download
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH v2 4/6] package/xserver_xorg-server: add version 1.17.4
  2016-07-12  9:30 [Buildroot] [PATCH v2 0/6] Add support for AMD Catalyst graphics driver Romain Perier
                   ` (2 preceding siblings ...)
  2016-07-12  9:30 ` [Buildroot] [PATCH v2 3/6] docs/manual: Document the variable $(PKG)_DL_OPTS Romain Perier
@ 2016-07-12  9:30 ` Romain Perier
  2016-07-15 13:23   ` Thomas Petazzoni
  2016-07-12  9:30 ` [Buildroot] [PATCH v2 5/6] qt: Add option for enabling the accessibility support Romain Perier
  2016-07-12  9:30 ` [Buildroot] [PATCH v2 6/6] package/amd-catalyst-driver: Add AMD proprietary graphic stack support Romain Perier
  5 siblings, 1 reply; 19+ messages in thread
From: Romain Perier @ 2016-07-12  9:30 UTC (permalink / raw)
  To: buildroot

Some old binary blobs drivers only implement an old VIDEODRV ABI. This
is the case for the AMD Catalyst driver for example.

Such a situation already exists with the nvidia-tegra23, that only
support the VIDEODRV ABI 14.

Since VIDEODRV ABIs are not backward compatible [0], lets introduce an
older Xserver version that supports such an old ABI.

0. https://www.x.org/wiki/XorgModuleABIVersions/

Signed-off-by: Romain Perier <romain.perier@free-electrons.com>
---
 package/x11r7/xserver_xorg-server/Config.in                | 10 ++++++++++
 package/x11r7/xserver_xorg-server/xserver_xorg-server.hash |  2 ++
 2 files changed, 12 insertions(+)

diff --git a/package/x11r7/xserver_xorg-server/Config.in b/package/x11r7/xserver_xorg-server/Config.in
index 26b9c8e..af1bac9 100644
--- a/package/x11r7/xserver_xorg-server/Config.in
+++ b/package/x11r7/xserver_xorg-server/Config.in
@@ -58,12 +58,16 @@ if BR2_PACKAGE_XSERVER_XORG_SERVER
 config BR2_PACKAGE_XSERVER_XORG_SERVER_VIDEODRV_ABI_14
 	bool
 
+config BR2_PACKAGE_XSERVER_XORG_SERVER_VIDEODRV_ABI_19
+	bool
+
 config BR2_PACKAGE_XSERVER_XORG_SERVER_VIDEODRV_ABI_20
 	bool
 
 config BR2_PACKAGE_XSERVER_XORG_SERVER_VIDEODRV_ABI
 	int
 	default 14 if BR2_PACKAGE_XSERVER_XORG_SERVER_VIDEODRV_ABI_14
+	default 19 if BR2_PACKAGE_XSERVER_XORG_SERVER_VIDEODRV_ABI_19
 	default 20 if BR2_PACKAGE_XSERVER_XORG_SERVER_VIDEODRV_ABI_20
 
 choice
@@ -74,6 +78,11 @@ config BR2_PACKAGE_XSERVER_XORG_SERVER_V_1_18
 	select BR2_PACKAGE_XSERVER_XORG_SERVER_VIDEODRV_ABI_20
 	select BR2_PACKAGE_XPROTO_PRESENTPROTO
 
+config BR2_PACKAGE_XSERVER_XORG_SERVER_V_1_17
+	bool "1.17.4"
+	select BR2_PACKAGE_XSERVER_XORG_SERVER_VIDEODRV_ABI_19
+	select BR2_PACKAGE_XPROTO_PRESENTPROTO
+
 config BR2_PACKAGE_XSERVER_XORG_SERVER_V_1_14
 	bool "1.14.7"
 	select BR2_PACKAGE_XSERVER_XORG_SERVER_VIDEODRV_ABI_14
@@ -83,6 +92,7 @@ endchoice
 config BR2_PACKAGE_XSERVER_XORG_SERVER_VERSION
 	string
 	default "1.18.3" if BR2_PACKAGE_XSERVER_XORG_SERVER_V_1_18
+	default "1.17.4" if BR2_PACKAGE_XSERVER_XORG_SERVER_V_1_17
 	default "1.14.7" if BR2_PACKAGE_XSERVER_XORG_SERVER_V_1_14
 
 choice
diff --git a/package/x11r7/xserver_xorg-server/xserver_xorg-server.hash b/package/x11r7/xserver_xorg-server/xserver_xorg-server.hash
index 2172c89..abd1589 100644
--- a/package/x11r7/xserver_xorg-server/xserver_xorg-server.hash
+++ b/package/x11r7/xserver_xorg-server/xserver_xorg-server.hash
@@ -1,5 +1,7 @@
 # From http://lists.x.org/archives/xorg-announce/2014-June/002440.html
 sha1   7a95765e56b124758fcd7b609589e65b8870880b                                xorg-server-1.14.7.tar.bz2
 sha256 fcf66fa6ad86227613d2d3e8ae13ded297e2a1e947e9060a083eaf80d323451f        xorg-server-1.14.7.tar.bz2
+# From https://lists.x.org/archives/xorg-announce/2015-October/002650.html
+sha256 0c4b45c116a812a996eb432d8508cf26c2ec8c3916ff2a50781796882f8d6457        xorg-server-1.17.4.tar.bz2
 # From https://lists.freedesktop.org/archives/xorg-announce/2016-April/002683.html
 sha256	ea739c22517cdbe2b5f7c0a5fd05fe8a10ac0629003e71c0c7862f4bb60142cd	xorg-server-1.18.3.tar.bz2
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH v2 5/6] qt: Add option for enabling the accessibility support
  2016-07-12  9:30 [Buildroot] [PATCH v2 0/6] Add support for AMD Catalyst graphics driver Romain Perier
                   ` (3 preceding siblings ...)
  2016-07-12  9:30 ` [Buildroot] [PATCH v2 4/6] package/xserver_xorg-server: add version 1.17.4 Romain Perier
@ 2016-07-12  9:30 ` Romain Perier
  2016-07-15 13:23   ` Thomas Petazzoni
  2016-07-12  9:30 ` [Buildroot] [PATCH v2 6/6] package/amd-catalyst-driver: Add AMD proprietary graphic stack support Romain Perier
  5 siblings, 1 reply; 19+ messages in thread
From: Romain Perier @ 2016-07-12  9:30 UTC (permalink / raw)
  To: buildroot

This adds an entry in the configuration menu in order to
enable or disable the accessibility support.

Signed-off-by: Romain Perier <romain.perier@free-electrons.com>
---
 package/qt/Config.in | 5 +++++
 package/qt/qt.mk     | 7 ++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/package/qt/Config.in b/package/qt/Config.in
index 0ab8417..2523276 100644
--- a/package/qt/Config.in
+++ b/package/qt/Config.in
@@ -302,6 +302,11 @@ config BR2_PACKAGE_QT_QTTIFF
 	bool "Use Qt bundled libtiff"
 endchoice
 
+config BR2_PACKAGE_QT_ACCESSIBILITY
+	bool "Enable accessibility support"
+	help
+	  This enables and compile the accessibility support.
+
 endif # BR2_PACKAGE_QT_GUI_MODULE
 
 choice
diff --git a/package/qt/qt.mk b/package/qt/qt.mk
index f29a671..fa9dbf9 100644
--- a/package/qt/qt.mk
+++ b/package/qt/qt.mk
@@ -258,6 +258,12 @@ else
 QT_CONFIGURE_OPTS += -no-libmng
 endif
 
+ifeq ($(BR2_PACKAGE_QT_ACCESSIBILITY),y)
+QT_CONFIGURE_OPTS += -accessibility
+else
+QT_CONFIGURE_OPTS += -no-accessibility
+endif
+
 ifeq ($(BR2_PACKAGE_QT_QTZLIB),y)
 QT_CONFIGURE_OPTS += -qt-zlib
 else
@@ -517,7 +523,6 @@ define QT_CONFIGURE_CMDS
 		-no-xinerama \
 		-no-cups \
 		-no-nis \
-		-no-accessibility \
 		-no-separate-debug-info \
 		-prefix /usr \
 		-plugindir /usr/lib/qt/plugins \
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH v2 6/6] package/amd-catalyst-driver: Add AMD proprietary graphic stack support
  2016-07-12  9:30 [Buildroot] [PATCH v2 0/6] Add support for AMD Catalyst graphics driver Romain Perier
                   ` (4 preceding siblings ...)
  2016-07-12  9:30 ` [Buildroot] [PATCH v2 5/6] qt: Add option for enabling the accessibility support Romain Perier
@ 2016-07-12  9:30 ` Romain Perier
  5 siblings, 0 replies; 19+ messages in thread
From: Romain Perier @ 2016-07-12  9:30 UTC (permalink / raw)
  To: buildroot

This commits adds support for the AMD Catalyst Linux driver 15.9
(15.201.1151). It includes the fglrx kernel module with various fixes
to make it work with at least Linux kernel 4.4 LTS, the userspace OpenGL
and OpenCL binary blobs and the most commonly used cmdline tools.

Signed-off-by: Romain Perier <romain.perier@free-electrons.com>
---
 package/Config.in                                  |   1 +
 .../0001-Add-support-for-Linux-4.0.patch           |  45 ++++++
 .../0002-Add-support-for-Linux-4.1.patch           |  31 ++++
 .../0003-Add-support-for-Linux-4.2.patch           | 121 ++++++++++++++
 ...0004-Use-fpregs_active-instead-of-has_fpu.patch |  33 ++++
 ...-Use-a-local-copy-of-copy_xregs_to_kernel.patch |  79 ++++++++++
 .../0006-Add-support-for-Linux-4.4.patch           |  78 +++++++++
 package/amd-catalyst-driver/20-fglrx.conf          |   4 +
 package/amd-catalyst-driver/Config.in              |  89 +++++++++++
 .../amd-catalyst-driver/amd-catalyst-driver.hash   |   2 +
 package/amd-catalyst-driver/amd-catalyst-driver.mk | 175 +++++++++++++++++++++
 package/amd-catalyst-driver/gl.pc                  |  12 ++
 12 files changed, 670 insertions(+)
 create mode 100644 package/amd-catalyst-driver/0001-Add-support-for-Linux-4.0.patch
 create mode 100644 package/amd-catalyst-driver/0002-Add-support-for-Linux-4.1.patch
 create mode 100644 package/amd-catalyst-driver/0003-Add-support-for-Linux-4.2.patch
 create mode 100644 package/amd-catalyst-driver/0004-Use-fpregs_active-instead-of-has_fpu.patch
 create mode 100644 package/amd-catalyst-driver/0005-Use-a-local-copy-of-copy_xregs_to_kernel.patch
 create mode 100644 package/amd-catalyst-driver/0006-Add-support-for-Linux-4.4.patch
 create mode 100644 package/amd-catalyst-driver/20-fglrx.conf
 create mode 100644 package/amd-catalyst-driver/Config.in
 create mode 100644 package/amd-catalyst-driver/amd-catalyst-driver.hash
 create mode 100644 package/amd-catalyst-driver/amd-catalyst-driver.mk
 create mode 100644 package/amd-catalyst-driver/gl.pc

diff --git a/package/Config.in b/package/Config.in
index 9d668bf..7aa1e3c 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -344,6 +344,7 @@ endmenu
 	source "package/acpid/Config.in"
 	source "package/aer-inject/Config.in"
 	source "package/am335x-pru-package/Config.in"
+	source "package/amd-catalyst-driver/Config.in"
 	source "package/avrdude/Config.in"
 	source "package/bcache-tools/Config.in"
 	source "package/biosdevname/Config.in"
diff --git a/package/amd-catalyst-driver/0001-Add-support-for-Linux-4.0.patch b/package/amd-catalyst-driver/0001-Add-support-for-Linux-4.0.patch
new file mode 100644
index 0000000..a0db962
--- /dev/null
+++ b/package/amd-catalyst-driver/0001-Add-support-for-Linux-4.0.patch
@@ -0,0 +1,45 @@
+From c35482bc0cc56b40263b74c3e58e42be867fd9f2 Mon Sep 17 00:00:00 2001
+From: Alberto Milone <alberto.milone@canonical.com>
+Date: Thu, 17 Sep 2015 15:41:46 +0200
+Subject: [PATCH] Add support for Linux 4.0
+
+Signed-off-by: Romain Perier <romain.perier@free-electrons.com>
+---
+ common/lib/modules/fglrx/build_mod/firegl_public.c | 5 +++++
+ common/lib/modules/fglrx/build_mod/kcl_str.c       | 4 ++++
+ 2 files changed, 9 insertions(+)
+
+diff --git a/common/lib/modules/fglrx/build_mod/firegl_public.c b/common/lib/modules/fglrx/build_mod/firegl_public.c
+index 677565d..6017e89 100755
+--- a/common/lib/modules/fglrx/build_mod/firegl_public.c
++++ b/common/lib/modules/fglrx/build_mod/firegl_public.c
+@@ -285,6 +285,11 @@ MODULE_DEVICE_TABLE(pci, fglrx_pci_table);
+ 
+ MODULE_INFO(supported, "external");
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 20, 0)
++#define read_cr4()       __read_cr4()
++#define write_cr4(cr4)   __write_cr4(cr4)
++#endif
++
+ /* globals constants */
+ const char*         KCL_SYSINFO_OsVersionString = UTS_RELEASE;
+ const unsigned int  KCL_SYSINFO_PageSize        = PAGE_SIZE;
+diff --git a/common/lib/modules/fglrx/build_mod/kcl_str.c b/common/lib/modules/fglrx/build_mod/kcl_str.c
+index 2d89eb0..bacdb69 100755
+--- a/common/lib/modules/fglrx/build_mod/kcl_str.c
++++ b/common/lib/modules/fglrx/build_mod/kcl_str.c
+@@ -42,6 +42,10 @@
+ #include "kcl_type.h"
+ #include "kcl_str.h"
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 20, 0)
++#define strnicmp strncasecmp
++#endif
++
+ /** \brief Fill memory with a constant byte
+  *  \param s Pointer to memory
+  *  \param c Initializing value
+-- 
+2.8.1
+
diff --git a/package/amd-catalyst-driver/0002-Add-support-for-Linux-4.1.patch b/package/amd-catalyst-driver/0002-Add-support-for-Linux-4.1.patch
new file mode 100644
index 0000000..cc95916
--- /dev/null
+++ b/package/amd-catalyst-driver/0002-Add-support-for-Linux-4.1.patch
@@ -0,0 +1,31 @@
+From e9c8ccb4c8c842042542b792c51f9a7ec6c85e06 Mon Sep 17 00:00:00 2001
+From: Alberto Milone <alberto.milone@canonical.com>
+Date: Thu, 17 Sep 2015 15:44:59 +0200
+Subject: [PATCH] Add support for Linux 4.1
+
+Signed-off-by: Romain Perier <romain.perier@free-electrons.com>
+---
+ common/lib/modules/fglrx/build_mod/firegl_public.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/common/lib/modules/fglrx/build_mod/firegl_public.c b/common/lib/modules/fglrx/build_mod/firegl_public.c
+index 6017e89..94778f1 100755
+--- a/common/lib/modules/fglrx/build_mod/firegl_public.c
++++ b/common/lib/modules/fglrx/build_mod/firegl_public.c
+@@ -3508,10 +3508,12 @@ int ATI_API_CALL KCL_InstallInterruptHandler(
+         KCL_PUB_InterruptHandlerWrap,
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
+         ((useMSI) ? (SA_INTERRUPT) : (SA_SHIRQ)),
+-#else
++#elif LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0)
+         //when MSI enabled. keep irq disabled when calling the action handler,
+         //exclude this IRQ from irq balancing (only on one CPU) 
+         ((useMSI) ? (IRQF_DISABLED) : (IRQF_SHARED)),    
++#else
++        ((useMSI) ? (0x0) : (IRQF_SHARED)),
+ #endif
+         dev_name,
+         context);
+-- 
+2.8.1
+
diff --git a/package/amd-catalyst-driver/0003-Add-support-for-Linux-4.2.patch b/package/amd-catalyst-driver/0003-Add-support-for-Linux-4.2.patch
new file mode 100644
index 0000000..7458162
--- /dev/null
+++ b/package/amd-catalyst-driver/0003-Add-support-for-Linux-4.2.patch
@@ -0,0 +1,121 @@
+From e2e6c2dac2a0311a022208dd289374b832538329 Mon Sep 17 00:00:00 2001
+From: Alberto Milone <alberto.milone@canonical.com>
+Date: Tue, 14 Jul 2015 12:56:37 +0200
+Subject: [PATCH] Add support for Linux 4.2
+
+Deal with the FPU code renaming
+
+Signed-off-by: Romain Perier <romain.perier@free-electrons.com>
+---
+ common/lib/modules/fglrx/build_mod/firegl_public.c | 38 ++++++++++++++++++++++
+ 1 file changed, 38 insertions(+)
+
+diff --git a/common/lib/modules/fglrx/build_mod/firegl_public.c b/common/lib/modules/fglrx/build_mod/firegl_public.c
+index 94778f1..749ea51 100755
+--- a/common/lib/modules/fglrx/build_mod/firegl_public.c
++++ b/common/lib/modules/fglrx/build_mod/firegl_public.c
+@@ -191,9 +191,17 @@
+ #include <linux/string.h>
+ #include <linux/gfp.h>
+ #include <linux/swap.h>
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
+ #include "asm/i387.h"
++#else
++#include <asm/fpu/api.h>
++#endif
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
+ #include <asm/fpu-internal.h>
++#else
++#include <asm/fpu/internal.h>
++#endif
+ #endif
+ 
+ #include "firegl_public.h"
+@@ -1711,6 +1719,9 @@ void ATI_API_CALL KCL_SetCurrentProcessState(KCL_ENUM_ProcessState state)
+ 
+ #if defined(__i386__) 
+ #ifndef __HAVE_ARCH_CMPXCHG
++#ifndef __xg
++#define __xg(x) ((volatile long *)(x))
++#endif
+ static inline 
+ unsigned long __fgl_cmpxchg(volatile void *ptr, unsigned long old,            
+                         unsigned long new, int size)                      
+@@ -1747,7 +1758,11 @@ unsigned long ATI_API_CALL kcl__cmpxchg(volatile void *ptr, unsigned long old,
+          unsigned long new, int size)
+ {
+ #ifndef __HAVE_ARCH_CMPXCHG
++#if defined(__i386__)
+     return __fgl_cmpxchg(ptr,old,new,size);
++#elif defined(__x86_64__)
++    return cmpxchg((unsigned long*)ptr,old,new);
++#endif
+ #else
+     /* On kernel version 2.6.34 passing a variable or unsupported size
+      * argument to the __cmpxchg macro causes the default-clause of a
+@@ -6443,21 +6458,36 @@ static int KCL_fpu_save_init(struct task_struct *tsk)
+    struct fpu *fpu = &tsk->thread.fpu;
+ 
+    if(static_cpu_has(X86_FEATURE_XSAVE)) {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
+       fpu_xsave(fpu);
+       if (!(fpu->state->xsave.xsave_hdr.xstate_bv & XSTATE_FP))
++#else
++      copy_xregs_to_kernel(&fpu->state.xsave);
++      if (!(fpu->state.xsave.header.xfeatures & XSTATE_FP))
++#endif
+ 	 return 1;
+    } else if (static_cpu_has(X86_FEATURE_FXSR)) {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
+ 	 fpu_fxsave(fpu);
++#else
++     copy_fxregs_to_kernel(fpu);
++#endif
+    } else {
+ 	 asm volatile("fnsave %[fx]; fwait"
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
+                   : [fx] "=m" (fpu->state->fsave));
++#else
++                  : [fx] "=m" (fpu->state.fsave));
++#endif
+ 	 return 0;
+    }
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
+    if (unlikely(fpu->state->fxsave.swd & X87_FSW_ES)) {
+ 	asm volatile("fnclex");
+ 	return 0;
+    }
++#endif
+    return 1;
+ }
+ #endif
+@@ -6469,8 +6499,12 @@ static int KCL_fpu_save_init(struct task_struct *tsk)
+ void ATI_API_CALL KCL_fpu_begin(void)
+ {
+ #ifdef CONFIG_X86_64
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
+     kernel_fpu_begin();
+ #else
++    __kernel_fpu_begin();
++#endif
++#else
+ #ifdef TS_USEDFPU
+     struct thread_info *cur_thread = current_thread_info();
+     struct task_struct *cur_task = get_current();
+@@ -6515,7 +6549,11 @@ void ATI_API_CALL KCL_fpu_begin(void)
+  */
+ void ATI_API_CALL KCL_fpu_end(void)
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
+     kernel_fpu_end();
++#else
++    __kernel_fpu_end();
++#endif
+ }
+ 
+ /** Create new directory entry under "/proc/...."
+-- 
+2.8.1
+
diff --git a/package/amd-catalyst-driver/0004-Use-fpregs_active-instead-of-has_fpu.patch b/package/amd-catalyst-driver/0004-Use-fpregs_active-instead-of-has_fpu.patch
new file mode 100644
index 0000000..4d375b8
--- /dev/null
+++ b/package/amd-catalyst-driver/0004-Use-fpregs_active-instead-of-has_fpu.patch
@@ -0,0 +1,33 @@
+From 7120f00015570a2e4d9b6532731960d509c71cba Mon Sep 17 00:00:00 2001
+From: Alberto Milone <alberto.milone@canonical.com>
+Date: Thu, 17 Sep 2015 15:48:30 +0200
+Subject: [PATCH] Use fpregs_active instead of has_fpu
+
+This is for Linux 4.2
+
+Thanks to Tim Gardner for the patch.
+
+Signed-off-by: Romain Perier <romain.perier@free-electrons.com>
+---
+ common/lib/modules/fglrx/build_mod/firegl_public.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/common/lib/modules/fglrx/build_mod/firegl_public.c b/common/lib/modules/fglrx/build_mod/firegl_public.c
+index 749ea51..4c1f9a5 100755
+--- a/common/lib/modules/fglrx/build_mod/firegl_public.c
++++ b/common/lib/modules/fglrx/build_mod/firegl_public.c
+@@ -6528,7 +6528,11 @@ void ATI_API_CALL KCL_fpu_begin(void)
+     /* The thread structure is changed with the commit below for kernel 3.3:
+      * https://github.com/torvalds/linux/commit/7e16838d94b566a17b65231073d179bc04d590c8
+      */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)
++    if (cur_task->thread.fpu.fpregs_active)
++#else
+     if (cur_task->thread.fpu.has_fpu)
++#endif
+ #else
+     if (cur_task->thread.has_fpu)
+ #endif
+-- 
+2.8.1
+
diff --git a/package/amd-catalyst-driver/0005-Use-a-local-copy-of-copy_xregs_to_kernel.patch b/package/amd-catalyst-driver/0005-Use-a-local-copy-of-copy_xregs_to_kernel.patch
new file mode 100644
index 0000000..c9513ef
--- /dev/null
+++ b/package/amd-catalyst-driver/0005-Use-a-local-copy-of-copy_xregs_to_kernel.patch
@@ -0,0 +1,79 @@
+From eb703737be5c91c1a0817351db8ec152c523c85d Mon Sep 17 00:00:00 2001
+From: Alberto Milone <alberto.milone@canonical.com>
+Date: Thu, 17 Sep 2015 15:49:46 +0200
+Subject: [PATCH] Use a local copy of copy_xregs_to_kernel
+
+This is needed for Linux 4.2.
+
+Thanks to Tim Gardner for the patch.
+
+Signed-off-by: Romain Perier <romain.perier@free-electrons.com>
+---
+ common/lib/modules/fglrx/build_mod/firegl_public.c | 44 +++++++++++++++++++++-
+ 1 file changed, 43 insertions(+), 1 deletion(-)
+
+diff --git a/common/lib/modules/fglrx/build_mod/firegl_public.c b/common/lib/modules/fglrx/build_mod/firegl_public.c
+index 4c1f9a5..bb67bba 100755
+--- a/common/lib/modules/fglrx/build_mod/firegl_public.c
++++ b/common/lib/modules/fglrx/build_mod/firegl_public.c
+@@ -6443,6 +6443,48 @@ int ATI_API_CALL kcl_sscanf(const char * buf, const char * fmt, ...)
+     return i;
+ }
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)
++/*
++ * Save processor xstate to xsave area.
++ */
++static void _copy_xregs_to_kernel(struct xregs_state *xstate)
++{
++        u64 mask = -1;
++        u32 lmask = mask;
++        u32 hmask = mask >> 32;
++        int err = 0;
++
++        /*WARN_ON(!alternatives_patched);*/
++
++        /*
++         * If xsaves is enabled, xsaves replaces xsaveopt because
++         * it supports compact format and supervisor states in addition to
++         * modified optimization in xsaveopt.
++         *
++         * Otherwise, if xsaveopt is enabled, xsaveopt replaces xsave
++         * because xsaveopt supports modified optimization which is not
++         * supported by xsave.
++         *
++         * If none of xsaves and xsaveopt is enabled, use xsave.
++         */
++        alternative_input_2(
++                "1:"XSAVE,
++                XSAVEOPT,
++                X86_FEATURE_XSAVEOPT,
++                XSAVES,
++                X86_FEATURE_XSAVES,
++                [xstate] "D" (xstate), "a" (lmask), "d" (hmask) :
++                "memory");
++        asm volatile("2:\n\t"
++                     xstate_fault(err)
++                     : "0" (err)
++                     : "memory");
++
++        /* We should never fault when copying to a kernel buffer: */
++        WARN_ON_FPU(err);
++}
++#endif
++
+ /** \brief Generate UUID
+  *  \param buf pointer to the generated UUID
+  *  \return None
+@@ -6462,7 +6504,7 @@ static int KCL_fpu_save_init(struct task_struct *tsk)
+       fpu_xsave(fpu);
+       if (!(fpu->state->xsave.xsave_hdr.xstate_bv & XSTATE_FP))
+ #else
+-      copy_xregs_to_kernel(&fpu->state.xsave);
++      _copy_xregs_to_kernel(&fpu->state.xsave);
+       if (!(fpu->state.xsave.header.xfeatures & XSTATE_FP))
+ #endif
+ 	 return 1;
+-- 
+2.8.1
+
diff --git a/package/amd-catalyst-driver/0006-Add-support-for-Linux-4.4.patch b/package/amd-catalyst-driver/0006-Add-support-for-Linux-4.4.patch
new file mode 100644
index 0000000..104e2c5
--- /dev/null
+++ b/package/amd-catalyst-driver/0006-Add-support-for-Linux-4.4.patch
@@ -0,0 +1,78 @@
+From 54b230e26a1889c08507e791ab043f8a4b4ff771 Mon Sep 17 00:00:00 2001
+From: Romain Perier <romain.perier@free-electrons.com>
+Date: Thu, 7 Jul 2016 14:40:53 +0200
+Subject: [PATCH] Add support for Linux 4.4
+
+It fixes various things like the use of seq_printf because its API
+changed. It also replaces the call to mtrr_add and mtrr_del by
+arch_phys_wc_add and arch_phys_wc_del because these symbols are
+no longer exported for Linux >= 4.3.x.
+
+Signed-off-by: Romain Perier <romain.perier@free-electrons.com>
+---
+ common/lib/modules/fglrx/build_mod/firegl_public.c | 21 +++++++++++++++++++++
+ 1 file changed, 21 insertions(+)
+
+diff --git a/common/lib/modules/fglrx/build_mod/firegl_public.c b/common/lib/modules/fglrx/build_mod/firegl_public.c
+index bb67bba..b4b2d30 100755
+--- a/common/lib/modules/fglrx/build_mod/firegl_public.c
++++ b/common/lib/modules/fglrx/build_mod/firegl_public.c
+@@ -636,9 +636,16 @@ static int firegl_major_proc_read(struct seq_file *m, void* data)
+ 
+     len = snprintf(buf, request, "%d\n", major);
+ #else
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)
++    seq_printf(m, "%d\n", major);
++    len = 0;
++#else
+     len = seq_printf(m, "%d\n", major);
+ #endif
+ 
++#endif
++
+     KCL_DEBUG1(FN_FIREGL_PROC, "return len=%i\n",len);
+ 
+     return len;
+@@ -3432,7 +3439,11 @@ int ATI_API_CALL KCL_MEM_MTRR_Support(void)
+ int ATI_API_CALL KCL_MEM_MTRR_AddRegionWc(unsigned long base, unsigned long size)
+ {
+ #ifdef CONFIG_MTRR
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)
++    return arch_phys_wc_add(base, size);
++#else
+     return mtrr_add(base, size, MTRR_TYPE_WRCOMB, 1);
++#endif
+ #else /* !CONFIG_MTRR */
+     return -EPERM;
+ #endif /* !CONFIG_MTRR */
+@@ -3441,7 +3452,12 @@ int ATI_API_CALL KCL_MEM_MTRR_AddRegionWc(unsigned long base, unsigned long size
+ int ATI_API_CALL KCL_MEM_MTRR_DeleteRegion(int reg, unsigned long base, unsigned long size)
+ {
+ #ifdef CONFIG_MTRR
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)
++    arch_phys_wc_del(reg);
++    return 0;
++#else
+     return mtrr_del(reg, base, size);
++#endif
+ #else /* !CONFIG_MTRR */
+     return -EPERM;
+ #endif /* !CONFIG_MTRR */
+@@ -6505,8 +6521,13 @@ static int KCL_fpu_save_init(struct task_struct *tsk)
+       if (!(fpu->state->xsave.xsave_hdr.xstate_bv & XSTATE_FP))
+ #else
+       _copy_xregs_to_kernel(&fpu->state.xsave);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,0)
++      if (!(fpu->state.xsave.header.xfeatures & XFEATURE_MASK_FP))
++#else
+       if (!(fpu->state.xsave.header.xfeatures & XSTATE_FP))
+ #endif
++
++#endif
+ 	 return 1;
+    } else if (static_cpu_has(X86_FEATURE_FXSR)) {
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
+-- 
+2.8.1
+
diff --git a/package/amd-catalyst-driver/20-fglrx.conf b/package/amd-catalyst-driver/20-fglrx.conf
new file mode 100644
index 0000000..1186ed1
--- /dev/null
+++ b/package/amd-catalyst-driver/20-fglrx.conf
@@ -0,0 +1,4 @@
+Section "Device"
+	Identifier "AMD Radeon GPU"
+        Driver "fglrx"
+EndSection
diff --git a/package/amd-catalyst-driver/Config.in b/package/amd-catalyst-driver/Config.in
new file mode 100644
index 0000000..721087f
--- /dev/null
+++ b/package/amd-catalyst-driver/Config.in
@@ -0,0 +1,89 @@
+comment "amd-catalyst-driver needs a glibc toolchain"
+	depends on BR2_i386 || BR2_x86_64
+	depends on !BR2_TOOLCHAIN_USES_GLIBC
+
+config BR2_PACKAGE_AMD_CATALYST_DRIVER
+	bool "amd-catalyst-driver"
+	depends on BR2_i386 || BR2_x86_64
+	depends on BR2_TOOLCHAIN_USES_GLIBC
+	help
+	  The binary-only driver blob for AMD cards.
+	  This driver supports AMD Radeon HD 5xxx and newer graphics
+	  cards.
+
+	  http://www.amd.com/
+
+if BR2_PACKAGE_AMD_CATALYST_DRIVER
+
+comment "amd-catalyst-driver needs a modular Xorg <= 1.17"
+	depends on !BR2_PACKAGE_XORG7 || !BR2_PACKAGE_XSERVER_XORG_SERVER_MODULAR || !BR2_PACKAGE_XSERVER_XORG_SERVER_VIDEODRV_ABI_19
+
+config BR2_PACKAGE_AMD_CATALYST_DRIVER_XORG
+	bool "X.org drivers"
+	default y
+	depends on BR2_PACKAGE_XORG7
+	depends on BR2_PACKAGE_XSERVER_XORG_SERVER_MODULAR
+	depends on BR2_PACKAGE_XSERVER_XORG_SERVER_VIDEODRV_ABI_19
+	select BR2_PACKAGE_XSERVER_XORG_SERVER_AIGLX
+	select BR2_PACKAGE_ACPID # runtime
+	# This package does not have standard GL headers
+	select BR2_PACKAGE_MESA3D_HEADERS
+	select BR2_PACKAGE_XLIB_LIBX11
+	select BR2_PACKAGE_XLIB_LIBXEXT
+	select BR2_PACKAGE_XLIB_LIBXCOMPOSITE
+	select BR2_PACKAGE_HAS_LIBGL
+	select BR2_PACKAGE_AMD_CATALYST_DRIVER_MODULE
+
+if BR2_PACKAGE_AMD_CATALYST_DRIVER_XORG
+
+config BR2_PACKAGE_PROVIDES_LIBGL
+	default "amd-catalyst-driver"
+
+config BR2_PACKAGE_AMD_CATALYST_DRIVER_CMDLINE_TOOLS
+	bool "command-line configuration tools and utilities"
+	help
+	  Build the amd command line tools
+
+comment "Catalyst Control Center needs Qt4 with X11 and PNG support"
+	depends on !BR2_PACKAGE_QT || !BR2_PACKAGE_QT_X11 || BR2_PACKAGE_QT_NOPNG
+
+config BR2_PACKAGE_AMD_CATALYST_DRIVER_CCCLE
+	bool "Catalyst Control Center"
+	depends on BR2_PACKAGE_QT && BR2_PACKAGE_QT_X11
+	select BR2_PACKAGE_PROCPS_NG # runtime
+	select BR2_PACKAGE_QT_GUI_MODULE
+	select BR2_PACKAGE_QT_ACCESSIBILITY
+	help
+	  Installs the Catalyst Control Center, a Qt graphical tool to
+	  control AMD graphics accelerators.
+
+endif
+
+config BR2_PACKAGE_AMD_CATALYST_DRIVER_MODULE
+	bool
+
+config BR2_PACKAGE_AMD_CATALYST_DRIVER_OPENCL
+	bool "OpenCL support"
+	select BR2_PACKAGE_AMD_CATALYST_DRIVER_MODULE
+	help
+	  Installs the OpenCL binary blobs and the ICD profile
+	  for GPGPU computing.
+
+
+
+config BR2_PACKAGE_AMD_CATALYST_DRIVER_MODULE_LICENSE_GPL
+	bool "fglrx module export GPL license"
+	help
+	  If enabled, you accept that the driver will be patched locally
+	  in order to export itself as a GPL module to the Linux kernel.
+	  This is required as the module uses some GPL-compatible
+	  symbols. Without this fix, the module won't build properly
+	  because the Linux kernel build system does not allow to link a
+	  non GPL module, if this one tries to use GPL-only symbols. It
+	  is worth mentioning that from a legal point of view, you are
+	  most likely not allowed to redistribute such a kernel module,
+	  in a pre-built form. The author and the buildroot project
+	  disclaim any responsibility in case these terms are not
+	  respected.
+
+endif # BR2_PACKAGE_AMD_CATALYST_DRIVER
diff --git a/package/amd-catalyst-driver/amd-catalyst-driver.hash b/package/amd-catalyst-driver/amd-catalyst-driver.hash
new file mode 100644
index 0000000..9f9b0a3
--- /dev/null
+++ b/package/amd-catalyst-driver/amd-catalyst-driver.hash
@@ -0,0 +1,2 @@
+# Locally computed
+sha256	bf3e6e7d5c51db3d075410a3f116f865b82823debc1d66698d187249feec6a91	amd-catalyst-15.9-linux-installer-15.201.1151-x86.x86_64.zip
diff --git a/package/amd-catalyst-driver/amd-catalyst-driver.mk b/package/amd-catalyst-driver/amd-catalyst-driver.mk
new file mode 100644
index 0000000..dea4216
--- /dev/null
+++ b/package/amd-catalyst-driver/amd-catalyst-driver.mk
@@ -0,0 +1,175 @@
+################################################################################
+#
+# amd-catalyst-driver
+#
+################################################################################
+
+AMD_CATALYST_DRIVER_VERSION = 15.9
+AMD_CATALYST_DRIVER_VERBOSE_VER = 15.201.1151
+AMD_CATALYST_DRIVER_SITE = http://www2.ati.com/drivers/linux
+AMD_CATALYST_DRIVER_DL_OPTS = --referer='http://support.amd.com/en-us/kb-articles/Pages/latest-linux-beta-driver.aspx'
+AMD_CATALYST_DRIVER_SOURCE = amd-catalyst-$(AMD_CATALYST_DRIVER_VERSION)-linux-installer-$(AMD_CATALYST_DRIVER_VERBOSE_VER)-x86.x86_64.zip
+AMD_CATALYST_DRIVER_LICENSE = AMD Software License 
+AMD_CATALYST_DRIVER_LICENSE_FILES = LICENSE.txt
+AMD_CATALYST_DRIVER_INSTALL_STAGING = YES
+AMD_CATALYST_DRIVER_SUFFIX = $(if $(BR2_x86_64),_64)
+AMD_CATALYST_DRIVER_ARCH_DIR = $(@D)/arch/x86$(AMD_CATALYST_DRIVER_SUFFIX)
+AMD_CATALYST_DRIVER_LIB_SUFFIX = $(if $(BR2_x86_64),64)
+
+
+define AMD_CATALYST_DRIVER_EXTRACT_CMDS
+	unzip -q $(DL_DIR)/$(AMD_CATALYST_DRIVER_SOURCE) -d $(@D)
+	$(SHELL) $(@D)/AMD-Catalyst-$(AMD_CATALYST_DRIVER_VERSION)-Linux-installer-$(AMD_CATALYST_DRIVER_VERBOSE_VER)-x86.x86_64.run --extract $(@D)
+endef
+
+ifeq ($(BR2_PACKAGE_AMD_CATALYST_DRIVER_MODULE),y)
+AMD_CATALYST_DRIVER_MODULE_SUBDIRS = common/lib/modules/fglrx/build_mod/2.6.x
+AMD_CATALYST_DRIVER_MODULE_MAKE_OPTS =  \
+	CFLAGS_MODULE="-DCOMPAT_ALLOC_USER_SPACE=arch_compat_alloc_user_space"
+
+ifeq ($(BR2_PACKAGE_AMD_CATALYST_DRIVER_MODULE_LICENSE_GPL),y)
+define AMD_CATALYST_DRIVER_POST_PATCH_LICENSE_FIXUP
+	sed 's/^MODULE_LICENSE("\(.*\)")/MODULE_LICENSE("GPL\\0\1")/' -i $(@D)/common/lib/modules/fglrx/build_mod/firegl_public.c
+endef
+AMD_CATALYST_DRIVER_POST_PATCH_HOOKS += AMD_CATALYST_DRIVER_POST_PATCH_LICENSE_FIXUP
+endif
+
+define AMD_CATALYST_DRIVER_CONFIGURE_CMDS
+	# The Makefile expects to have source in the folder 2.6.x
+	cp $(@D)/common/lib/modules/fglrx/build_mod/*.{c,h} \
+		$(@D)/common/lib/modules/fglrx/build_mod/2.6.x
+	# This static lib is required during the link
+	cp $(@D)/arch/x86$(AMD_CATALYST_DRIVER_SUFFIX)/lib/modules/fglrx/build_mod/libfglrx_ip.a \
+		$(@D)/common/lib/modules/fglrx/build_mod/2.6.x
+endef
+
+$(eval $(kernel-module))
+endif
+
+ifeq ($(BR2_PACKAGE_AMD_CATALYST_DRIVER_OPENCL),y)
+
+AMD_CATALYST_DRIVER_OCL_SUFFIX = $(if $(BR2_x86_64),64,32)
+AMD_CATALYST_DRIVER_OPENCL_FILES = \
+	usr/lib$(AMD_CATALYST_DRIVER_LIB_SUFFIX)/libOpenCL.so.1 \
+	usr/lib$(AMD_CATALYST_DRIVER_LIB_SUFFIX)/libaticalcl.so \
+	usr/lib$(AMD_CATALYST_DRIVER_LIB_SUFFIX)/libamdocl$(AMD_CATALYST_DRIVER_OCL_SUFFIX).so \
+	usr/lib$(AMD_CATALYST_DRIVER_LIB_SUFFIX)/libamdocl12cl$(AMD_CATALYST_DRIVER_OCL_SUFFIX).so
+
+define AMD_CATALYST_DRIVER_INSTALL_OPENCL
+	$(foreach f,$(AMD_CATALYST_DRIVER_OPENCL_FILES), \
+		$(INSTALL) -D -m 0755 $(AMD_CATALYST_DRIVER_ARCH_DIR)/$(f) $(TARGET_DIR)/$(f)
+	)
+	ln -sf libOpenCL.so.1 \
+		$(TARGET_DIR)/usr/lib/libOpenCL.so
+	$(INSTALL) -m 0755 $(AMD_CATALYST_DRIVER_ARCH_DIR)/usr/bin/clinfo \
+		$(TARGET_DIR)/usr/bin
+	$(INSTALL) -D -m 0644 $(AMD_CATALYST_DRIVER_ARCH_DIR)/etc/OpenCL/vendors/amdocl$(AMD_CATALYST_DRIVER_OCL_SUFFIX).icd \
+		$(TARGET_DIR)/etc/OpenCL/vendors/amdocl$(AMD_CATALYST_DRIVER_OCL_SUFFIX).icd
+endef
+
+endif
+
+ifeq ($(BR2_PACKAGE_AMD_CATALYST_DRIVER_XORG), y)
+
+AMD_CATALYST_DRIVER_DEPENDENCIES += mesa3d-headers
+AMD_CATALYST_DRIVER_PROVIDES = libgl
+AMD_CATALYST_DRIVER_XPIC_DIR = $(@D)/xpic$(if $(BR2_x86_64),_64a)
+
+define AMD_CATALYST_DRIVER_INSTALL_GL_LIBS
+	$(INSTALL) -m 0644 $(AMD_CATALYST_DRIVER_ARCH_DIR)/usr/X11R6/lib$(AMD_CATALYST_DRIVER_LIB_SUFFIX)/fglrx/fglrx-libGL.so.1.2 \
+		$(1)/usr/lib
+	ln -sf fglrx-libGL.so.1.2 $(1)/usr/lib/libGL.so.1.2
+	ln -sf fglrx-libGL.so.1.2 $(1)/usr/lib/libGL.so.1
+	ln -sf fglrx-libGL.so.1.2 $(1)/usr/lib/libGL.so
+endef
+
+define AMD_CATALYST_DRIVER_INSTALL_STAGING_XORG
+	$(call AMD_CATALYST_DRIVER_INSTALL_GL_LIBS $(STAGING_DIR))
+	$(INSTALL) -D -m 0644 package/amd-catalyst-driver/gl.pc \
+		$(STAGING_DIR)/usr/lib/pkgconfig/gl.pc
+endef
+
+AMD_CATALYST_DRIVER_XORG_DRIVERS_FILES = modules/amdxmm.so \
+	modules/drivers/fglrx_drv.so \
+	modules/linux/libfglrxdrm.so
+
+define AMD_CATALYST_DRIVER_INSTALL_XORG
+# Xorg drivers
+	$(foreach f,$(AMD_CATALYST_DRIVER_XORG_DRIVERS_FILES), \
+		$(INSTALL) -D -m 0755 $(AMD_CATALYST_DRIVER_XPIC_DIR)/usr/X11R6/lib$(AMD_CATALYST_DRIVER_LIB_SUFFIX)/$(f) \
+		$(TARGET_DIR)/usr/lib/xorg/$(f)
+	)
+
+# Xorg is not able to detect the driver automatically
+	$(INSTALL) -D -m 0644 package/amd-catalyst-driver/20-fglrx.conf \
+		$(TARGET_DIR)/etc/X11/xorg.conf.d/20-fglrx.conf
+
+
+# Common files: containing binary profiles about GPUs,
+# required by the fglrx_drv xorg driver
+	$(INSTALL) -d $(TARGET_DIR)/etc/ati
+ 	$(INSTALL) -m 0644 $(@D)/common/etc/ati/* $(TARGET_DIR)/etc/ati/
+
+# DRI and GLX xorg modules: by default DRI is activated,
+# these modules are required by the fglrx_drv.so xorg driver
+	$(INSTALL) -D -m 0644 $(AMD_CATALYST_DRIVER_ARCH_DIR)/usr/X11R6/lib$(AMD_CATALYST_DRIVER_LIB_SUFFIX)/modules/dri/fglrx_dri.so \
+		$(TARGET_DIR)/usr/lib/dri/fglrx_dri.so
+	$(INSTALL) -D -m 0644 $(AMD_CATALYST_DRIVER_XPIC_DIR)/usr/X11R6/lib$(AMD_CATALYST_DRIVER_LIB_SUFFIX)/modules/extensions/fglrx/fglrx-libglx.so \
+		$(TARGET_DIR)/usr/lib/xorg/modules/extensions/libglx.so
+	$(INSTALL) -D -m 0644 $(AMD_CATALYST_DRIVER_XPIC_DIR)/usr/X11R6/lib$(AMD_CATALYST_DRIVER_LIB_SUFFIX)/modules/glesx.so \
+		$(TARGET_DIR)/usr/lib/xorg/modules/glesx.so
+
+# Userspace GL libraries, also runtime dependency of most of the cmdline tools
+	$(INSTALL) -m 0644 $(AMD_CATALYST_DRIVER_ARCH_DIR)/usr/X11R6/lib$(AMD_CATALYST_DRIVER_LIB_SUFFIX)/*.so \
+		$(TARGET_DIR)/usr/lib/
+	$(call AMD_CATALYST_DRIVER_INSTALL_GL_LIBS $(TARGET_DIR))
+
+# Runtime depedency required by libfglrxdrm.so
+	$(INSTALL) -m 0644 $(AMD_CATALYST_DRIVER_ARCH_DIR)/usr/lib$(AMD_CATALYST_DRIVER_LIB_SUFFIX)/libatiuki.so.1.0 \
+		$(TARGET_DIR)/usr/lib/
+	ln -sf libatiuki.so.1.0 \
+		$(TARGET_DIR)/usr/lib/libatiuki.so.1
+endef
+
+endif
+
+ifeq ($(BR2_PACKAGE_AMD_CATALYST_DRIVER_CMDLINE_TOOLS), y)
+AMD_CATALYST_DRIVER_CMDLINE_TOOLS_FILES = \
+	atiode \
+	atiodcli \
+	fgl_glxgears \
+	aticonfig \
+	amd-console-helper \
+	fglrxinfo
+
+define  AMD_CATALYST_DRIVER_INSTALL_CMDLINE_TOOLS
+	$(INSTALL) -m 0755 $(AMD_CATALYST_DRIVER_ARCH_DIR)/usr/sbin/atieventsd \
+		$(TARGET_DIR)/usr/sbin
+	$(foreach f,$(AMD_CATALYST_DRIVER_CMDLINE_TOOLS_FILES), \
+		$(INSTALL) -D -m 0755 $(AMD_CATALYST_DRIVER_ARCH_DIR)/usr/X11R6/bin/$(f) \
+			$(TARGET_DIR)/usr/bin/$(f)
+	)
+endef
+endif
+
+ifeq ($(BR2_PACKAGE_AMD_CATALYST_DRIVER_CCCLE), y)
+define AMD_CATALYST_DRIVER_INSTALL_CCCLE
+	$(INSTALL) -m 0755 $(AMD_CATALYST_DRIVER_ARCH_DIR)/usr/X11R6/bin/amdcccle \
+		$(TARGET_DIR)/usr/bin/amdcccle
+	$(INSTALL) -m 0755 $(AMD_CATALYST_DRIVER_ARCH_DIR)/usr/sbin/amdnotifyui \
+		$(TARGET_DIR)/usr/sbin/amdnotifyui
+endef
+endif
+
+define AMD_CATALYST_DRIVER_INSTALL_STAGING_CMDS
+	$(call AMD_CATALYST_DRIVER_INSTALL_STAGING_XORG)
+endef
+
+define AMD_CATALYST_DRIVER_INSTALL_TARGET_CMDS
+	$(call AMD_CATALYST_DRIVER_INSTALL_XORG)
+	$(call AMD_CATALYST_DRIVER_INSTALL_CMDLINE_TOOLS)
+	$(call AMD_CATALYST_DRIVER_INSTALL_CCCLE)
+	$(call AMD_CATALYST_DRIVER_INSTALL_OPENCL)
+endef
+
+$(eval $(generic-package))
diff --git a/package/amd-catalyst-driver/gl.pc b/package/amd-catalyst-driver/gl.pc
new file mode 100644
index 0000000..8729271
--- /dev/null
+++ b/package/amd-catalyst-driver/gl.pc
@@ -0,0 +1,12 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: gl
+Description: AMD Catalyst OpenGL library
+Version: 15.9
+Libs: -L${libdir} -lGL -lm -lXext -lX11 -ldl
+Cflags: -I${includedir}
+glx_tls: no
+
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH v2 4/6] package/xserver_xorg-server: add version 1.17.4
  2016-07-12  9:30 ` [Buildroot] [PATCH v2 4/6] package/xserver_xorg-server: add version 1.17.4 Romain Perier
@ 2016-07-15 13:23   ` Thomas Petazzoni
  0 siblings, 0 replies; 19+ messages in thread
From: Thomas Petazzoni @ 2016-07-15 13:23 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue, 12 Jul 2016 11:30:18 +0200, Romain Perier wrote:
> Some old binary blobs drivers only implement an old VIDEODRV ABI. This
> is the case for the AMD Catalyst driver for example.
> 
> Such a situation already exists with the nvidia-tegra23, that only
> support the VIDEODRV ABI 14.
> 
> Since VIDEODRV ABIs are not backward compatible [0], lets introduce an
> older Xserver version that supports such an old ABI.
> 
> 0. https://www.x.org/wiki/XorgModuleABIVersions/
> 
> Signed-off-by: Romain Perier <romain.perier@free-electrons.com>
> ---
>  package/x11r7/xserver_xorg-server/Config.in                | 10 ++++++++++
>  package/x11r7/xserver_xorg-server/xserver_xorg-server.hash |  2 ++
>  2 files changed, 12 insertions(+)

Applied to master, thanks.

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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH v2 5/6] qt: Add option for enabling the accessibility support
  2016-07-12  9:30 ` [Buildroot] [PATCH v2 5/6] qt: Add option for enabling the accessibility support Romain Perier
@ 2016-07-15 13:23   ` Thomas Petazzoni
  0 siblings, 0 replies; 19+ messages in thread
From: Thomas Petazzoni @ 2016-07-15 13:23 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue, 12 Jul 2016 11:30:19 +0200, Romain Perier wrote:

> +config BR2_PACKAGE_QT_ACCESSIBILITY
> +	bool "Enable accessibility support"
> +	help
> +	  This enables and compile the accessibility support.

s/compile/compiles/

Applied with this typo fixed. Thanks!

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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH v2 1/6] support/download: Add support to pass options directly to downloaders
  2016-07-12  9:30 ` [Buildroot] [PATCH v2 1/6] support/download: Add support to pass options directly to downloaders Romain Perier
@ 2016-07-15 15:54   ` Yann E. MORIN
  2016-07-15 17:21     ` Thomas Petazzoni
  2016-07-15 20:47   ` Yann E. MORIN
  1 sibling, 1 reply; 19+ messages in thread
From: Yann E. MORIN @ 2016-07-15 15:54 UTC (permalink / raw)
  To: buildroot

Romain, All,

On 2016-07-12 11:30 +0200, Romain Perier spake thusly:
> This adds support to pass options to the underlying command that is used
> by downloader. Useful for retrieving data with server-side checking for
> user login or passwords, use a proxy or use specific options for cloning
> a repository via git and hg.
> 
> Signed-off-by: Romain Perier <romain.perier@free-electrons.com>
> ---
[--SNIP--]
> diff --git a/support/download/bzr b/support/download/bzr
> index e18b01f..9443e03 100755
> --- a/support/download/bzr
> +++ b/support/download/bzr
> @@ -25,6 +25,7 @@ output="${1}"
>  repo="${2}"
>  rev="${3}"
>  basename="${4}"
> +dl_opts="${5}"

With Thomas, we've recently discussed the way we currently pass options
to the download helpers.

As you could experience first-hand, it is not trivial to add new options
to those helpers, because they expect their arguments to be non-otions:
URL, version, site... They only accept a single option, that nust be the
first argument shen calling them.

Instead, Thomas suggested, and I concur, that we should change them all
so that we pass them those as options. For example:

  - for bzr:
    -o output-file
    -r repo-url
    -R revision
    -n basename

  - for cp:
    -o output-file
    -s soruce-file

  - for cvs;
    -o output-file
    -r repo-url
    -R revision
    -N rawname
    -n basename

  - for git:
    -o output-file  # Do you see a pattern here? ;-)
    -r repo-url     # and here? ;-)
    -c cset
    -n basenamne

and so on...

That way, adding more options will be dead easy.

Regards,
Yann E. MORIN.

>  # Caller needs to single-quote its arguments to prevent them from
>  # being expanded a second time (in case there are spaces in them)
> @@ -49,5 +50,5 @@ if [ ${bzr_version} -ge ${bzr_min_version} ]; then
>  fi
>  
>  _bzr export ${verbose} --root="'${basename}/'" --format=tgz \
> -    ${timestamp_opt} - "'${repo}'" -r "'${rev}'" \
> +    ${timestamp_opt} - "${dl_opts}" "'${repo}'" -r "'${rev}'" \
>      >"${output}"
> diff --git a/support/download/cp b/support/download/cp
> index 09ce3d1..8864a9d 100755
> --- a/support/download/cp
> +++ b/support/download/cp
> @@ -27,6 +27,7 @@ shift $((OPTIND-1))
>  
>  output="${1}"
>  source="${2}"
> +dl_opts="${3}"
>  
>  # Caller needs to single-quote its arguments to prevent them from
>  # being expanded a second time (in case there are spaces in them)
> @@ -34,4 +35,4 @@ _localfiles() {
>      eval ${LOCALFILES} "${@}"
>  }
>  
> -_localfiles ${verbose} "'${source}'" "'${output}'"
> +_localfiles ${verbose} "${dl_opts}""'${source}'" "'${output}'"
> diff --git a/support/download/cvs b/support/download/cvs
> index 7980389..e02c58e 100755
> --- a/support/download/cvs
> +++ b/support/download/cvs
> @@ -25,6 +25,7 @@ repo="${2}"
>  rev="${3}"
>  rawname="${4}"
>  basename="${5}"
> +dl_opts="${6}"
>  
>  # Caller needs to single-quote its arguments to prevent them from
>  # being expanded a second time (in case there are spaces in them)
> @@ -48,6 +49,6 @@ fi
>  
>  export TZ=UTC
>  _cvs ${verbose} -z3 -d"'${repo}'" \
> -     co -d "'${basename}'" ${select} "'${rev}'" -P "'${rawname}'"
> +     co "${dl_opts}" -d "'${basename}'" ${select} "'${rev}'" -P "'${rawname}'"
>  
>  tar czf "${output}" "${basename}"
> diff --git a/support/download/git b/support/download/git
> index 314b388..7fd7563 100755
> --- a/support/download/git
> +++ b/support/download/git
> @@ -24,6 +24,7 @@ output="${1}"
>  repo="${2}"
>  cset="${3}"
>  basename="${4}"
> +dl_opts="${5}"
>  
>  # Caller needs to single-quote its arguments to prevent them from
>  # being expanded a second time (in case there are spaces in them)
> @@ -49,7 +50,7 @@ if [ -n "$(_git ls-remote "'${repo}'" "'${cset}'" 2>&1)" ]; then
>  fi
>  if [ ${git_done} -eq 0 ]; then
>      printf "Doing full clone\n"
> -    _git clone ${verbose} --mirror "'${repo}'" "'${basename}'"
> +    _git clone ${verbose} "${dl_opts}" --mirror "'${repo}'" "'${basename}'"
>  fi
>  
>  GIT_DIR="${basename}" \
> diff --git a/support/download/hg b/support/download/hg
> index 25cb4e9..04ca7a0 100755
> --- a/support/download/hg
> +++ b/support/download/hg
> @@ -24,6 +24,7 @@ output="${1}"
>  repo="${2}"
>  cset="${3}"
>  basename="${4}"
> +dl_opts="${5}"
>  
>  # Caller needs to single-quote its arguments to prevent them from
>  # being expanded a second time (in case there are spaces in them)
> @@ -31,7 +32,7 @@ _hg() {
>      eval ${HG} "${@}"
>  }
>  
> -_hg clone ${verbose} --noupdate "'${repo}'" "'${basename}'"
> +_hg clone ${verbose} "${dl_opts}" --noupdate "'${repo}'" "'${basename}'"
>  
>  _hg archive ${verbose} --repository "'${basename}'" --type tgz \
>              --prefix "'${basename}'" --rev "'${cset}'" \
> diff --git a/support/download/scp b/support/download/scp
> index 95cf502..7ecc0d0 100755
> --- a/support/download/scp
> +++ b/support/download/scp
> @@ -22,6 +22,7 @@ shift $((OPTIND-1))
>  
>  output="${1}"
>  url="${2}"
> +dl_opts="${3}"
>  
>  # Caller needs to single-quote its arguments to prevent them from
>  # being expanded a second time (in case there are spaces in them)
> @@ -29,4 +30,4 @@ _scp() {
>      eval ${SCP} "${@}"
>  }
>  
> -_scp ${verbose} "'${url}'" "'${output}'"
> +_scp ${verbose} "${dl_opts}" "'${url}'" "'${output}'"
> diff --git a/support/download/svn b/support/download/svn
> index 4dcdd06..695762e 100755
> --- a/support/download/svn
> +++ b/support/download/svn
> @@ -24,6 +24,7 @@ output="${1}"
>  repo="${2}"
>  rev="${3}"
>  basename="${4}"
> +dl_opts="${5}"
>  
>  # Caller needs to single-quote its arguments to prevent them from
>  # being expanded a second time (in case there are spaces in them)
> @@ -31,6 +32,6 @@ _svn() {
>      eval ${SVN} "${@}"
>  }
>  
> -_svn export ${verbose} "'${repo}@${rev}'" "'${basename}'"
> +_svn export ${verbose} "${dl_opts}" "'${repo}@${rev}'" "'${basename}'"
>  
>  tar czf "${output}" "${basename}"
> diff --git a/support/download/wget b/support/download/wget
> index 0fc7ffa..95019dc 100755
> --- a/support/download/wget
> +++ b/support/download/wget
> @@ -6,7 +6,7 @@ set -e
>  # Download helper for wget, to be called from the download wrapper script
>  #
>  # Call it as:
> -#   .../wget [-q] OUT_FILE URL
> +#   .../wget [-q] OUT_FILE URL [DL_OPTS]
>  #
>  # Environment:
>  #   WGET     : the wget command to call
> @@ -22,6 +22,7 @@ shift $((OPTIND-1))
>  
>  output="${1}"
>  url="${2}"
> +dl_opts="${3}"
>  
>  # Caller needs to single-quote its arguments to prevent them from
>  # being expanded a second time (in case there are spaces in them)
> @@ -29,4 +30,4 @@ _wget() {
>      eval ${WGET} "${@}"
>  }
>  
> -_wget ${verbose} -O "'${output}'" "'${url}'"
> +_wget ${verbose} "${dl_opts}" -O "'${output}'" "'${url}'"
> -- 
> 2.8.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH v2 2/6] pkg-download: Allow packages to pass generic options to download methods
  2016-07-12  9:30 ` [Buildroot] [PATCH v2 2/6] pkg-download: Allow packages to pass generic options to download methods Romain Perier
@ 2016-07-15 15:56   ` Yann E. MORIN
  0 siblings, 0 replies; 19+ messages in thread
From: Yann E. MORIN @ 2016-07-15 15:56 UTC (permalink / raw)
  To: buildroot

Romain, All,

On 2016-07-12 11:30 +0200, Romain Perier spake thusly:
> Introduce a new package variable $(PKG)_DL_OPTS. When this variable
> is defined, its value is passed to the downloader as options to
> the underlying command. Packages can now retrieve archives from server
> expecting logins and passwords, use referer url, proxy or specific
> options for cloning a repository.
> 
> Signed-off-by: Romain Perier <romain.perier@free-electrons.com>

On principle:
    Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

... which you can add when you respin after the download backends are
changed to accept options, of course.

Regards,
Yann E. MORIN.

> ---
> 
> Changes in v2:
>  - Replaced $(PKG)_DL_REFERER by $(PKG)_DL_OPTS
>  - Add support for this options to all downloaders
> 
> 
>  package/pkg-download.mk | 24 ++++++++++++++++--------
>  1 file changed, 16 insertions(+), 8 deletions(-)
> 
> diff --git a/package/pkg-download.mk b/package/pkg-download.mk
> index a0f694d..00fbe6c 100644
> --- a/package/pkg-download.mk
> +++ b/package/pkg-download.mk
> @@ -80,7 +80,8 @@ define DOWNLOAD_GIT
>  		-- \
>  		$($(PKG)_SITE) \
>  		$($(PKG)_DL_VERSION) \
> -		$($(PKG)_BASE_NAME)
> +		$($(PKG)_BASE_NAME) \
> +		$($(PKG)_DL_OPTS)
>  endef
>  
>  # TODO: improve to check that the given PKG_DL_VERSION exists on the remote
> @@ -96,7 +97,8 @@ define DOWNLOAD_BZR
>  		-- \
>  		$($(PKG)_SITE) \
>  		$($(PKG)_DL_VERSION) \
> -		$($(PKG)_BASE_NAME)
> +		$($(PKG)_BASE_NAME) \
> +		$($(PKG)_DL_OPTS)
>  endef
>  
>  define SOURCE_CHECK_BZR
> @@ -111,7 +113,8 @@ define DOWNLOAD_CVS
>  		$(call stripurischeme,$(call qstrip,$($(PKG)_SITE))) \
>  		$($(PKG)_DL_VERSION) \
>  		$($(PKG)_RAWNAME) \
> -		$($(PKG)_BASE_NAME)
> +		$($(PKG)_BASE_NAME) \
> +		$($(PKG)_DL_OPTS)
>  endef
>  
>  # Not all CVS servers support ls/rls, use login to see if we can connect
> @@ -126,7 +129,8 @@ define DOWNLOAD_SVN
>  		-- \
>  		$($(PKG)_SITE) \
>  		$($(PKG)_DL_VERSION) \
> -		$($(PKG)_BASE_NAME)
> +		$($(PKG)_BASE_NAME) \
> +		$($(PKG)_DL_OPTS)
>  endef
>  
>  define SOURCE_CHECK_SVN
> @@ -142,7 +146,8 @@ define DOWNLOAD_SCP
>  		-H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
>  		$(QUIET) \
>  		-- \
> -		'$(call stripurischeme,$(call qstrip,$(1)))'
> +		'$(call stripurischeme,$(call qstrip,$(1)))' \
> +		$($(PKG)_DL_OPTS)
>  endef
>  
>  define SOURCE_CHECK_SCP
> @@ -156,7 +161,8 @@ define DOWNLOAD_HG
>  		-- \
>  		$($(PKG)_SITE) \
>  		$($(PKG)_DL_VERSION) \
> -		$($(PKG)_BASE_NAME)
> +		$($(PKG)_BASE_NAME) \
> +		$($(PKG)_DL_OPTS)
>  endef
>  
>  # TODO: improve to check that the given PKG_DL_VERSION exists on the remote
> @@ -171,7 +177,8 @@ define DOWNLOAD_WGET
>  		-H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
>  		$(QUIET) \
>  		-- \
> -		'$(call qstrip,$(1))'
> +		'$(call qstrip,$(1))' \
> +		$($(PKG)_DL_OPTS)
>  endef
>  
>  define SOURCE_CHECK_WGET
> @@ -184,7 +191,8 @@ define DOWNLOAD_LOCALFILES
>  		-H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
>  		$(QUIET) \
>  		-- \
> -		$(call stripurischeme,$(call qstrip,$(1)))
> +		$(call stripurischeme,$(call qstrip,$(1))) \
> +		$($(PKG)_DL_OPTS)
>  endef
>  
>  define SOURCE_CHECK_LOCALFILES
> -- 
> 2.8.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH v2 3/6] docs/manual: Document the variable $(PKG)_DL_OPTS
  2016-07-12  9:30 ` [Buildroot] [PATCH v2 3/6] docs/manual: Document the variable $(PKG)_DL_OPTS Romain Perier
@ 2016-07-15 16:00   ` Yann E. MORIN
  2016-07-26  7:30     ` Romain Perier
  0 siblings, 1 reply; 19+ messages in thread
From: Yann E. MORIN @ 2016-07-15 16:00 UTC (permalink / raw)
  To: buildroot

Romain, All,

On 2016-07-12 11:30 +0200, Romain Perier spake thusly:
> This adds a description of the optional variable $(PKG)_DL_OPTS. When it
> is set, this option passes additional options to the downloader.
> 
> Signed-off-by: Romain Perier <romain.perier@free-electrons.com>
> ---
> 
> Changes in v2:
>  - Don't include the example in the snippet of code
>  - Replaced $(PKG)_DL_REFERER by $(PKG)_DL_OPTS
> 
>  docs/manual/adding-packages-generic.txt | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/docs/manual/adding-packages-generic.txt b/docs/manual/adding-packages-generic.txt
> index 8ed7fe8..1ee983f 100644
> --- a/docs/manual/adding-packages-generic.txt
> +++ b/docs/manual/adding-packages-generic.txt
> @@ -250,6 +250,11 @@ information is (assuming the package name is +libfoo+) :
>      +LIBFOO_SITE=/opt/software/libfoo.tar.gz+ +
>      +LIBFOO_SITE=$(TOPDIR)/../src/libfoo+
>  
> +* +LIBFOO_DL_OPTS+ is a space-separated list of additional options to
> +  pass to the downloader. Useful for retrieving documents with
> +  server-side checking for user logins and passwords, or to use a proxy.
> +  All download methods are supported.

With the last sentence, I'd also say something like:

    All download methods valid for +LIBFOO_SITE_METHOD+ are supported;
    valid options depend on the download method (consult the man page
    for the respective download utilities).

Regards,
Yann E. MORIN.

>  * +LIBFOO_EXTRA_DOWNLOADS+ is a space-separated list of additional
>    files that Buildroot should download. If an entry contains +://+
>    then Buildroot will assume it is a complete URL and will download
> -- 
> 2.8.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH v2 1/6] support/download: Add support to pass options directly to downloaders
  2016-07-15 15:54   ` Yann E. MORIN
@ 2016-07-15 17:21     ` Thomas Petazzoni
  0 siblings, 0 replies; 19+ messages in thread
From: Thomas Petazzoni @ 2016-07-15 17:21 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 15 Jul 2016 17:54:35 +0200, Yann E. MORIN wrote:

> With Thomas, we've recently discussed the way we currently pass options
> to the download helpers.
> 
> As you could experience first-hand, it is not trivial to add new options
> to those helpers, because they expect their arguments to be non-otions:
> URL, version, site... They only accept a single option, that nust be the
> first argument shen calling them.
> 
> Instead, Thomas suggested, and I concur, that we should change them all
> so that we pass them those as options. For example:

I concur, but isn't that independent from Romain's patch? Romain's
patch is about passing random additional options straight from the
package to the download helper. How would such custom options be passed
with your new scheme ? I guess we would pass first the downloader
wrapper options, then a "--" sign, and then the custom options passed
straight to the download tool. Do you see another way ?

Also, I'm tempted to say that Romain's patch can be merged as-is, since
switching to a different organization of the download helpers will no
affect the visible "API" exposed to packages.

What do you think?

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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH v2 1/6] support/download: Add support to pass options directly to downloaders
  2016-07-12  9:30 ` [Buildroot] [PATCH v2 1/6] support/download: Add support to pass options directly to downloaders Romain Perier
  2016-07-15 15:54   ` Yann E. MORIN
@ 2016-07-15 20:47   ` Yann E. MORIN
  2016-07-24 14:00     ` Thomas Petazzoni
  1 sibling, 1 reply; 19+ messages in thread
From: Yann E. MORIN @ 2016-07-15 20:47 UTC (permalink / raw)
  To: buildroot

Romain, Thomas, All,

On 2016-07-12 11:30 +0200, Romain Perier spake thusly:
> This adds support to pass options to the underlying command that is used
> by downloader. Useful for retrieving data with server-side checking for
> user login or passwords, use a proxy or use specific options for cloning
> a repository via git and hg.
> 
> Signed-off-by: Romain Perier <romain.perier@free-electrons.com>

Following the reply by Thomas, I did a second review of this patch with
an eye toward having it applied without changing the way we pass the
current options.

I still have a few comments on it (read the second comment before
reading the first).

> ---
[--SNIP--]
> diff --git a/support/download/bzr b/support/download/bzr
> index e18b01f..9443e03 100755
> --- a/support/download/bzr
> +++ b/support/download/bzr
> @@ -25,6 +25,7 @@ output="${1}"
>  repo="${2}"
>  rev="${3}"
>  basename="${4}"
> +dl_opts="${5}"

So we expect the additional options to be pased as a single string?
Why not use something like:

    shift 4 # Get rid of our options

and then:

    _bzr export ${verbose} --root="'${basename}/'" --format=tgz \
        ${timestamp_opt} - "'${repo}'" -r "'${rev}'" \
        ${timestamp_opt} - "${@}" "'${repo}'" -r "'${rev}'" \

Ditto for all backends, of course.

Note: I wrote the above after writing the comment below; that construct
above would fix the concerns I expressed below.

(I'm hard to follow, am I not? My brain is really tortuous... ;-] )

>  # Caller needs to single-quote its arguments to prevent them from
>  # being expanded a second time (in case there are spaces in them)
> @@ -49,5 +50,5 @@ if [ ${bzr_version} -ge ${bzr_min_version} ]; then
>  fi
>  
>  _bzr export ${verbose} --root="'${basename}/'" --format=tgz \
> -    ${timestamp_opt} - "'${repo}'" -r "'${rev}'" \
> +    ${timestamp_opt} - "${dl_opts}" "'${repo}'" -r "'${rev}'" \

When there are no additional options, then this passes an empty string
argument to the wrapping function. Normally, an empty string argument is
not very well handled by most programs, and bzr is no exception.

This happens to work because we then eval the arguments in the wraping
function.

However, this is not a robust solution, as we never encoded the
expectation of such behaviour.

A simple solution would be to just not quote ${dl_opts}. However, that
would not work well is such an option had an explicit space in it.

Still, that's better than nothing.

Unless you can provide convincing arguments that its better to quote
${dl_opts} (but I can't see many).

This all makes me very uneasy... :-/ Except if we follow the suggestion
I mad in the first comment, above, which you can now backtrack to. ;-)

Ditto for all backends, of course.

[--SNIP--]
> diff --git a/support/download/git b/support/download/git
> index 314b388..7fd7563 100755
> --- a/support/download/git
> +++ b/support/download/git
> @@ -24,6 +24,7 @@ output="${1}"
>  repo="${2}"
>  cset="${3}"
>  basename="${4}"
> +dl_opts="${5}"
>  
>  # Caller needs to single-quote its arguments to prevent them from
>  # being expanded a second time (in case there are spaces in them)
> @@ -49,7 +50,7 @@ if [ -n "$(_git ls-remote "'${repo}'" "'${cset}'" 2>&1)" ]; then
>  fi
>  if [ ${git_done} -eq 0 ]; then
>      printf "Doing full clone\n"
> -    _git clone ${verbose} --mirror "'${repo}'" "'${basename}'"
> +    _git clone ${verbose} "${dl_opts}" --mirror "'${repo}'" "'${basename}'"

You missed the other git clone just a few lines above.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH v2 1/6] support/download: Add support to pass options directly to downloaders
  2016-07-15 20:47   ` Yann E. MORIN
@ 2016-07-24 14:00     ` Thomas Petazzoni
  2016-07-24 14:04       ` Yann E. MORIN
  0 siblings, 1 reply; 19+ messages in thread
From: Thomas Petazzoni @ 2016-07-24 14:00 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 15 Jul 2016 22:47:29 +0200, Yann E. MORIN wrote:

> > ---  
> [--SNIP--]
> > diff --git a/support/download/bzr b/support/download/bzr
> > index e18b01f..9443e03 100755
> > --- a/support/download/bzr
> > +++ b/support/download/bzr
> > @@ -25,6 +25,7 @@ output="${1}"
> >  repo="${2}"
> >  rev="${3}"
> >  basename="${4}"
> > +dl_opts="${5}"  
> 
> So we expect the additional options to be pased as a single string?
> Why not use something like:
> 
>     shift 4 # Get rid of our options
> 
> and then:
> 
>     _bzr export ${verbose} --root="'${basename}/'" --format=tgz \
>         ${timestamp_opt} - "'${repo}'" -r "'${rev}'" \
>         ${timestamp_opt} - "${@}" "'${repo}'" -r "'${rev}'" \
> 
> Ditto for all backends, of course.
> 
> Note: I wrote the above after writing the comment below; that construct
> above would fix the concerns I expressed below.
> 
> (I'm hard to follow, am I not? My brain is really tortuous... ;-] )

Below, you're concerned that "${dl_opts}" will lead to a problem as it
will be an empty "" if no options are passed. But you suggest to use
"${@}" instead, still with "". How does that fix the particular problem
you mentioned below?

Thanks,

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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH v2 1/6] support/download: Add support to pass options directly to downloaders
  2016-07-24 14:00     ` Thomas Petazzoni
@ 2016-07-24 14:04       ` Yann E. MORIN
  2016-07-24 14:05         ` Thomas Petazzoni
  0 siblings, 1 reply; 19+ messages in thread
From: Yann E. MORIN @ 2016-07-24 14:04 UTC (permalink / raw)
  To: buildroot

Thomas, Romain, All,

On 2016-07-24 16:00 +0200, Thomas Petazzoni spake thusly:
> On Fri, 15 Jul 2016 22:47:29 +0200, Yann E. MORIN wrote:
> 
> > > ---  
> > [--SNIP--]
> > > diff --git a/support/download/bzr b/support/download/bzr
> > > index e18b01f..9443e03 100755
> > > --- a/support/download/bzr
> > > +++ b/support/download/bzr
> > > @@ -25,6 +25,7 @@ output="${1}"
> > >  repo="${2}"
> > >  rev="${3}"
> > >  basename="${4}"
> > > +dl_opts="${5}"  
> > 
> > So we expect the additional options to be pased as a single string?
> > Why not use something like:
> > 
> >     shift 4 # Get rid of our options
> > 
> > and then:
> > 
> >     _bzr export ${verbose} --root="'${basename}/'" --format=tgz \
> >         ${timestamp_opt} - "'${repo}'" -r "'${rev}'" \
> >         ${timestamp_opt} - "${@}" "'${repo}'" -r "'${rev}'" \
> > 
> > Ditto for all backends, of course.
> > 
> > Note: I wrote the above after writing the comment below; that construct
> > above would fix the concerns I expressed below.
> > 
> > (I'm hard to follow, am I not? My brain is really tortuous... ;-] )
> 
> Below, you're concerned that "${dl_opts}" will lead to a problem as it
> will be an empty "" if no options are passed. But you suggest to use
> "${@}" instead, still with "". How does that fix the particular problem
> you mentioned below?

Because "${@}" expands to nothing if there is no paramter.

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18

@
    Expands to the positional parameters, starting from one. When the
    expansion occurs within double-quotes, and where field splitting (see
    Field Splitting) is performed, each positional parameter shall expand
    as a separate field [...]. If there are no positional parameters, the
    expansion of '@' shall generate zero fields, even when '@' is
    double-quoted.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH v2 1/6] support/download: Add support to pass options directly to downloaders
  2016-07-24 14:04       ` Yann E. MORIN
@ 2016-07-24 14:05         ` Thomas Petazzoni
  2016-07-26  7:31           ` Romain Perier
  0 siblings, 1 reply; 19+ messages in thread
From: Thomas Petazzoni @ 2016-07-24 14:05 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 24 Jul 2016 16:04:01 +0200, Yann E. MORIN wrote:

> Because "${@}" expands to nothing if there is no paramter.
> 
> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18
> 
> @
>     Expands to the positional parameters, starting from one. When the
>     expansion occurs within double-quotes, and where field splitting (see
>     Field Splitting) is performed, each positional parameter shall expand
>     as a separate field [...]. If there are no positional parameters, the
>     expansion of '@' shall generate zero fields, even when '@' is
>     double-quoted.

Aaah. Didn't know that. Thanks for the explanation.

Romain, can you respin to use "${@}" like Yann suggested, and fix the
other issues pointed by Yann?

Thanks!

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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH v2 3/6] docs/manual: Document the variable $(PKG)_DL_OPTS
  2016-07-15 16:00   ` Yann E. MORIN
@ 2016-07-26  7:30     ` Romain Perier
  0 siblings, 0 replies; 19+ messages in thread
From: Romain Perier @ 2016-07-26  7:30 UTC (permalink / raw)
  To: buildroot

Hi all,

Le 15/07/2016 18:00, Yann E. MORIN a ?crit :
>
> With the last sentence, I'd also say something like:
>
>      All download methods valid for +LIBFOO_SITE_METHOD+ are supported;
>      valid options depend on the download method (consult the man page
>      for the respective download utilities).
>
> Regards,
> Yann E. MORIN.
>
>>   * +LIBFOO_EXTRA_DOWNLOADS+ is a space-separated list of additional
>>     files that Buildroot should download. If an entry contains +://+
>>     then Buildroot will assume it is a complete URL and will download
>> --
>> 2.8.1

Ack, I will fix this.

Thanks!

-- 
Romain Perier, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Buildroot] [PATCH v2 1/6] support/download: Add support to pass options directly to downloaders
  2016-07-24 14:05         ` Thomas Petazzoni
@ 2016-07-26  7:31           ` Romain Perier
  0 siblings, 0 replies; 19+ messages in thread
From: Romain Perier @ 2016-07-26  7:31 UTC (permalink / raw)
  To: buildroot

Hello,

Le 24/07/2016 16:05, Thomas Petazzoni a ?crit :
> Romain, can you respin to use "${@}" like Yann suggested, and fix the
> other issues pointed by Yann?
>
> Thanks!
>
> Thomas
>

Sure, I will fix this in v3.

Thanks

-- 
Romain Perier, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2016-07-26  7:31 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-12  9:30 [Buildroot] [PATCH v2 0/6] Add support for AMD Catalyst graphics driver Romain Perier
2016-07-12  9:30 ` [Buildroot] [PATCH v2 1/6] support/download: Add support to pass options directly to downloaders Romain Perier
2016-07-15 15:54   ` Yann E. MORIN
2016-07-15 17:21     ` Thomas Petazzoni
2016-07-15 20:47   ` Yann E. MORIN
2016-07-24 14:00     ` Thomas Petazzoni
2016-07-24 14:04       ` Yann E. MORIN
2016-07-24 14:05         ` Thomas Petazzoni
2016-07-26  7:31           ` Romain Perier
2016-07-12  9:30 ` [Buildroot] [PATCH v2 2/6] pkg-download: Allow packages to pass generic options to download methods Romain Perier
2016-07-15 15:56   ` Yann E. MORIN
2016-07-12  9:30 ` [Buildroot] [PATCH v2 3/6] docs/manual: Document the variable $(PKG)_DL_OPTS Romain Perier
2016-07-15 16:00   ` Yann E. MORIN
2016-07-26  7:30     ` Romain Perier
2016-07-12  9:30 ` [Buildroot] [PATCH v2 4/6] package/xserver_xorg-server: add version 1.17.4 Romain Perier
2016-07-15 13:23   ` Thomas Petazzoni
2016-07-12  9:30 ` [Buildroot] [PATCH v2 5/6] qt: Add option for enabling the accessibility support Romain Perier
2016-07-15 13:23   ` Thomas Petazzoni
2016-07-12  9:30 ` [Buildroot] [PATCH v2 6/6] package/amd-catalyst-driver: Add AMD proprietary graphic stack support Romain Perier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.