diff options
-rw-r--r-- | meta-oe/recipes-support/picocom/picocom/0001-Fix-building-with-musl.patch | 118 | ||||
-rw-r--r-- | meta-oe/recipes-support/picocom/picocom_git.bb | 12 |
2 files changed, 125 insertions, 5 deletions
diff --git a/meta-oe/recipes-support/picocom/picocom/0001-Fix-building-with-musl.patch b/meta-oe/recipes-support/picocom/picocom/0001-Fix-building-with-musl.patch new file mode 100644 index 0000000000..5b344b9e83 --- /dev/null +++ b/meta-oe/recipes-support/picocom/picocom/0001-Fix-building-with-musl.patch | |||
@@ -0,0 +1,118 @@ | |||
1 | From 9664809da36bd7bada3e44f50cfc042539fb61ee Mon Sep 17 00:00:00 2001 | ||
2 | From: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
3 | Date: Sun, 14 Jul 2019 19:13:21 -0700 | ||
4 | Subject: [PATCH] Fix building with musl | ||
5 | |||
6 | Upstream-status: Pending | ||
7 | |||
8 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
9 | --- | ||
10 | termios2.c | 27 +++++++++++++++++++++++++++ | ||
11 | termios2.h | 5 +++++ | ||
12 | 2 files changed, 32 insertions(+) | ||
13 | |||
14 | diff --git a/termios2.c b/termios2.c | ||
15 | index 97c3be0..88ff6fc 100644 | ||
16 | --- a/termios2.c | ||
17 | +++ b/termios2.c | ||
18 | @@ -37,6 +37,7 @@ | ||
19 | #include <errno.h> | ||
20 | #include <termios.h> | ||
21 | #include <sys/ioctl.h> | ||
22 | +#include <asm/ioctls.h> | ||
23 | |||
24 | /* Contains the definition of the termios2 structure and some related | ||
25 | constants that we should normally include from system | ||
26 | @@ -53,6 +54,10 @@ | ||
27 | */ | ||
28 | #define IBAUD0 020000000000 | ||
29 | |||
30 | +#if !defined(__GLIBC__) | ||
31 | +#define __MAX_BAUD B4000000 | ||
32 | +#endif | ||
33 | + | ||
34 | int | ||
35 | tc2setattr(int fd, int optional_actions, const struct termios *tios) | ||
36 | { | ||
37 | @@ -79,8 +84,13 @@ tc2setattr(int fd, int optional_actions, const struct termios *tios) | ||
38 | t2.c_cflag = tios->c_cflag; | ||
39 | t2.c_lflag = tios->c_lflag; | ||
40 | t2.c_line = tios->c_line; | ||
41 | +#if !defined(__GLIBC__) | ||
42 | + t2.c_ispeed = tios->__c_ispeed; | ||
43 | + t2.c_ospeed = tios->__c_ospeed; | ||
44 | +#else | ||
45 | t2.c_ispeed = tios->c_ispeed; | ||
46 | t2.c_ospeed = tios->c_ospeed; | ||
47 | +#endif | ||
48 | memcpy(&t2.c_cc[0], &tios->c_cc[0], K_NCCS * sizeof (cc_t)); | ||
49 | |||
50 | return ioctl(fd, cmd, &t2); | ||
51 | @@ -101,8 +111,13 @@ tc2getattr(int fd, struct termios *tios) | ||
52 | tios->c_cflag = t2.c_cflag; | ||
53 | tios->c_lflag = t2.c_lflag; | ||
54 | tios->c_line = t2.c_line; | ||
55 | +#if !defined(__GLIBC__) | ||
56 | + tios->__c_ispeed = t2.c_ispeed; | ||
57 | + tios->__c_ospeed = t2.c_ospeed; | ||
58 | +#else | ||
59 | tios->c_ispeed = t2.c_ispeed; | ||
60 | tios->c_ospeed = t2.c_ospeed; | ||
61 | +#endif | ||
62 | memcpy(&tios->c_cc[0], &t2.c_cc[0], K_NCCS * sizeof (cc_t)); | ||
63 | |||
64 | for (i = K_NCCS; i < NCCS; i++) | ||
65 | @@ -131,7 +146,11 @@ cf2setispeed(struct termios *tios, speed_t speed) | ||
66 | errno = EINVAL; | ||
67 | return -1; | ||
68 | } | ||
69 | +#if !defined(__GLIBC__) | ||
70 | + tios->__c_ispeed = speed; | ||
71 | +#else | ||
72 | tios->c_ispeed = speed; | ||
73 | +#endif | ||
74 | tios->c_cflag &= ~((CBAUD | CBAUDEX) << IBSHIFT); | ||
75 | tios->c_cflag |= (speed << IBSHIFT); | ||
76 | |||
77 | @@ -156,7 +175,11 @@ cf2setospeed_custom(struct termios *tios, int speed) | ||
78 | } | ||
79 | tios->c_cflag &= ~(CBAUD | CBAUDEX); | ||
80 | tios->c_cflag |= BOTHER; | ||
81 | +#if !defined(__GLIBC__) | ||
82 | + tios->__c_ospeed = speed; | ||
83 | +#else | ||
84 | tios->c_ospeed = speed; | ||
85 | +#endif | ||
86 | |||
87 | return 0; | ||
88 | } | ||
89 | @@ -177,7 +200,11 @@ cf2setispeed_custom(struct termios *tios, int speed) | ||
90 | } else { | ||
91 | tios->c_cflag &= ~((CBAUD | CBAUDEX) << IBSHIFT); | ||
92 | tios->c_cflag |= (BOTHER << IBSHIFT); | ||
93 | +#if !defined(__GLIBC__) | ||
94 | + tios->__c_ispeed = speed; | ||
95 | +#else | ||
96 | tios->c_ispeed = speed; | ||
97 | +#endif | ||
98 | } | ||
99 | |||
100 | return 0; | ||
101 | diff --git a/termios2.h b/termios2.h | ||
102 | index e13b0e3..63dd0ce 100644 | ||
103 | --- a/termios2.h | ||
104 | +++ b/termios2.h | ||
105 | @@ -37,8 +37,13 @@ | ||
106 | /* And define these new ones */ | ||
107 | #define cfsetospeed_custom cf2setospeed_custom | ||
108 | #define cfsetispeed_custom cf2setispeed_custom | ||
109 | +#if defined(__linux__) && !defined(__GLIBC__) | ||
110 | +#define cfgetospeed_custom(tiop) ((tiop)->__c_ospeed) | ||
111 | +#define cfgetispeed_custom(tiop) ((tiop)->__c_ispeed) | ||
112 | +#else | ||
113 | #define cfgetospeed_custom(tiop) ((tiop)->c_ospeed) | ||
114 | #define cfgetispeed_custom(tiop) ((tiop)->c_ispeed) | ||
115 | +#endif | ||
116 | |||
117 | /* Replacements for the standard tcsetattr(3), tcgetattr(3) | ||
118 | * functions. Same user interface, but these use the new termios2 | ||
diff --git a/meta-oe/recipes-support/picocom/picocom_git.bb b/meta-oe/recipes-support/picocom/picocom_git.bb index e091094cf4..3d26b9364b 100644 --- a/meta-oe/recipes-support/picocom/picocom_git.bb +++ b/meta-oe/recipes-support/picocom/picocom_git.bb | |||
@@ -1,15 +1,17 @@ | |||
1 | SUMMARY = "Lightweight and minimal (~20K) dumb-terminal emulation program" | 1 | SUMMARY = "Lightweight and minimal dumb-terminal emulation program" |
2 | SECTION = "console/utils" | 2 | SECTION = "console/utils" |
3 | LICENSE = "GPLv2+" | 3 | LICENSE = "GPLv2+" |
4 | HOMEPAGE = "http://code.google.com/p/picocom/" | 4 | HOMEPAGE = "https://github.com/npat-efault/picocom" |
5 | LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=3000e4830620e310fe65c0eb69df9e8a" | 5 | LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=3000e4830620e310fe65c0eb69df9e8a" |
6 | 6 | ||
7 | BASEPV = "2.2" | 7 | BASEPV = "3.1" |
8 | PV = "${BASEPV}+git${SRCPV}" | 8 | PV = "${BASEPV}+git${SRCPV}" |
9 | 9 | ||
10 | SRCREV = "deffd18c24145bd6f965f44e735a50b65810ccdc" | 10 | SRCREV = "90385aabe2b51f39fa130627d46b377569f82d4a" |
11 | 11 | ||
12 | SRC_URI = "git://github.com/npat-efault/picocom" | 12 | SRC_URI = "git://github.com/npat-efault/picocom \ |
13 | file://0001-Fix-building-with-musl.patch \ | ||
14 | " | ||
13 | 15 | ||
14 | S = "${WORKDIR}/git" | 16 | S = "${WORKDIR}/git" |
15 | 17 | ||