Skip to contentSkip to conversation

weston: new freerdp backend (branch yem/freerdp)

PATCH Superseded Yann E. MORIN 3 participants 9 messages Dec 7, 2014 – Dec 8, 2014

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v3 cover weston: new freerdp backend (branch yem/freerdp)

Hello All!

This series adds the RDP backend to Weston. As a side effect, it cleans up and enhances FreeRDP.

Changes v2 -> v3:
- rework completely the depednencies on X11 libraries (Samuel)
- only install keys when the server is enabled (Samuel)

Changes v1 -> v2:
- new package python-lxml, needed for opengl-registry (Tomas P.)
- cleanup opengl-registry and nvidia-driver (Thomas P.)
- drop applied patches (Thomas P.)

Regards,
Yann E. MORIN.

The following changes since commit c5f0e93d2cc6107cce249e1f11158aeccb4a3449:

rp-pppoe: install default conf file (2014-12-03 23:26:21 +0100)

are available in the git repository at:

git://git.busybox.net/~ymorin/git/buildroot

for you to fetch changes up to 60f5963bb803d787a63918b0425798e7463984ff:

package/weston: add support for the RDP compositor (2014-12-07 12:37:40 +0100)

----------------------------------------------------------------
Yann E. MORIN (6):
pacakge/freerdp: disable building the manpages package/freerdp: do not forcibly depend on X.Org package/freerdp: add options to enable/disable server and/or client package/freerdp: also install to staging package/freerdp: install server key and certificate package/weston: add support for the RDP compositor

 package/Config.in                                  |  2 +-
 package/freerdp/Config.in                          | 29 ++++++--
 .../freerdp-0002-fix-building-shared-libs.patch    | 23 ++++++
 package/freerdp/freerdp.mk                         | 84 +++++++++++++++++++++-
 package/weston/Config.in                           | 17 +++++
 package/weston/weston.mk                           |  7 ++
 6 files changed, 154 insertions(+), 8 deletions(-)
 create mode 100644 package/freerdp/freerdp-0002-fix-building-shared-libs.patch
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
#1 lore raw

PATCH v3 1/6 pacakge/freerdp: disable building the manpages

Building the manpages requires xsltproc, which might not be available. Also, who needs the manpages on the target anyway? ;-)

---
 package/freerdp/freerdp.mk | 2 ++
 1 file changed, 2 insertions(+)
package/freerdp/freerdp.mk +2 -0
index cb745ec..d2e51f8 100644
@@ -12,6 +12,8 @@ FREERDP_DEPENDENCIES = openssl zlib \
 FREERDP_LICENSE = Apache-2.0
 FREERDP_LICENSE_FILES = LICENSE
 
+FREERDP_CONF_OPTS = -DWITH_MANPAGES=OFF
+
 ifeq ($(BR2_PACKAGE_CUPS),y)
 FREERDP_CONF_OPTS += -DWITH_CUPS=ON
 FREERDP_DEPENDENCIES += cups
Signature · 1 line
1.9.1
#2 lore raw

PATCH v3 1/6 pacakge/freerdp: disable building the manpages

Dear Yann E. MORIN,

Quoted 8 lines · Yann E. MORIN

Building the manpages requires xsltproc, which might not be available. Also, who needs the manpages on the target anyway? ;-)

---
 package/freerdp/freerdp.mk | 2 ++
 1 file changed, 2 insertions(+)

Applied, thanks.

Thomas

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

PATCH v3 2/6 package/freerdp: do not forcibly depend on X.Org

In reply to Yann E. MORIN

It is possible to build the libfreerdp standalone, without X.Org. Having a libfreerdp will be usefull for the weston RDP compositor.

So, only select the strictly required X.Org library if X.Org is enabled, and only build with Xcursor if it is enabled. Drop dependency on other X.Org libraries, as they are not strictly required (or get pulled as dependencies of the mandatory libXext).

Re-order the menuconfig, as freerdp is no longer an X-only application.

---
 package/Config.in          |  2 +-
 package/freerdp/Config.in  |  6 +-----
 package/freerdp/freerdp.mk | 17 +++++++++++++++--
 3 files changed, 17 insertions(+), 8 deletions(-)
package/Config.in +1 -1
index a8010d3..f6d7a0a 100644
@@ -206,6 +206,7 @@ endif
 	source "package/fb-test-app/Config.in"
 	source "package/fbterm/Config.in"
 	source "package/fbv/Config.in"
+	source "package/freerdp/Config.in"
 	source "package/imagemagick/Config.in"
 	source "package/linux-fusion/Config.in"
 	source "package/lite/Config.in"
