* [LTP] [PATCH 0/2] Fix CI for CentOS 7
@ 2023-10-24 20:11 Petr Vorel
2023-10-24 20:11 ` [LTP] [PATCH 1/2] lapi: Add uinput.h Petr Vorel
2023-10-24 20:11 ` [LTP] [PATCH 2/2] input_helper: Fix compilation on CentOS 7 Petr Vorel
0 siblings, 2 replies; 10+ messages in thread
From: Petr Vorel @ 2023-10-24 20:11 UTC (permalink / raw)
To: ltp; +Cc: Richard Palethorpe
Hi,
this is untested fix for CentOS 7. i.e. it fixes the compilation, but I
haven't tested it on the actual VM (I don't have any and don't plan to
do any further testing).
That brings me to the question if we still want to keep support for
CentOS 7, which has kernel: 3.10, glibc: 2.17, gcc: 4.8.5 [1].
But I'll raise this question on a separate RFC thread on ML,
where I Cc more people.
Kind regards,
Petr
[1] https://github.com/linux-test-project/ltp/wiki/Supported-kernel,-libc,-toolchain-versions
Petr Vorel (2):
lapi: Add uinput.h
input_helper: Fix compilation on CentOS 7
configure.ac | 1 +
include/lapi/uinput.h | 15 +++++++++++++++
testcases/kernel/input/input_helper.c | 1 +
3 files changed, 17 insertions(+)
create mode 100644 include/lapi/uinput.h
--
2.42.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 10+ messages in thread
* [LTP] [PATCH 1/2] lapi: Add uinput.h
2023-10-24 20:11 [LTP] [PATCH 0/2] Fix CI for CentOS 7 Petr Vorel
@ 2023-10-24 20:11 ` Petr Vorel
2023-10-25 7:18 ` Richard Palethorpe
2023-10-24 20:11 ` [LTP] [PATCH 2/2] input_helper: Fix compilation on CentOS 7 Petr Vorel
1 sibling, 1 reply; 10+ messages in thread
From: Petr Vorel @ 2023-10-24 20:11 UTC (permalink / raw)
To: ltp; +Cc: Richard Palethorpe
With the only definition UI_GET_SYSNAME, which was added in kernel 3.15,
but we 3.10 (CentOS 7).
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
configure.ac | 1 +
include/lapi/uinput.h | 15 +++++++++++++++
2 files changed, 16 insertions(+)
create mode 100644 include/lapi/uinput.h
diff --git a/configure.ac b/configure.ac
index e40a18fa0..6d3620c57 100644
--- a/configure.ac
+++ b/configure.ac
@@ -67,6 +67,7 @@ AC_CHECK_HEADERS_ONCE([ \
linux/tls.h \
linux/tty.h \
linux/types.h \
+ linux/uinput.h \
linux/userfaultfd.h \
netinet/sctp.h \
pthread.h \
diff --git a/include/lapi/uinput.h b/include/lapi/uinput.h
new file mode 100644
index 000000000..bdd6f466f
--- /dev/null
+++ b/include/lapi/uinput.h
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2023 Petr Vorel <pvorel@suse.cz>
+ */
+
+#ifndef LAPI_UINPUT_H__
+#define LAPI_UINPUT_H__
+
+#include <linux/uinput.h>
+
+#ifndef UI_GET_SYSNAME
+# define UI_GET_SYSNAME(len) _IOC(_IOC_READ, UINPUT_IOCTL_BASE, 44, len)
+#endif
+
+#endif /* LAPI_UINPUT_H__ */
--
2.42.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [LTP] [PATCH 2/2] input_helper: Fix compilation on CentOS 7
2023-10-24 20:11 [LTP] [PATCH 0/2] Fix CI for CentOS 7 Petr Vorel
2023-10-24 20:11 ` [LTP] [PATCH 1/2] lapi: Add uinput.h Petr Vorel
@ 2023-10-24 20:11 ` Petr Vorel
1 sibling, 0 replies; 10+ messages in thread
From: Petr Vorel @ 2023-10-24 20:11 UTC (permalink / raw)
To: ltp; +Cc: Richard Palethorpe
Include lapi/uinput.h to fix compilation on CentOS 7
(the oldest distro in our CI). The actual functionality of the test was
not tested.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
testcases/kernel/input/input_helper.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/testcases/kernel/input/input_helper.c b/testcases/kernel/input/input_helper.c
index 58bb9ee10..c929de6ba 100644
--- a/testcases/kernel/input/input_helper.c
+++ b/testcases/kernel/input/input_helper.c
@@ -25,6 +25,7 @@
#include "test.h"
#include "safe_macros.h"
#include "input_helper.h"
+#include "lapi/uinput.h"
#define VIRTUAL_DEVICE "virtual-device-ltp"
--
2.42.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [LTP] [PATCH 1/2] lapi: Add uinput.h
2023-10-24 20:11 ` [LTP] [PATCH 1/2] lapi: Add uinput.h Petr Vorel
@ 2023-10-25 7:18 ` Richard Palethorpe
2023-10-25 7:39 ` Petr Vorel
0 siblings, 1 reply; 10+ messages in thread
From: Richard Palethorpe @ 2023-10-25 7:18 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp
Hello,
Petr Vorel <pvorel@suse.cz> writes:
> With the only definition UI_GET_SYSNAME, which was added in kernel 3.15,
> but we 3.10 (CentOS 7).
>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> configure.ac | 1 +
> include/lapi/uinput.h | 15 +++++++++++++++
> 2 files changed, 16 insertions(+)
> create mode 100644 include/lapi/uinput.h
>
> diff --git a/configure.ac b/configure.ac
> index e40a18fa0..6d3620c57 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -67,6 +67,7 @@ AC_CHECK_HEADERS_ONCE([ \
> linux/tls.h \
> linux/tty.h \
> linux/types.h \
> + linux/uinput.h \
Do we use this?
> linux/userfaultfd.h \
> netinet/sctp.h \
> pthread.h \
> diff --git a/include/lapi/uinput.h b/include/lapi/uinput.h
> new file mode 100644
> index 000000000..bdd6f466f
> --- /dev/null
> +++ b/include/lapi/uinput.h
> @@ -0,0 +1,15 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +/*
> + * Copyright (c) 2023 Petr Vorel <pvorel@suse.cz>
> + */
> +
> +#ifndef LAPI_UINPUT_H__
> +#define LAPI_UINPUT_H__
> +
> +#include <linux/uinput.h>
> +
> +#ifndef UI_GET_SYSNAME
> +# define UI_GET_SYSNAME(len) _IOC(_IOC_READ, UINPUT_IOCTL_BASE, 44, len)
> +#endif
> +
> +#endif /* LAPI_UINPUT_H__ */
--
Thank you,
Richard.
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [LTP] [PATCH 1/2] lapi: Add uinput.h
2023-10-25 7:18 ` Richard Palethorpe
@ 2023-10-25 7:39 ` Petr Vorel
2023-10-25 7:51 ` Cyril Hrubis
2023-10-25 7:52 ` Richard Palethorpe
0 siblings, 2 replies; 10+ messages in thread
From: Petr Vorel @ 2023-10-25 7:39 UTC (permalink / raw)
To: Richard Palethorpe; +Cc: ltp
Hi Richie,
> > +++ b/configure.ac
> > @@ -67,6 +67,7 @@ AC_CHECK_HEADERS_ONCE([ \
> > linux/tls.h \
> > linux/tty.h \
> > linux/types.h \
> > + linux/uinput.h \
> Do we use this?
Yes, see below.
> > linux/userfaultfd.h \
> > netinet/sctp.h \
> > pthread.h \
> > diff --git a/include/lapi/uinput.h b/include/lapi/uinput.h
> > new file mode 100644
> > index 000000000..bdd6f466f
> > --- /dev/null
> > +++ b/include/lapi/uinput.h
> > @@ -0,0 +1,15 @@
> > +// SPDX-License-Identifier: GPL-2.0-or-later
> > +/*
> > + * Copyright (c) 2023 Petr Vorel <pvorel@suse.cz>
> > + */
> > +
> > +#ifndef LAPI_UINPUT_H__
> > +#define LAPI_UINPUT_H__
> > +
> > +#include <linux/uinput.h>
Here. We have policy, that we first load the header and then check for a
fallback.
Kind regards,
Petr
> > +
> > +#ifndef UI_GET_SYSNAME
> > +# define UI_GET_SYSNAME(len) _IOC(_IOC_READ, UINPUT_IOCTL_BASE, 44, len)
> > +#endif
> > +
> > +#endif /* LAPI_UINPUT_H__ */
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [LTP] [PATCH 1/2] lapi: Add uinput.h
2023-10-25 7:39 ` Petr Vorel
@ 2023-10-25 7:51 ` Cyril Hrubis
2023-10-25 8:12 ` Petr Vorel
2023-10-25 7:52 ` Richard Palethorpe
1 sibling, 1 reply; 10+ messages in thread
From: Cyril Hrubis @ 2023-10-25 7:51 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp
Hi!
> > > +++ b/configure.ac
> > > @@ -67,6 +67,7 @@ AC_CHECK_HEADERS_ONCE([ \
> > > linux/tls.h \
> > > linux/tty.h \
> > > linux/types.h \
> > > + linux/uinput.h \
>
> > Do we use this?
> Yes, see below.
Ritchie probably means the macro HAVE_LINUX_UINPUT_H that is generated
by this, and no we do not use that, we include <linux/uinput.h>
unconditionally.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [LTP] [PATCH 1/2] lapi: Add uinput.h
2023-10-25 7:39 ` Petr Vorel
2023-10-25 7:51 ` Cyril Hrubis
@ 2023-10-25 7:52 ` Richard Palethorpe
1 sibling, 0 replies; 10+ messages in thread
From: Richard Palethorpe @ 2023-10-25 7:52 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp
Hello,
Petr Vorel <pvorel@suse.cz> writes:
> Hi Richie,
>
>> > +++ b/configure.ac
>> > @@ -67,6 +67,7 @@ AC_CHECK_HEADERS_ONCE([ \
>> > linux/tls.h \
>> > linux/tty.h \
>> > linux/types.h \
>> > + linux/uinput.h \
>
>> Do we use this?
> Yes, see below.
>
>> > linux/userfaultfd.h \
>> > netinet/sctp.h \
>> > pthread.h \
>> > diff --git a/include/lapi/uinput.h b/include/lapi/uinput.h
>> > new file mode 100644
>> > index 000000000..bdd6f466f
>> > --- /dev/null
>> > +++ b/include/lapi/uinput.h
>> > @@ -0,0 +1,15 @@
>> > +// SPDX-License-Identifier: GPL-2.0-or-later
>> > +/*
>> > + * Copyright (c) 2023 Petr Vorel <pvorel@suse.cz>
>> > + */
>> > +
>> > +#ifndef LAPI_UINPUT_H__
>> > +#define LAPI_UINPUT_H__
>> > +
>> > +#include <linux/uinput.h>
> Here. We have policy, that we first load the header and then check for a
> fallback.
But we don't check if the header exists with HAVE_LINUX_UINPUT_H before
loading it?
>
> Kind regards,
> Petr
>
>> > +
>> > +#ifndef UI_GET_SYSNAME
>> > +# define UI_GET_SYSNAME(len) _IOC(_IOC_READ, UINPUT_IOCTL_BASE, 44, len)
>> > +#endif
>> > +
>> > +#endif /* LAPI_UINPUT_H__ */
--
Thank you,
Richard.
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [LTP] [PATCH 1/2] lapi: Add uinput.h
2023-10-25 7:51 ` Cyril Hrubis
@ 2023-10-25 8:12 ` Petr Vorel
2023-10-25 8:14 ` Cyril Hrubis
0 siblings, 1 reply; 10+ messages in thread
From: Petr Vorel @ 2023-10-25 8:12 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
> Hi!
> > > > +++ b/configure.ac
> > > > @@ -67,6 +67,7 @@ AC_CHECK_HEADERS_ONCE([ \
> > > > linux/tls.h \
> > > > linux/tty.h \
> > > > linux/types.h \
> > > > + linux/uinput.h \
> > > Do we use this?
> > Yes, see below.
> Ritchie probably means the macro HAVE_LINUX_UINPUT_H that is generated
> by this, and no we do not use that, we include <linux/uinput.h>
> unconditionally.
Ah, thank you. This is obviously missing.
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [LTP] [PATCH 1/2] lapi: Add uinput.h
2023-10-25 8:12 ` Petr Vorel
@ 2023-10-25 8:14 ` Cyril Hrubis
2023-10-25 8:22 ` Petr Vorel
0 siblings, 1 reply; 10+ messages in thread
From: Cyril Hrubis @ 2023-10-25 8:14 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp
Hi!
> Ah, thank you. This is obviously missing.
I do not think that it's needed at all, the uinput header has been in
there for more than decade.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [LTP] [PATCH 1/2] lapi: Add uinput.h
2023-10-25 8:14 ` Cyril Hrubis
@ 2023-10-25 8:22 ` Petr Vorel
0 siblings, 0 replies; 10+ messages in thread
From: Petr Vorel @ 2023-10-25 8:22 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
> Hi!
> > Ah, thank you. This is obviously missing.
> I do not think that it's needed at all, the uinput header has been in
> there for more than decade.
Thank you for spotting trivial error. I only checked up to UAPI introduction
v3.7-rc1 (but we already raised the support to 3.10). More importantly
include/linux/uinput.h existed since git history (2.6.12-rc2).
I'll remove check in v2.
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2023-10-25 8:22 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-24 20:11 [LTP] [PATCH 0/2] Fix CI for CentOS 7 Petr Vorel
2023-10-24 20:11 ` [LTP] [PATCH 1/2] lapi: Add uinput.h Petr Vorel
2023-10-25 7:18 ` Richard Palethorpe
2023-10-25 7:39 ` Petr Vorel
2023-10-25 7:51 ` Cyril Hrubis
2023-10-25 8:12 ` Petr Vorel
2023-10-25 8:14 ` Cyril Hrubis
2023-10-25 8:22 ` Petr Vorel
2023-10-25 7:52 ` Richard Palethorpe
2023-10-24 20:11 ` [LTP] [PATCH 2/2] input_helper: Fix compilation on CentOS 7 Petr Vorel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox