summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/rpcbind
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/rpcbind')
-rw-r--r--meta/recipes-extended/rpcbind/rpcbind/0001-systemd-use-EnvironmentFile.patch23
-rw-r--r--meta/recipes-extended/rpcbind/rpcbind/rpcbind.systemd3
-rw-r--r--meta/recipes-extended/rpcbind/rpcbind/rpcbind.tmpfiles1
-rw-r--r--meta/recipes-extended/rpcbind/rpcbind/rpcbind_add_option_to_fix_port_number.patch58
-rw-r--r--meta/recipes-extended/rpcbind/rpcbind_1.2.7.bb (renamed from meta/recipes-extended/rpcbind/rpcbind_1.2.5.bb)30
5 files changed, 64 insertions, 51 deletions
diff --git a/meta/recipes-extended/rpcbind/rpcbind/0001-systemd-use-EnvironmentFile.patch b/meta/recipes-extended/rpcbind/rpcbind/0001-systemd-use-EnvironmentFile.patch
index b92f2cf7b1..1d7ba7d508 100644
--- a/meta/recipes-extended/rpcbind/rpcbind/0001-systemd-use-EnvironmentFile.patch
+++ b/meta/recipes-extended/rpcbind/rpcbind/0001-systemd-use-EnvironmentFile.patch
@@ -9,34 +9,33 @@ Upstream-Status: Inappropriate [OE specific]
9Signed-off-by: Stefan Agner <stefan.agner@toradex.com> 9Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
10--- 10---
11 configure.ac | 2 ++ 11 configure.ac | 2 ++
12 systemd/rpcbind.service.in | 2 +- 12 systemd/rpcbind.service.in | 1 +
13 2 files changed, 3 insertions(+), 1 deletion(-) 13 2 files changed, 3 insertions(+)
14 14
15diff --git a/configure.ac b/configure.ac 15diff --git a/configure.ac b/configure.ac
16index 2dd9471..47a46c0 100644 16index 8f4cef3..4705413 100644
17--- a/configure.ac 17--- a/configure.ac
18+++ b/configure.ac 18+++ b/configure.ac
19@@ -69,5 +69,7 @@ AC_CHECK_HEADERS([nss.h rpcsvc/mount.h]) 19@@ -86,5 +86,7 @@ AC_CHECK_HEADERS([nss.h])
20 # 2 "evals" needed to expand variable names 20 # 2 "evals" needed to expand variable names
21 AC_SUBST([_sbindir]) 21 AC_SUBST([_sbindir])
22 AC_CONFIG_COMMANDS_PRE([eval eval _sbindir=$sbindir]) 22 AC_CONFIG_COMMANDS_PRE([eval eval _sbindir=$sbindir])
23+AC_SUBST([_sysconfdir]) 23+AC_SUBST([_sysconfdir])
24+AC_CONFIG_COMMANDS_PRE([eval eval _sysconfdir=$sbindir]) 24+AC_CONFIG_COMMANDS_PRE([eval eval _sysconfdir=$sysconfdir])
25 25
26 AC_OUTPUT([Makefile systemd/rpcbind.service]) 26 AC_OUTPUT([Makefile systemd/rpcbind.service systemd/rpcbind.socket])
27diff --git a/systemd/rpcbind.service.in b/systemd/rpcbind.service.in 27diff --git a/systemd/rpcbind.service.in b/systemd/rpcbind.service.in
28index 7b1c74b..f45ee1e 100644 28index c892ca8..e0511bd 100644
29--- a/systemd/rpcbind.service.in 29--- a/systemd/rpcbind.service.in
30+++ b/systemd/rpcbind.service.in 30+++ b/systemd/rpcbind.service.in
31@@ -11,7 +11,7 @@ Wants=rpcbind.target 31@@ -12,6 +12,7 @@ Wants=rpcbind.target
32
33 [Service] 32 [Service]
34 Type=notify 33 Type=notify
35-# distro can provide a drop-in adding EnvironmentFile=-/??? if needed. 34 # distro can provide a drop-in adding EnvironmentFile=-/??? if needed.
36+EnvironmentFile=-@_sysconfdir@/rpcbind.conf 35+EnvironmentFile=-@_sysconfdir@/rpcbind.conf
37 ExecStart=@_sbindir@/rpcbind $RPCBIND_OPTIONS -w -f 36 ExecStart=@_sbindir@/rpcbind $RPCBIND_OPTIONS @warmstarts_opt@ -f
38 37
39 [Install] 38 [Install]
40-- 39--
412.23.0 402.34.1
42 41
diff --git a/meta/recipes-extended/rpcbind/rpcbind/rpcbind.systemd b/meta/recipes-extended/rpcbind/rpcbind/rpcbind.systemd
new file mode 100644
index 0000000000..5765751326
--- /dev/null
+++ b/meta/recipes-extended/rpcbind/rpcbind/rpcbind.systemd
@@ -0,0 +1,3 @@
1[Unit]
2# Make sure the runtime directory exists
3After=systemd-tmpfiles-setup.service
diff --git a/meta/recipes-extended/rpcbind/rpcbind/rpcbind.tmpfiles b/meta/recipes-extended/rpcbind/rpcbind/rpcbind.tmpfiles
new file mode 100644
index 0000000000..fecee72c09
--- /dev/null
+++ b/meta/recipes-extended/rpcbind/rpcbind/rpcbind.tmpfiles
@@ -0,0 +1 @@
d /run/rpcbind 0755 root root -
diff --git a/meta/recipes-extended/rpcbind/rpcbind/rpcbind_add_option_to_fix_port_number.patch b/meta/recipes-extended/rpcbind/rpcbind/rpcbind_add_option_to_fix_port_number.patch
index 434b6b1c4c..535f9ce20d 100644
--- a/meta/recipes-extended/rpcbind/rpcbind/rpcbind_add_option_to_fix_port_number.patch
+++ b/meta/recipes-extended/rpcbind/rpcbind/rpcbind_add_option_to_fix_port_number.patch
@@ -15,7 +15,7 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
15 3 files changed, 26 insertions(+), 3 deletions(-) 15 3 files changed, 26 insertions(+), 3 deletions(-)
16 16
17diff --git a/man/rpcbind.8 b/man/rpcbind.8 17diff --git a/man/rpcbind.8 b/man/rpcbind.8
18index af6200f..2e6146b 100644 18index fbf0ace..66f7c08 100644
19--- a/man/rpcbind.8 19--- a/man/rpcbind.8
20+++ b/man/rpcbind.8 20+++ b/man/rpcbind.8
21@@ -11,7 +11,7 @@ 21@@ -11,7 +11,7 @@
@@ -27,17 +27,17 @@ index af6200f..2e6146b 100644
27 .Sh DESCRIPTION 27 .Sh DESCRIPTION
28 The 28 The
29 .Nm 29 .Nm
30@@ -107,6 +107,8 @@ will automatically add 30@@ -96,6 +96,8 @@ will automatically add
31 and if IPv6 is enabled, 31 and if IPv6 is enabled,
32 .Li ::1 32 .Li ::1
33 to the list. 33 to the list.
34+.It Fl p 34+.It Fl p
35+Bind for fixed UDP port number 35+Bind for fixed UDP port number
36 .It Fl i 36 If no
37 .Dq Insecure 37 .Fl h
38 mode. 38 option is specified,
39diff --git a/src/rpcb_svc_com.c b/src/rpcb_svc_com.c 39diff --git a/src/rpcb_svc_com.c b/src/rpcb_svc_com.c
40index 8aef9e5..c2632a4 100644 40index 1743dad..07a1c75 100644
41--- a/src/rpcb_svc_com.c 41--- a/src/rpcb_svc_com.c
42+++ b/src/rpcb_svc_com.c 42+++ b/src/rpcb_svc_com.c
43@@ -48,6 +48,7 @@ 43@@ -48,6 +48,7 @@
@@ -60,8 +60,8 @@ index 8aef9e5..c2632a4 100644
60 int fd; 60 int fd;
61 struct rmtcallfd_list *rmt; 61 struct rmtcallfd_list *rmt;
62 SVCXPRT *xprt; 62 SVCXPRT *xprt;
63+ struct __rpc_sockinfo si; 63+ struct __rpc_sockinfo si;
64+ struct t_bind taddr; 64+ struct t_bind taddr;
65 65
66 if ((fd = __rpc_nconf2fd(nconf)) == -1) { 66 if ((fd = __rpc_nconf2fd(nconf)) == -1) {
67 if (debugging) 67 if (debugging)
@@ -70,23 +70,23 @@ index 8aef9e5..c2632a4 100644
70 return (-1); 70 return (-1);
71 } 71 }
72+ 72+
73+ if (fixed_port) { 73+ if (fixed_port) {
74+ __rpc_fd2sockinfo(fd, &si); 74+ __rpc_fd2sockinfo(fd, &si);
75+ memset(&taddr, 0, sizeof(taddr)); 75+ memset(&taddr, 0, sizeof(taddr));
76+ taddr.addr.maxlen = taddr.addr.len = si.si_alen; 76+ taddr.addr.maxlen = taddr.addr.len = si.si_alen;
77+ taddr.addr.buf = malloc(si.si_alen); 77+ taddr.addr.buf = malloc(si.si_alen);
78+ if (taddr.addr.buf == NULL) { 78+ if (taddr.addr.buf == NULL) {
79+ return -1; 79+ return -1;
80+ } 80+ }
81+ *(unsigned short *)(&(taddr.addr.buf[0])) = si.si_af; 81+ *(unsigned short *)(&(taddr.addr.buf[0])) = si.si_af;
82+ *(unsigned short *)(&(taddr.addr.buf[2])) = htons(fixed_port); 82+ *(unsigned short *)(&(taddr.addr.buf[2])) = htons(fixed_port);
83+ xprt = svc_tli_create(fd, nconf, &taddr, RPC_MAXDATASIZE, RPC_MAXDATASIZE); 83+ xprt = svc_tli_create(fd, nconf, &taddr, RPC_MAXDATASIZE, RPC_MAXDATASIZE);
84+ } else 84+ } else
85 xprt = svc_tli_create(fd, 0, (struct t_bind *) 0, 0, 0); 85 xprt = svc_tli_create(fd, 0, (struct t_bind *) 0, 0, 0);
86 if (xprt == NULL) { 86 if (xprt == NULL) {
87 if (debugging) 87 if (debugging)
88diff --git a/src/rpcbind.c b/src/rpcbind.c 88diff --git a/src/rpcbind.c b/src/rpcbind.c
89index 137011b..dc3d2d6 100644 89index 25d8a90..36a95b9 100644
90--- a/src/rpcbind.c 90--- a/src/rpcbind.c
91+++ b/src/rpcbind.c 91+++ b/src/rpcbind.c
92@@ -111,6 +111,7 @@ int runasdaemon = 0; 92@@ -111,6 +111,7 @@ int runasdaemon = 0;
@@ -97,7 +97,7 @@ index 137011b..dc3d2d6 100644
97 97
98 char **hosts = NULL; 98 char **hosts = NULL;
99 int nhosts = 0; 99 int nhosts = 0;
100@@ -869,7 +870,7 @@ parseargs(int argc, char *argv[]) 100@@ -884,7 +885,7 @@ parseargs(int argc, char *argv[])
101 { 101 {
102 int c; 102 int c;
103 oldstyle_local = 1; 103 oldstyle_local = 1;
@@ -106,25 +106,25 @@ index 137011b..dc3d2d6 100644
106 switch (c) { 106 switch (c) {
107 case 'a': 107 case 'a':
108 doabort = 1; /* when debugging, do an abort on */ 108 doabort = 1; /* when debugging, do an abort on */
109@@ -887,6 +888,9 @@ parseargs(int argc, char *argv[]) 109@@ -902,6 +903,9 @@ parseargs(int argc, char *argv[])
110 if (hosts[nhosts - 1] == NULL) 110 if (hosts[nhosts - 1] == NULL)
111 errx(1, "Out of memory"); 111 errx(1, "Out of memory");
112 break; 112 break;
113+ case 'p': 113+ case 'p':
114+ fixed_port = atoi(optarg); 114+ fixed_port = atoi(optarg);
115+ break; 115+ break;
116 case 'i': 116 case 'i':
117 insecure = 1; 117 insecure = 1;
118 break; 118 break;
119@@ -905,7 +909,7 @@ parseargs(int argc, char *argv[]) 119@@ -920,7 +924,7 @@ parseargs(int argc, char *argv[])
120 break; 120 break;
121 #endif 121 #endif
122 default: /* error */ 122 default: /* error */
123- fprintf(stderr, "usage: rpcbind [-adhilswf]\n"); 123- fprintf(stderr, "usage: rpcbind [-adhilswf]\n");
124+ fprintf(stderr, "usage: rpcbind [-adhpilswf]\n"); 124+ fprintf(stderr, "usage: rpcbind [-adhpilswf]\n");
125 exit (1); 125 exit (1);
126 } 126 }
127 } 127 }
128-- 128--
1291.9.1 1292.25.1
130 130
diff --git a/meta/recipes-extended/rpcbind/rpcbind_1.2.5.bb b/meta/recipes-extended/rpcbind/rpcbind_1.2.7.bb
index ec8f9e48b2..e186bc35e1 100644
--- a/meta/recipes-extended/rpcbind/rpcbind_1.2.5.bb
+++ b/meta/recipes-extended/rpcbind/rpcbind_1.2.7.bb
@@ -13,13 +13,14 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b46486e4c4a416602693a711bb5bfa39 \
13SRC_URI = "${SOURCEFORGE_MIRROR}/rpcbind/rpcbind-${PV}.tar.bz2 \ 13SRC_URI = "${SOURCEFORGE_MIRROR}/rpcbind/rpcbind-${PV}.tar.bz2 \
14 file://init.d \ 14 file://init.d \
15 file://rpcbind.conf \ 15 file://rpcbind.conf \
16 file://rpcbind.tmpfiles \
17 file://rpcbind.systemd \
16 file://rpcbind_add_option_to_fix_port_number.patch \ 18 file://rpcbind_add_option_to_fix_port_number.patch \
17 file://0001-systemd-use-EnvironmentFile.patch \ 19 file://0001-systemd-use-EnvironmentFile.patch \
18 " 20 "
19SRC_URI[md5sum] = "ed46f09b9c0fa2d49015f6431bc5ea7b" 21SRC_URI[sha256sum] = "f6edf8cdf562aedd5d53b8bf93962d61623292bfc4d47eedd3f427d84d06f37e"
20SRC_URI[sha256sum] = "2ce360683963b35c19c43f0ee2c7f18aa5b81ef41c3fdbd15ffcb00b8bffda7a"
21 22
22inherit autotools update-rc.d systemd pkgconfig update-alternatives 23inherit autotools update-rc.d systemd pkgconfig update-alternatives sourceforge-releases
23 24
24PACKAGECONFIG ??= "tcp-wrappers" 25PACKAGECONFIG ??= "tcp-wrappers"
25PACKAGECONFIG[tcp-wrappers] = "--enable-libwrap,--disable-libwrap,tcp-wrappers" 26PACKAGECONFIG[tcp-wrappers] = "--enable-libwrap,--disable-libwrap,tcp-wrappers"
@@ -27,29 +28,38 @@ PACKAGECONFIG[tcp-wrappers] = "--enable-libwrap,--disable-libwrap,tcp-wrappers"
27INITSCRIPT_NAME = "rpcbind" 28INITSCRIPT_NAME = "rpcbind"
28INITSCRIPT_PARAMS = "start 12 2 3 4 5 . stop 60 0 1 6 ." 29INITSCRIPT_PARAMS = "start 12 2 3 4 5 . stop 60 0 1 6 ."
29 30
30SYSTEMD_SERVICE_${PN} = "rpcbind.service rpcbind.socket" 31SYSTEMD_SERVICE:${PN} = "rpcbind.service rpcbind.socket"
31 32
32inherit useradd 33inherit useradd
33 34
34USERADD_PACKAGES = "${PN}" 35USERADD_PACKAGES = "${PN}"
35USERADD_PARAM_${PN} = "--system --no-create-home --home-dir / \ 36USERADD_PARAM:${PN} = "--system --no-create-home --home-dir / \
36 --shell /bin/false --user-group rpc" 37 --shell /bin/false --user-group rpc"
37 38
38PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" 39PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
39PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/, \ 40PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_system_unitdir}/, \
40 --without-systemdsystemunitdir, \ 41 --without-systemdsystemunitdir, \
41 systemd \ 42 systemd \
42" 43"
43 44
44EXTRA_OECONF += " --enable-warmstarts --with-rpcuser=rpc" 45EXTRA_OECONF += " --enable-warmstarts --with-rpcuser=rpc --with-statedir=${runtimedir}/rpcbind"
45 46
46do_install_append () { 47do_install:append () {
47 install -d ${D}${sysconfdir}/init.d 48 install -d ${D}${sysconfdir}/init.d
48 sed -e 's,/etc/,${sysconfdir}/,g' \ 49 sed -e 's,/etc/,${sysconfdir}/,g' \
49 -e 's,/sbin/,${sbindir}/,g' \ 50 -e 's,/sbin/,${sbindir}/,g' \
50 ${WORKDIR}/init.d > ${D}${sysconfdir}/init.d/rpcbind 51 ${UNPACKDIR}/init.d > ${D}${sysconfdir}/init.d/rpcbind
51 chmod 0755 ${D}${sysconfdir}/init.d/rpcbind 52 chmod 0755 ${D}${sysconfdir}/init.d/rpcbind
53 install -m 0644 ${UNPACKDIR}/rpcbind.conf ${D}${sysconfdir}/rpcbind.conf
54
55 install -d ${D}${sysconfdir}/tmpfiles.d
56 install -m 0644 ${UNPACKDIR}/rpcbind.tmpfiles ${D}${sysconfdir}/tmpfiles.d/rpcbind.conf
57
58 install -d ${D}${systemd_system_unitdir}/rpcbind.service.d
59 install -m 0644 ${UNPACKDIR}/rpcbind.systemd ${D}${systemd_system_unitdir}/rpcbind.service.d/rpcbind.conf
52} 60}
53 61
54ALTERNATIVE_${PN} = "rpcinfo" 62FILES:${PN} += "${systemd_system_unitdir}/rpcbind.service.d/rpcbind.conf"
63
64ALTERNATIVE:${PN} = "rpcinfo"
55ALTERNATIVE_LINK_NAME[rpcinfo] = "${bindir}/rpcinfo" 65ALTERNATIVE_LINK_NAME[rpcinfo] = "${bindir}/rpcinfo"