@@ -242,7 +243,6 @@ comment "X applications"
 	source "package/dillo/Config.in"
 	source "package/docker/Config.in"
 	source "package/feh/Config.in"
-	source "package/freerdp/Config.in"
 	source "package/gmpc/Config.in"
 	source "package/gob2/Config.in"
 	source "package/gqview/Config.in"
package/freerdp/Config.in +1 -5
index c5ff769..09efbc0 100644
@@ -1,12 +1,8 @@
 config BR2_PACKAGE_FREERDP
 	bool "freerdp"
 	select BR2_PACKAGE_OPENSSL
-	select BR2_PACKAGE_XLIB_LIBX11
-	select BR2_PACKAGE_XLIB_LIBXT
-	select BR2_PACKAGE_XLIB_LIBXEXT
-	select BR2_PACKAGE_XLIB_LIBXCURSOR
 	select BR2_PACKAGE_ZLIB
-	depends on BR2_PACKAGE_XORG7
+	select BR2_PACKAGE_XLIB_LIBXEXT if BR2_PACKAGE_XORG7
 	help
 	  FreeRDP is a free implementation of the Remote Desktop
 	  Protocol (RDP), released under the Apache license
package/freerdp/freerdp.mk +15 -2
index d2e51f8..90aa9c5 100644
@@ -7,8 +7,7 @@
 # Changeset on the stable-1.1 branch
 FREERDP_VERSION = 440916eae2e07463912d5fe507677e67096eb083
 FREERDP_SITE = $(call github,FreeRDP,FreeRDP,$(FREERDP_VERSION))
-FREERDP_DEPENDENCIES = openssl zlib \
-	xlib_libX11 xlib_libXt xlib_libXext xlib_libXcursor
+FREERDP_DEPENDENCIES = openssl zlib
 FREERDP_LICENSE = Apache-2.0
 FREERDP_LICENSE_FILES = LICENSE
 
@@ -42,6 +41,20 @@ else
 FREERDP_CONF_OPTS += -DWITH_PULSEAUDIO=OFF
 endif
 
+ifeq ($(BR2_PACKAGE_XLIB_LIBXEXT),y)
+FREERDP_DEPENDENCIES += xlib_libXext
+FREERDP_CONF_OPTS += -DWITH_X11=ON
+else
+FREERDP_CONF_OPTS += -DWITH_X11=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_XLIB_LIBXCURSOR),y)
+FREERDP_CONF_OPTS += -DWITH_XCURSOR=ON
+FREERDP_DEPENDENCIES += xlib_libXcursor
+else
+FREERDP_CONF_OPTS += -DWITH_XCURSOR=OFF
+endif
+
 ifeq ($(BR2_PACKAGE_XLIB_LIBXINERAMA),y)
 FREERDP_CONF_OPTS += -DWITH_XINERAMA=ON
 FREERDP_DEPENDENCIES += xlib_libXinerama
Signature · 1 line
1.9.1
#4 lore raw

PATCH v3 3/6 package/freerdp: add options to enable/disable server and/or client

In reply to Yann E. MORIN

Building the client or the server requires an X.Org stack.

Since freerdp can also be used for weston (wayland-based, hence no X.Org stack), we may want to disable the client and server.

Conversely, even with an X.Org stack, we may want to enable either or none if we're just interested in the library.

Add two options, one to enable the server, the other the client; the client option defaults to 'Y' so that a previous .config can be re-used as-is, and exhibit the same behaviour as before; the server option defaults to 'N' as we were not ever building the server so far.

---
Changes v2 -> v3:
- use -fPIC only for that library that needs it, not the whole package (Samuel)
- fix X.Org dependencies (Samuel)
- don't default server to 'Y'

---
 package/freerdp/Config.in                          | 25 ++++++++-
 .../freerdp-0002-fix-building-shared-libs.patch    | 23 ++++++++
 package/freerdp/freerdp.mk                         | 62 ++++++++++++++++++++--
 3 files changed, 105 insertions(+), 5 deletions(-)
 create mode 100644 package/freerdp/freerdp-0002-fix-building-shared-libs.patch
package/freerdp/Config.in +24 -1
index 09efbc0..47fd8be 100644
@@ -2,9 +2,32 @@ config BR2_PACKAGE_FREERDP
 	bool "freerdp"
 	select BR2_PACKAGE_OPENSSL
 	select BR2_PACKAGE_ZLIB
-	select BR2_PACKAGE_XLIB_LIBXEXT if BR2_PACKAGE_XORG7
 	help
 	  FreeRDP is a free implementation of the Remote Desktop
 	  Protocol (RDP), released under the Apache license
 
+	  This only installs the freerdp library.
+
 	  http://www.freerdp.com/
+
+if BR2_PACKAGE_FREERDP
+
+config BR2_PACKAGE_FREERDP_SERVER
+	bool "build server"
+	depends on BR2_PACKAGE_XORG7
+	select BR2_PACKAGE_XLIB_LIBX11
+	select BR2_PACKAGE_XLIB_LIBXDAMAGE
+	select BR2_PACKAGE_XLIB_LIBXEXT
+	select BR2_PACKAGE_XLIB_LIBXFIXES
+
+config BR2_PACKAGE_FREERDP_CLIENT
+	bool "build client"
+	default y
+	depends on BR2_PACKAGE_XORG7
+	select BR2_PACKAGE_XLIB_LIBX11
+	select BR2_PACKAGE_XLIB_LIBXEXT
+
+comment "freerdp server and client need X.Org"
+	depends on !BR2_PACKAGE_XORG7
+
+endif
package/freerdp/freerdp-0002-fix-building-shared-libs.patch new file +23 -0
new file mode 100644
index 0000000..420f3d3
@@ -0,0 +1,23 @@
+winpr/tools: fix building shared libs
+
+libwinpr-makecert-tool.a is used to build libxfreerdp-server.so, so even
+if we are building a static libwinpr-makecert-tool.a library, we need to
+build it with -fPIC.
+
+Patch and commit log suggested by Samuel MARTIN.
+
+Signed-off-by: "Yann E. MORIN" <[email protected]>
+Cc: Samuel Martin <[email protected]>
+
+diff -durN freerdp-440916eae2e07463912d5fe507677e67096eb083.orig/winpr/tools/makecert/CMakeLists.txt freerdp-440916eae2e07463912d5fe507677e67096eb083/winpr/tools/makecert/CMakeLists.txt
+--- freerdp-440916eae2e07463912d5fe507677e67096eb083.orig/winpr/tools/makecert/CMakeLists.txt	2014-08-25 06:52:43.000000000 -0700
++++ freerdp-440916eae2e07463912d5fe507677e67096eb083/winpr/tools/makecert/CMakeLists.txt	2014-10-24 15:39:39.600319523 -0700
+@@ -43,3 +43,8 @@
+ 
+ set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR/Tools")
+ 
++if(BUILD_SHARED_LIBS)
++	# build libwinpr-makecert-tool.a with PIC because it is used to build
++	# the shared library libxfreerdp-server.so.
++	set_property(TARGET ${MODULE_NAME} PROPERTY POSITION_INDEPENDENT_CODE TRUE)
++endif()
package/freerdp/freerdp.mk +58 -4

87 lines not on this page · raw message

Signature · 1 line
1.9.1
#5 lore raw

PATCH v3 4/6 package/freerdp: also install to staging

In reply to Yann E. MORIN

freerdp installs a library that other packages may use, so we must also install it to staging.

---
 package/freerdp/freerdp.mk | 2 ++
 1 file changed, 2 insertions(+)
package/freerdp/freerdp.mk +2 -0
index df6b034..67f9960 100644
@@ -11,6 +11,8 @@ FREERDP_DEPENDENCIES = openssl zlib
 FREERDP_LICENSE = Apache-2.0
 FREERDP_LICENSE_FILES = LICENSE
 
+FREERDP_INSTALL_STAGING = YES
+
 FREERDP_CONF_OPTS = -DWITH_MANPAGES=OFF
 
 ifeq ($(BR2_PACKAGE_CUPS),y)
Signature · 1 line
1.9.1
#6 lore raw

PATCH v3 5/6 package/freerdp: install server key and certificate

In reply to Yann E. MORIN

This is mandatory for an RDP server to have a key and a certificate, otherwise clients will refuse to connect to that server.

We install the key and certificate bundled in FreeRDP. The user can install its own set using a post-build script if needed.

---
Changes v2 -> v3:
- only install the keys when the server is enabled (Samuel)

---
 package/freerdp/freerdp.mk | 9 +++++++++
 1 file changed, 9 insertions(+)
package/freerdp/freerdp.mk +9 -0
index 67f9960..2fa880f 100644
@@ -48,6 +48,15 @@ endif
 
 ifeq ($(BR2_PACKAGE_FREERDP_SERVER),y)
 FREERDP_CONF_OPTS += -DWITH_SERVER=ON -DWITH_SERVER_INTERFACE=ON
