update to 0.12 [release 0.12-1mamba;Fri Aug 02 2019]

This commit is contained in:
Silvan Calarco 2024-01-05 17:31:21 +01:00
parent b217eaa79b
commit 27253d1e73
3 changed files with 258 additions and 6 deletions

View File

@ -0,0 +1,31 @@
From a32fc5956038b1916008416c27f87b59b8caf8c4 Mon Sep 17 00:00:00 2001
From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
Date: Wed, 13 Feb 2019 19:31:09 +0100
Subject: [PATCH] rtkit-daemon: Restore local `xml` variable
This one has to exist so we can have the pointer to pointer, as
`introspect_xml` is an array.
Fixes 14099ed04a693791dc6645566ee55a08be19a199 (a SIGSEGV)
---
rtkit-daemon.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/rtkit-daemon.c b/rtkit-daemon.c
index 6884644..c56ddcb 100644
--- a/rtkit-daemon.c
+++ b/rtkit-daemon.c
@@ -1417,10 +1417,12 @@ static DBusHandlerResult dbus_handler(DBusConnection *c, DBusMessage *m, void *u
interface));
} else if (dbus_message_is_method_call(m, "org.freedesktop.DBus.Introspectable", "Introspect")) {
+ const char *xml = introspect_xml;
+
assert_se(r = dbus_message_new_method_return(m));
assert_se(dbus_message_append_args(
r,
- DBUS_TYPE_STRING, &introspect_xml,
+ DBUS_TYPE_STRING, &xml,
DBUS_TYPE_INVALID));
} else
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;

View File

