diff options
author | Zheng Ruoqin <zhengrq.fnst@cn.fujitsu.com> | 2017-12-12 22:36:50 +0800 |
---|---|---|
committer | Armin Kuster <akuster808@gmail.com> | 2017-12-22 19:43:55 -0800 |
commit | cc32ca8030c02a2b1b22f6b43e1894dc5f00e14e (patch) | |
tree | 94db74e8784386cf7f60cc67b02cd8da4e062760 /meta-oe | |
parent | 80b3f2e8203b26d8424d2e86405293a1fc0e262b (diff) | |
download | meta-openembedded-cc32ca8030c02a2b1b22f6b43e1894dc5f00e14e.tar.gz |
xrdp: Add some scripts and patches
Add some scripts and patches for xrdp to make it work properly.
Signed-off-by: Zheng Ruoqin <zhengrq.fnst@cn.fujitsu.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Diffstat (limited to 'meta-oe')
5 files changed, 227 insertions, 3 deletions
diff --git a/meta-oe/recipes-support/xrdp/xrdp/0001-Added-req_distinguished_name-in-etc-xrdp-openssl.con.patch b/meta-oe/recipes-support/xrdp/xrdp/0001-Added-req_distinguished_name-in-etc-xrdp-openssl.con.patch new file mode 100644 index 000000000..5e7fca02a --- /dev/null +++ b/meta-oe/recipes-support/xrdp/xrdp/0001-Added-req_distinguished_name-in-etc-xrdp-openssl.con.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | From d705b1d666cb8713d86ea6fb2fc45c424128285a Mon Sep 17 00:00:00 2001 | ||
2 | From: Lei Maohui <leimaohui@cn.fujitsu.com> | ||
3 | Date: Fri, 1 Dec 2017 10:24:50 +0900 | ||
4 | Subject: [PATCH] Added req_distinguished_name in /etc/xrdp/openssl.conf, | ||
5 | otherwise, cert.pem can't be created. | ||
6 | |||
7 | Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com> | ||
8 | --- | ||
9 | keygen/openssl.conf | 8 ++++++++ | ||
10 | 1 file changed, 8 insertions(+) | ||
11 | |||
12 | diff --git a/keygen/openssl.conf b/keygen/openssl.conf | ||
13 | index 09db6c2..f077d72 100644 | ||
14 | --- a/keygen/openssl.conf | ||
15 | +++ b/keygen/openssl.conf | ||
16 | @@ -4,6 +4,14 @@ distinguished_name = req_distinguished_name | ||
17 | x509_extensions = v3_ca | ||
18 | |||
19 | [req_distinguished_name] | ||
20 | +# Certificate subject | ||
21 | +#countryName = US | ||
22 | +#stateOrProvinceName = CA | ||
23 | +#localityName = Sunnyvale | ||
24 | +#organizationName = xrdp | ||
25 | +#organizationalUnitName = | ||
26 | +commonName = XRDP | ||
27 | +#emailAddress = | ||
28 | |||
29 | [v3_ca] | ||
30 | # Extensions for a typical CA - PKIX recommendation. | ||
31 | -- | ||
32 | 1.8.4.2 | ||
33 | |||
diff --git a/meta-oe/recipes-support/xrdp/xrdp/0001-Fix-sesman.ini-and-xrdp.ini.patch b/meta-oe/recipes-support/xrdp/xrdp/0001-Fix-sesman.ini-and-xrdp.ini.patch new file mode 100644 index 000000000..deaadde8c --- /dev/null +++ b/meta-oe/recipes-support/xrdp/xrdp/0001-Fix-sesman.ini-and-xrdp.ini.patch | |||
@@ -0,0 +1,75 @@ | |||
1 | From a9c460f158d68c1b3de6a31ce853de5379977695 Mon Sep 17 00:00:00 2001 | ||
2 | From: Lei Maohui <leimaohui@cn.fujitsu.com> | ||
3 | Date: Thu, 30 Nov 2017 11:10:04 +0900 | ||
4 | Subject: [PATCH] Fix sesman.ini and xrdp.ini | ||
5 | |||
6 | Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com> | ||
7 | --- | ||
8 | sesman/sesman.ini | 20 ++++++-------------- | ||
9 | xrdp/xrdp.ini | 10 ---------- | ||
10 | 2 files changed, 6 insertions(+), 24 deletions(-) | ||
11 | |||
12 | diff --git a/sesman/sesman.ini b/sesman/sesman.ini | ||
13 | index 8225ee4..c09189e 100644 | ||
14 | --- a/sesman/sesman.ini | ||
15 | +++ b/sesman/sesman.ini | ||
16 | @@ -54,12 +54,14 @@ LogLevel=DEBUG | ||
17 | EnableSyslog=1 | ||
18 | SyslogLevel=DEBUG | ||
19 | |||
20 | -[X11rdp] | ||
21 | -param=X11rdp | ||
22 | -param=-bs | ||
23 | +[Xorg] | ||
24 | +param=Xorg | ||
25 | +param=-config | ||
26 | +param=xrdp/xorg.conf | ||
27 | +param=-noreset | ||
28 | param=-nolisten | ||
29 | param=tcp | ||
30 | -param=-uds | ||
31 | + | ||
32 | |||
33 | [Xvnc] | ||
34 | param=Xvnc | ||
35 | @@ -70,16 +72,6 @@ param=-localhost | ||
36 | param=-dpi | ||
37 | param=96 | ||
38 | |||
39 | -[Xorg] | ||
40 | -param=Xorg | ||
41 | -param=-config | ||
42 | -param=xrdp/xorg.conf | ||
43 | -param=-noreset | ||
44 | -param=-nolisten | ||
45 | -param=tcp | ||
46 | -param=-logfile | ||
47 | -param=.xorgxrdp.%s.log | ||
48 | - | ||
49 | [Chansrv] | ||
50 | ; drive redirection, defaults to xrdp_client if not set | ||
51 | FuseMountName=thinclient_drives | ||
52 | diff --git a/xrdp/xrdp.ini b/xrdp/xrdp.ini | ||
53 | index cb6d7c3..9f63a69 100644 | ||
54 | --- a/xrdp/xrdp.ini | ||
55 | +++ b/xrdp/xrdp.ini | ||
56 | @@ -157,16 +157,6 @@ ip=127.0.0.1 | ||
57 | port=-1 | ||
58 | code=20 | ||
59 | |||
60 | -[X11rdp] | ||
61 | -name=X11rdp | ||
62 | -lib=libxup.so | ||
63 | -username=ask | ||
64 | -password=ask | ||
65 | -ip=127.0.0.1 | ||
66 | -port=-1 | ||
67 | -xserverbpp=24 | ||
68 | -code=10 | ||
69 | - | ||
70 | [Xvnc] | ||
71 | name=Xvnc | ||
72 | lib=libvnc.so | ||
73 | -- | ||
74 | 1.8.4.2 | ||
75 | |||
diff --git a/meta-oe/recipes-support/xrdp/xrdp/0001-Fix-the-compile-error.patch b/meta-oe/recipes-support/xrdp/xrdp/0001-Fix-the-compile-error.patch new file mode 100644 index 000000000..82b279085 --- /dev/null +++ b/meta-oe/recipes-support/xrdp/xrdp/0001-Fix-the-compile-error.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | Subject: [PATCH] Fix the make error | ||
2 | |||
3 | Fix the compile error: | ||
4 | *** No rule to make target '../librfxcodec/src/.libs/librfxencode.a', needed by 'xrdp'. Stop.. | ||
5 | |||
6 | Signed-off-by: Zheng Ruoqin <zhengrq.fnst@cn.fujitsu.com> | ||
7 | --- | ||
8 | xrdp/Makefile.am | 4 ++-- | ||
9 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
10 | |||
11 | diff --git a/xrdp/Makefile.am b/xrdp/Makefile.am | ||
12 | index a259ef3..d5505b2 100644 | ||
13 | --- a/xrdp/Makefile.am | ||
14 | +++ b/xrdp/Makefile.am | ||
15 | @@ -23,7 +23,7 @@ endif | ||
16 | if XRDP_RFXCODEC | ||
17 | AM_CPPFLAGS += -DXRDP_RFXCODEC | ||
18 | AM_CPPFLAGS += -I$(top_srcdir)/librfxcodec/include | ||
19 | -XRDP_EXTRA_LIBS += $(top_builddir)/librfxcodec/src/.libs/librfxencode.a | ||
20 | +XRDP_EXTRA_LIBS += $(top_builddir)/librfxcodec/src/.libs/librfxencode.la | ||
21 | endif | ||
22 | |||
23 | if XRDP_PIXMAN | ||
24 | @@ -35,7 +35,7 @@ endif | ||
25 | if XRDP_PAINTER | ||
26 | AM_CPPFLAGS += -DXRDP_PAINTER | ||
27 | AM_CPPFLAGS += -I$(top_srcdir)/libpainter/include | ||
28 | -XRDP_EXTRA_LIBS += $(top_builddir)/libpainter/src/.libs/libpainter.a | ||
29 | +XRDP_EXTRA_LIBS += $(top_builddir)/libpainter/src/.libs/libpainter.la | ||
30 | endif | ||
31 | |||
32 | sbin_PROGRAMS = \ | ||
33 | -- | ||
34 | 2.7.4 | ||
35 | |||
diff --git a/meta-oe/recipes-support/xrdp/xrdp/xrdp.sysconfig b/meta-oe/recipes-support/xrdp/xrdp/xrdp.sysconfig new file mode 100644 index 000000000..39f500a33 --- /dev/null +++ b/meta-oe/recipes-support/xrdp/xrdp/xrdp.sysconfig | |||
@@ -0,0 +1,4 @@ | |||
1 | # put some options here | ||
2 | |||
3 | XRDP_OPTIONS="" | ||
4 | SESMAN_OPTIONS="" | ||
diff --git a/meta-oe/recipes-support/xrdp/xrdp_0.9.4.bb b/meta-oe/recipes-support/xrdp/xrdp_0.9.4.bb index f6fe42afd..e7a77e449 100644 --- a/meta-oe/recipes-support/xrdp/xrdp_0.9.4.bb +++ b/meta-oe/recipes-support/xrdp/xrdp_0.9.4.bb | |||
@@ -4,16 +4,93 @@ LICENSE = "Apache-2.0" | |||
4 | LIC_FILES_CHKSUM = "file://COPYING;md5=72cfbe4e7bd33a0a1de9630c91195c21 \ | 4 | LIC_FILES_CHKSUM = "file://COPYING;md5=72cfbe4e7bd33a0a1de9630c91195c21 \ |
5 | " | 5 | " |
6 | 6 | ||
7 | inherit distro_features_check | 7 | inherit distro_features_check autotools pkgconfig useradd systemd |
8 | 8 | ||
9 | DEPENDS = "openssl virtual/libx11 libxfixes libxrandr" | 9 | DEPENDS = "openssl virtual/libx11 libxfixes libxrandr libpam nasm-native" |
10 | 10 | ||
11 | REQUIRED_DISTRO_FEATURES = "x11" | 11 | REQUIRED_DISTRO_FEATURES = "x11" |
12 | 12 | ||
13 | SRC_URI = "git://github.com/neutrinolabs/xrdp.git" | 13 | SRC_URI = "git://github.com/neutrinolabs/xrdp.git \ |
14 | file://xrdp.sysconfig \ | ||
15 | file://0001-Fix-sesman.ini-and-xrdp.ini.patch \ | ||
16 | file://0001-Added-req_distinguished_name-in-etc-xrdp-openssl.con.patch \ | ||
17 | file://0001-Fix-the-compile-error.patch \ | ||
18 | " | ||
14 | 19 | ||
15 | SRCREV = "c295dd61b882e8b56677cf12791f43634f9190b5" | 20 | SRCREV = "c295dd61b882e8b56677cf12791f43634f9190b5" |
16 | 21 | ||
17 | PV = "0.9.4+git${SRCPV}" | 22 | PV = "0.9.4+git${SRCPV}" |
18 | 23 | ||
19 | S = "${WORKDIR}/git" | 24 | S = "${WORKDIR}/git" |
25 | |||
26 | USERADD_PACKAGES = "${PN}" | ||
27 | GROUPADD_PARAM_${PN} = "--system xrdp" | ||
28 | USERADD_PARAM_${PN} = "--system --home /var/run/xrdp -g xrdp \ | ||
29 | --no-create-home --shell /bin/false xrdp" | ||
30 | |||
31 | FILES_${PN} += "${datadir}/dbus-1/services/*.service \ | ||
32 | ${datadir}/dbus-1/accessibility-services/*.service " | ||
33 | |||
34 | FILES_${PN}-dev += "${libdir}/xrdp/libcommon.so \ | ||
35 | ${libdir}/xrdp/libxrdp.so \ | ||
36 | ${libdir}/xrdp/libscp.so \ | ||
37 | ${libdir}/xrdp/libxrdpapi.so " | ||
38 | |||
39 | #EXTRA_OECONF = "--disable-rfxcodec --disable-painter" | ||
40 | |||
41 | do_configure_prepend() { | ||
42 | cd ${S} | ||
43 | ./bootstrap | ||
44 | cd - | ||
45 | } | ||
46 | |||
47 | do_compile_prepend() { | ||
48 | sed -i 's/(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am/(MAKE) $(AM_MAKEFLAGS) install-exec-am/g' ${S}/keygen/Makefile.in | ||
49 | } | ||
50 | |||
51 | |||
52 | do_install_append() { | ||
53 | install -d ${D}${sysconfdir} | ||
54 | install -d ${D}${sysconfdir}/xrdp | ||
55 | install -d ${D}${sysconfdir}/xrdp/pam.d | ||
56 | install -d ${D}${sysconfdir}/sysconfig/xrdp | ||
57 | |||
58 | # deal with systemd unit files | ||
59 | install -d ${D}${systemd_unitdir}/system | ||
60 | install -m 0644 ${S}/instfiles/xrdp.service.in ${D}${systemd_unitdir}/system/xrdp.service | ||
61 | install -m 0644 ${S}/instfiles/xrdp-sesman.service.in ${D}${systemd_unitdir}/system/xrdp-sesman.service | ||
62 | sed -i -e 's,@localstatedir@,${localstatedir},g' ${D}${systemd_unitdir}/system/xrdp.service ${D}${systemd_unitdir}/system/xrdp-sesman.service | ||
63 | sed -i -e 's,@sysconfdir@,${sysconfdir},g' ${D}${systemd_unitdir}/system/xrdp.service ${D}${systemd_unitdir}/system/xrdp-sesman.service | ||
64 | sed -i -e 's,@sbindir@,${sbindir},g' ${D}${systemd_unitdir}/system/xrdp.service ${D}${systemd_unitdir}/system/xrdp-sesman.service | ||
65 | |||
66 | install -m 0644 ${S}/instfiles/*.ini ${D}${sysconfdir}/xrdp/ | ||
67 | install -m 0644 ${S}/instfiles/pam.d/xrdp-sesman.debian ${D}${sysconfdir}/xrdp/pam.d/xrdp-sesman | ||
68 | install -m 0644 ${S}/sesman/sesman.ini ${D}${sysconfdir}/xrdp/ | ||
69 | install -m 0644 ${S}/sesman/startwm.sh ${D}${sysconfdir}/xrdp/ | ||
70 | install -m 0644 ${S}/xrdp/xrdp.ini ${D}${sysconfdir}/xrdp/ | ||
71 | install -m 0644 ${S}/xrdp/xrdp_keyboard.ini ${D}${sysconfdir}/xrdp/ | ||
72 | install -m 0644 ${S}/instfiles/xrdp.sh ${D}${sysconfdir}/xrdp/ | ||
73 | install -m 0644 ${S}/keygen/openssl.conf ${D}${sysconfdir}/xrdp/ | ||
74 | install -m 0644 ${WORKDIR}/xrdp.sysconfig ${D}${sysconfdir}/sysconfig/xrdp/ | ||
75 | chown xrdp:xrdp ${D}${sysconfdir}/xrdp | ||
76 | } | ||
77 | |||
78 | SYSTEMD_SERVICE_${PN} = "xrdp.service xrdp-sesman.service" | ||
79 | |||
80 | pkg_postinst_${PN}() { | ||
81 | if test -z "$D" | ||
82 | then | ||
83 | if test -x ${bindir}/xrdp-keygen | ||
84 | then | ||
85 | ${bindir}/xrdp-keygen xrdp ${sysconfdir}/xrdp/rsakeys.ini >/dev/null | ||
86 | fi | ||
87 | if test ! -s ${sysconfdir}/xrdp/cert.pem | ||
88 | then | ||
89 | openssl req -x509 -newkey rsa:2048 -sha256 -nodes -days 3652 \ | ||
90 | -keyout ${sysconfdir}/xrdp/key.pem \ | ||
91 | -out ${sysconfdir}/xrdp/cert.pem \ | ||
92 | -config ${sysconfdir}/xrdp/openssl.conf >/dev/null 2>&1 | ||
93 | chmod 400 ${sysconfdir}/xrdp/key.pem | ||
94 | fi | ||
95 | fi | ||
96 | } | ||