+# Install the server key and certificate, so that a client can connect.
+# A user can override them with its own in a post-build script, if needed.
+define FREERDP_INSTALL_KEYS
+	$(INSTALL) -D $(@D)/server/X11/server.key \
+		      $(TARGET_DIR)/etc/freerdp/keys/server.key
+	$(INSTALL) -D $(@D)/server/X11/server.crt \
+		      $(TARGET_DIR)/etc/freerdp/keys/server.crt
+endef
+FREERDP_POST_INSTALL_TARGET_HOOKS += FREERDP_INSTALL_KEYS
 else
 FREERDP_CONF_OPTS += -DWITH_SERVER=OFF -DWITH_SERVER_INTERFACE=OFF
 endif
Signature · 1 line
1.9.1
#7 lore raw

PATCH v3 5/6 package/freerdp: install server key and certificate

Quoted 8 lines · Yann E. MORIN

This is mandatory for an RDP server to have a key and a certificate, otherwise clients will refuse to connect to that server.

We install the key and certificate bundled in FreeRDP. The user can install its own set using a post-build script if needed.

Quoted 31 lines

---
Changes v2 -> v3:
- only install the keys when the server is enabled (Samuel)

---
 package/freerdp/freerdp.mk | 9 +++++++++
 1 file changed, 9 insertions(+)
package/freerdp/freerdp.mk +9 -1
index 67f9960..2fa880f 100644
@@ -48,6 +48,15 @@ endif
 
 ifeq ($(BR2_PACKAGE_FREERDP_SERVER),y)
 FREERDP_CONF_OPTS += -DWITH_SERVER=ON -DWITH_SERVER_INTERFACE=ON
+# Install the server key and certificate, so that a client can connect.
+# A user can override them with its own in a post-build script, if needed.
+define FREERDP_INSTALL_KEYS
+       $(INSTALL) -D $(@D)/server/X11/server.key \
+                     $(TARGET_DIR)/etc/freerdp/keys/server.key
+       $(INSTALL) -D $(@D)/server/X11/server.crt \
+                     $(TARGET_DIR)/etc/freerdp/keys/server.crt
+endef
+FREERDP_POST_INSTALL_TARGET_HOOKS += FREERDP_INSTALL_KEYS
 else
 FREERDP_CONF_OPTS += -DWITH_SERVER=OFF -DWITH_SERVER_INTERFACE=OFF
 endif
--

1.9.1

Signature · 1 line
Samuel
#8 lore raw

PATCH v3 6/6 package/weston: add support for the RDP compositor

In reply to Yann E. MORIN

Using the RDP compositor, one can run a headless machine to serve remote clients, using the RDP protocol.

Add an option to enable the rdp-backend.

---
 package/weston/Config.in | 17 +++++++++++++++++
 package/weston/weston.mk |  7 +++++++
 2 files changed, 24 insertions(+)
package/weston/Config.in +17 -0
index cf242d1..1d29ea3 100644
@@ -40,6 +40,23 @@ config BR2_PACKAGE_WESTON_HAS_COMPOSITOR
 config BR2_PACKAGE_WESTON_FBDEV
 	bool "fbdev compositor"
 
+config BR2_PACKAGE_WESTON_RDP
+	bool "RDP compositor"
+	select BR2_PACKAGE_FREERDP
+	select BR2_PACKAGE_WESTON_HAS_COMPOSITOR
+	help
+	  This enables the RDP backend, which allows accessing weston
+	  through the network with any RDP-compliant client.
+
+	  Please note that one must pass those options to weston for RDP
+	  to be functional:
+	    --rdp-tls-cert=/path/to/server.crt
+	    --rdp-tls-key=/path/to/server.key
+
+	  By default, Buildroot installs such files in /etc/freerdp/server/
+	  so you may want to change them in a post-build script or a rootfs
+	  overlay.
+
 comment "RPi compositor needs a toolchain w/ C++, largefile, threads"
 	depends on BR2_arm
 	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_LARGEFILE || !BR2_TOOLCHAIN_HAS_THREADS
package/weston/weston.mk +7 -0
index 9964b90..2829a10 100644
@@ -32,6 +32,13 @@ else
 WESTON_CONF_OPTS += --disable-libinput-backend
 endif
 
+ifeq ($(BR2_PACKAGE_WESTON_RDP),y)
+WESTON_DEPENDENCIES += freerdp
+WESTON_CONF_OPTS += --enable-rdp-compositor
+else
+WESTON_CONF_OPTS += --disable-rdp-compositor
+endif
+
 ifeq ($(BR2_PACKAGE_LIBUNWIND),y)
 WESTON_DEPENDENCIES += libunwind
 else
Signature · 1 line
1.9.1