@ -0,0 +1,202 @@
From 14099ed04a693791dc6645566ee55a08be19a199 Mon Sep 17 00:00:00 2001
From: Felipe Sateler <fsateler@debian.org>
Date: Tue, 12 Feb 2019 20:29:42 -0300
Subject: [PATCH] build-sys: don't generate introspection xml by running the
program
Instead, embed the xml file into the binary. This should make both
cross-compiling and editing the introspection xml easier.
---
Makefile.am | 8 +++--
configure.ac | 1 +
org.freedesktop.RealtimeKit1.xml | 42 +++++++++++++++++++++++++++
rtkit-daemon.c | 50 +++-----------------------------
xml-introspection.S | 7 +++++
5 files changed, 59 insertions(+), 49 deletions(-)
create mode 100644 org.freedesktop.RealtimeKit1.xml
create mode 100644 xml-introspection.S
diff --git a/Makefile.am b/Makefile.am
index 25aaa10..8fe24f8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -33,6 +33,7 @@ EXTRA_DIST = \
org.freedesktop.RealtimeKit1.policy \
org.freedesktop.RealtimeKit1.conf \
org.freedesktop.RealtimeKit1.service.in \
+ org.freedesktop.RealtimeKit1.xml \
rtkit-daemon.service.in
CLEANFILES = \
@@ -60,7 +61,9 @@ systemdsystemunit_DATA = \
endif
rtkit_daemon_SOURCES = \
- rtkit-daemon.c rtkit.h
+ rtkit-daemon.c \
+ rtkit.h \
+ xml-introspection.S
rtkit_daemon_LDADD = \
$(DBUS_LIBS) \
$(LIBSYSTEMD_LIBS)
@@ -91,8 +94,7 @@ org.freedesktop.RealtimeKit1.service: org.freedesktop.RealtimeKit1.service.in
rtkit-daemon.service: rtkit-daemon.service.in
$(AM_V_GEN)sed -e 's,@LIBEXECDIR\@,$(libexecdir),g' < $< > $@
-org.freedesktop.RealtimeKit1.xml: rtkit-daemon
- $(AM_V_GEN)./$< --introspect > $@
+xml-introspection.o: org.freedesktop.RealtimeKit1.xml
man8_MANS = rtkitctl.8
diff --git a/configure.ac b/configure.ac
index 1e62ebc..aafff94 100644
--- a/configure.ac
+++ b/configure.ac
@@ -51,6 +51,7 @@ AM_PROG_CC_C_O
AC_PROG_GCC_TRADITIONAL
AC_USE_SYSTEM_EXTENSIONS
AC_SYS_LARGEFILE
+AM_PROG_AS
# GCC flags
diff --git a/org.freedesktop.RealtimeKit1.xml b/org.freedesktop.RealtimeKit1.xml
new file mode 100644
index 0000000..305e767
--- /dev/null
+++ b/org.freedesktop.RealtimeKit1.xml
@@ -0,0 +1,42 @@
+<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
+"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
+<node>
+ <interface name="org.freedesktop.RealtimeKit1">
+ <method name="MakeThreadRealtime">
+ <arg name="thread" type="t" direction="in"/>
+ <arg name="priority" type="u" direction="in"/>
+ </method>
+ <method name="MakeThreadRealtimeWithPID">
+ <arg name="process" type="t" direction="in"/>
+ <arg name="thread" type="t" direction="in"/>
+ <arg name="priority" type="u" direction="in"/>
+ </method>
+ <method name="MakeThreadHighPriority">
+ <arg name="thread" type="t" direction="in"/>
+ <arg name="priority" type="i" direction="in"/>
+ </method>
+ <method name="MakeThreadHighPriorityWithPID">
+ <arg name="process" type="t" direction="in"/>
+ <arg name="thread" type="t" direction="in"/>
+ <arg name="priority" type="i" direction="in"/>
+ </method>
+ <method name="ResetKnown"/>
+ <method name="ResetAll"/>
+ <method name="Exit"/>
+ <property name="RTTimeUSecMax" type="x" access="read"/>
+ <property name="MaxRealtimePriority" type="i" access="read"/>
+ <property name="MinNiceLevel" type="i" access="read"/>
+ </interface>
+ <interface name="org.freedesktop.DBus.Properties">
+ <method name="Get">
+ <arg name="interface" direction="in" type="s"/>
+ <arg name="property" direction="in" type="s"/>
+ <arg name="value" direction="out" type="v"/>
+ </method>
+ </interface>
+ <interface name="org.freedesktop.DBus.Introspectable">
+ <method name="Introspect">
+ <arg name="data" type="s" direction="out"/>
+ </method>
+ </interface>
+</node>
diff --git a/rtkit-daemon.c b/rtkit-daemon.c
index 205478b..6884644 100644
--- a/rtkit-daemon.c
+++ b/rtkit-daemon.c
@@ -67,48 +67,8 @@
#define RLIMIT_RTTIME 15
#endif
-#define INTROSPECT_XML \
- DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE \
- "<node>\n" \
- " <interface name=\"org.freedesktop.RealtimeKit1\">\n" \
- " <method name=\"MakeThreadRealtime\">\n" \
- " <arg name=\"thread\" type=\"t\" direction=\"in\"/>\n" \
- " <arg name=\"priority\" type=\"u\" direction=\"in\"/>\n" \
- " </method>\n" \
- " <method name=\"MakeThreadRealtimeWithPID\">\n" \
- " <arg name=\"process\" type=\"t\" direction=\"in\"/>\n" \
- " <arg name=\"thread\" type=\"t\" direction=\"in\"/>\n" \
- " <arg name=\"priority\" type=\"u\" direction=\"in\"/>\n" \
- " </method>\n" \
- " <method name=\"MakeThreadHighPriority\">\n" \
- " <arg name=\"thread\" type=\"t\" direction=\"in\"/>\n" \
- " <arg name=\"priority\" type=\"i\" direction=\"in\"/>\n" \
- " </method>\n" \
- " <method name=\"MakeThreadHighPriorityWithPID\">\n" \
- " <arg name=\"process\" type=\"t\" direction=\"in\"/>\n" \
- " <arg name=\"thread\" type=\"t\" direction=\"in\"/>\n" \
- " <arg name=\"priority\" type=\"i\" direction=\"in\"/>\n" \
- " </method>\n" \
- " <method name=\"ResetKnown\"/>\n" \
- " <method name=\"ResetAll\"/>\n" \
- " <method name=\"Exit\"/>\n" \
- " <property name=\"RTTimeUSecMax\" type=\"x\" access=\"read\"/>\n" \
- " <property name=\"MaxRealtimePriority\" type=\"i\" access=\"read\"/>\n" \
- " <property name=\"MinNiceLevel\" type=\"i\" access=\"read\"/>\n" \
- " </interface>\n" \
- " <interface name=\"org.freedesktop.DBus.Properties\">\n"\
- " <method name=\"Get\">" \
- " <arg name=\"interface\" direction=\"in\" type=\"s\"/>\n" \
- " <arg name=\"property\" direction=\"in\" type=\"s\"/>\n" \
- " <arg name=\"value\" direction=\"out\" type=\"v\"/>\n" \
- " </method>\n" \
- " </interface>\n" \
- " <interface name=\"org.freedesktop.DBus.Introspectable\">\n" \
- " <method name=\"Introspect\">\n" \
- " <arg name=\"data\" type=\"s\" direction=\"out\"/>\n" \
- " </method>\n" \
- " </interface>\n" \
- "</node>\n"
+/* The introspection XML from org.freedesktop.RealtimeKit1.xml (via xml-introspection.S) */
+extern const char introspect_xml[];
/* Similar to assert(), but has side effects, and hence shall never be optimized away, regardless of NDEBUG */
#define assert_se(expr) \
@@ -1457,12 +1417,10 @@ static DBusHandlerResult dbus_handler(DBusConnection *c, DBusMessage *m, void *u
interface));
} else if (dbus_message_is_method_call(m, "org.freedesktop.DBus.Introspectable", "Introspect")) {
- const char *xml = INTROSPECT_XML;
-
assert_se(r = dbus_message_new_method_return(m));
assert_se(dbus_message_append_args(
r,
- DBUS_TYPE_STRING, &xml,
+ DBUS_TYPE_STRING, &introspect_xml,
DBUS_TYPE_INVALID));
} else
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
@@ -2256,7 +2214,7 @@ static int parse_command_line(int argc, char *argv[], int *ret) {
break;
case ARG_INTROSPECT:
- fputs(INTROSPECT_XML, stdout);
+ fputs(introspect_xml, stdout);
*ret = 0;
return 0;
diff --git a/xml-introspection.S b/xml-introspection.S
new file mode 100644
index 0000000..4bd2355
--- /dev/null
+++ b/xml-introspection.S
@@ -0,0 +1,7 @@
+.section .rodata
+.global introspect_xml
+.type introspect_xml, @object
+
+introspect_xml:
+.incbin "org.freedesktop.RealtimeKit1.xml"
+.byte 0

View File

@ -1,15 +1,17 @@
%define rtkit_uid 56
%define rtkit_gid 56
Name: rtkit
Version: 0.11
Release: 3mamba
Version: 0.12
Release: 1mamba
Summary: Realtime Policy and Watchdog Daemon
Group: System/Tools
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://git.0pointer.de/?p=rtkit.git
Source: http://0pointer.de/public/rtkit-%{version}.tar.xz
Source: https://github.com/heftig/rtkit.git/v%{version}/rtkit-%{version}.tar.bz2
Patch0: rtkit-0.12-arm-revert-unsupported-asm.patch
Patch1: rtkit-0.12-arm-revert-unsupported-asm-2.patch.patch
License: BSD, GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
@ -28,6 +30,12 @@ RealtimeKit is a D-Bus system service that changes the scheduling policy of user
%prep
%setup -q
%ifarch arm
%patch1 -p1 -R
%patch0 -p1 -R
%endif
./autogen.sh
%build
%configure \
@ -61,10 +69,12 @@ if [ $1 -eq 0 ]; then
/usr/sbin/userdel rtkit &>/dev/null
/usr/sbin/groupdel rtkit &>/dev/null
fi
%systemd_preun rtkit-daemon
:
%post
%{_bindir}/dbus-send --system --type=method_call --dest=org.freedesktop.DBus / org.freedesktop.DBus.ReloadConfig >/dev/null 2>&1 || : || :
%systemd_post rtkit-daemon
# with systemd-units
#/usr/bin/systemd-install enable --realize=minimal rtkit-daemon.service >/dev/null 2>&1 || :
#/bin/systemctl enable rtkit-daemon.service >/dev/null 2>&1 || :
@ -76,20 +86,29 @@ fi
#fi
:
%postun
%systemd_postun_with_restart rtkit-daemon
:
%files
%defattr(-,root,root)
%{_sysconfdir}/dbus-1/system.d/org.freedesktop.RealtimeKit1.conf
#%{_sysconfdir}/dbus-1/system.d/org.freedesktop.RealtimeKit1.conf
%attr(0755,root,root) %{_libexecdir}/rtkit-daemon
%attr(0755,root,root) %{_sbindir}/rtkitctl
%{_datadir}/dbus-1/interfaces/org.freedesktop.RealtimeKit1.xml
%{_datadir}/dbus-1/system-services/org.freedesktop.RealtimeKit1.service
/lib/systemd/system/rtkit-daemon.service
%{_unitdir}/rtkit-daemon.service
%{_libexecdir}/installed-tests/rtkit/rtkit-test
%{_datadir}/dbus-1/system.d/org.freedesktop.RealtimeKit1.conf
%{_datadir}/polkit-1/actions/org.freedesktop.RealtimeKit1.policy
%{_mandir}/man8/rtkitctl.8.gz
%{_mandir}/man8/rtkitctl.8*
%doc GPL LICENSE
# README rtkit.c rtkit.h
%changelog
* Fri Aug 02 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 0.12-1mamba
- update to 0.12
* Sun Aug 03 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 0.11-3mamba
- fix rtkit group and user creation (typo error)