Polkit: bump version to 0.119 and use duktape
cover Polkit: bump version to 0.119 and use duktape
It is done, I have successfully destroyed spidermonkey.
As discussed by Yann and Thomas, spidermonkey is no more. Duktape fixes everything yet again, and this is one more package that requires python2 gone.
Of course, tested in centos7 with "test-pkg -c ./defconfig -p polkit -a" and ./support/testing/run-tests -o ./output -d ./dl -k tests.package.test_polkit.TestPolkitInit AND
./support/testing/run-tests -o ./output -d ./dl -k tests.package.test_polkit.TestPolkitSystemd
45 builds, 11 skipped, 0 build failed, 1 legal-info failed
Adam Duskett (5):
package/duktape/duktape.pc.in: New file package/polkit: bump version to 0.119 and use duktape package/polkit/S50polkit: new file support/testing: add polkit tests package/spidermonkey: drop package
Config.in.legacy | 9 ++ package/Config.in | 1 - package/duktape/duktape.mk | 4 + package/duktape/duktape.pc.in | 10 ++ .../0001-make-netgroup-support-optional.patch | 19 +-- package/polkit/0002-jsauthority-memleak.patch | 28 ---- ...lkit-0.116-pkttyagent-sigttou-bg-job.patch | 34 ----- package/polkit/Config.in | 24 +-- package/polkit/S50polkit | 51 +++++++ package/polkit/polkit.hash | 4 +- package/polkit/polkit.mk | 16 +- .../0001-allow-newer-autoconf-versions.patch | 61 -------- .../0002-allow-building-in-tree.patch | 47 ------ ...-allow-unknown-configuration-options.patch | 35 ----- .../0004-fix-building-with-musl.patch | 133 ---------------- .../spidermonkey/0005-add-riscv-support.patch | 121 --------------- ...ers-on-install-instead-of-symlinking.patch | 34 ----- ...ng-on-64-bit-and-32-bit-be-platforms.patch | 144 ------------------ ...-on-ARM64-for-generated-unboxed-obje.patch | 66 -------- ...-clobbering-it-in-the-regex-compiler.patch | 100 ------------ ...lent-year-to-determine-the-time-zone.patch | 103 ------------- ....in-install-shell-only-if-it-s-built.patch | 28 ---- package/spidermonkey/Config.in | 60 -------- package/spidermonkey/spidermonkey.hash | 3 - package/spidermonkey/spidermonkey.mk | 64 -------- package/systemd/Config.in | 17 +-- package/udisks/Config.in | 23 +-- .../package/br2-external/polkit/Config.in | 1 + .../package/br2-external/polkit/external.desc | 1 + .../package/br2-external/polkit/external.mk | 1 + .../package/polkit-rules-test/Config.in | 6 + .../polkit-rules-test/initd/hello-polkit.c | 6 + .../initd/hello-polkit.policy | 14 ++ .../initd/hello-polkit.rules | 6 + .../polkit-rules-test/polkit-rules-test.mk | 38 +++++ .../systemd/systemd-timesyncd-restart.rules | 7 + support/testing/tests/package/test_polkit.py | 70 +++++++++ 37 files changed, 265 insertions(+), 1124 deletions(-) create mode 100644 package/duktape/duktape.pc.in delete mode 100644 package/polkit/0002-jsauthority-memleak.patch delete mode 100644 package/polkit/0003-polkit-0.116-pkttyagent-sigttou-bg-job.patch create mode 100755 package/polkit/S50polkit delete mode 100644 package/spidermonkey/0001-allow-newer-autoconf-versions.patch delete mode 100644 package/spidermonkey/0002-allow-building-in-tree.patch delete mode 100644 package/spidermonkey/0003-allow-unknown-configuration-options.patch delete mode 100644 package/spidermonkey/0004-fix-building-with-musl.patch delete mode 100644 package/spidermonkey/0005-add-riscv-support.patch delete mode 100644 package/spidermonkey/0006-copy-headers-on-install-instead-of-symlinking.patch delete mode 100644 package/spidermonkey/0007-ensure-proper-running-on-64-bit-and-32-bit-be-platforms.patch delete mode 100644 package/spidermonkey/0008-save-and-restore-non-volatile-x28-on-ARM64-for-generated-unboxed-obje.patch delete mode 100644 package/spidermonkey/0009-save-x28-before-clobbering-it-in-the-regex-compiler.patch delete mode 100644 package/spidermonkey/0010-always-use-the-equivalent-year-to-determine-the-time-zone.patch delete mode 100644 package/spidermonkey/0011-js-src-Makefile.in-install-shell-only-if-it-s-built.patch delete mode 100644 package/spidermonkey/Config.in delete mode 100644 package/spidermonkey/spidermonkey.hash delete mode 100644 package/spidermonkey/spidermonkey.mk create mode 100644 support/testing/tests/package/br2-external/polkit/Config.in create mode 100644 support/testing/tests/package/br2-external/polkit/external.desc create mode 100644 support/testing/tests/package/br2-external/polkit/external.mk create mode 100644 support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/Config.in create mode 100644 support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/initd/hello-polkit.c create mode 100644 support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/initd/hello-polkit.policy create mode 100644 support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/initd/hello-polkit.rules create mode 100644 support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/polkit-rules-test.mk create mode 100644 support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/systemd/systemd-timesyncd-restart.rules create mode 100644 support/testing/tests/package/test_polkit.py
Signature · 1 line
2.31.1
PATCH 1/5 package/duktape/duktape.pc.in: New file
Most distributions include a duktape.pc file bundled with the duktape development package. As the duktape source does not include a .pc file, add one to the package/duktape directory and install it to the staging directory. This is used by the polkit duktape patch later in the series.
--- package/duktape/duktape.mk | 4 ++++ package/duktape/duktape.pc.in | 10 ++++++++++ 2 files changed, 14 insertions(+) create mode 100644 package/duktape/duktape.pc.in
package/duktape/duktape.mk +4 -0
@@ -19,6 +19,10 @@ endef define DUKTAPE_INSTALL_STAGING_CMDS $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) -f Makefile.sharedlibrary \ INSTALL_PREFIX=$(STAGING_DIR)/usr install + $(INSTALL) -D -m 0644 $(DUKTAPE_PKGDIR)/duktape.pc.in \ + $(STAGING_DIR)/usr/lib/pkgconfig/duktape.pc + $(SED) 's/@VERSION@/$(DUKTAPE_VERSION)/g;' \ + $(STAGING_DIR)/usr/lib/pkgconfig/duktape.pc endef define DUKTAPE_INSTALL_TARGET_CMDS
package/duktape/duktape.pc.in new file +10 -0
@@ -0,0 +1,10 @@ +prefix=/usr +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: duktape +Description: Embeddable Javascript engine +Version: @VERSION@ +Libs: -L${libdir} -lduktape +Cflags: -I${includedir}/
Signature · 1 line
2.31.1
Thomas Petazzoni
AppliedPATCH 1/5 package/duktape/duktape.pc.in: New file
Quoted 11 lines · On Sun, 4 Jul 2021 22:40:56 -0700 Adam Duskett <[email protected]> wrote:
Most distributions include a duktape.pc file bundled with the duktape development package. As the duktape source does not include a .pc file, add one to the package/duktape directory and install it to the staging directory. This is used by the polkit duktape patch later in the series.
Signed-off-by Adam Duskett <[email protected]>--- package/duktape/duktape.mk | 4 ++++ package/duktape/duktape.pc.in | 10 ++++++++++ 2 files changed, 14 insertions(+) create mode 100644 package/duktape/duktape.pc.in
Applied to master, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH 2/5 package/polkit: bump version to 0.119 and use duktape
In reply to Adam DuskettUnfortuantly, as of commit 3e1d61868fa8bfc586099302e931433270e5d17d, polkit requires mozjs >= 78, which means spidermonkey is too old. As such, this patch is larger than usual.
Spidermonkey has a few major issues:
- The source directory after compilation is enormous (2.7G!)
- The shared library is 24MB stripped!
- It requires python2 to build, which is EOLed, and Buildroot is working towards removing. See: https://elinux.org/Buildroot:Python2Packages
Instead of going through the arduous task of updating Spidermonkey, there is a better solution: use duktape.
There has been a pending patch for over a year that incorporates duktape as an optional backend for polkit found here:
https://gitlab.freedesktop.org/polkit/polkit/-/merge_requests/35
As Thomas Petazzoni put it:
"As I am subscribed to notifications on this merge request, I have been following the intermittent discussions taking place on this topic. And indeed, discussions have been sparse, and the polkit maintainer reaction has not been very supportive. It even feels like they are trying to find every possible argument or small issue not to merge the duktape integration."
Many people have come out to support using duktape, and many users, including myself, have used polkit with duktape for as long as the above merge request has been around without issues; merging in the above merge request is an acceptable exception to the typical Buildroot package policies.
As Thomas also suggested, I have forked polkit on Github
(https://github.com/aduskett/polkit-duktape), with the above duktape merge request applied, and a release made with the same tag as upstream (0.119), with one small change: Netgroup support was yet again made optional. :) I refrained from also adding 0001-make-netgroup-support-optional.patch as it is outside of the scope of why the fork exists.
Changes:
- refactor 0001-make-netgroup-support-optional.patch to work with 0.119
- Remove upstream incorporated 0002-jsauthority-memleak.patch
- Remove upstream 0003-polkit-0.116-pkttyagent-sigttou-bg-job.patch
- Remove any trace of spidermonkey from polkit, udisks, and systemd-polkit
- Add duktape as a dependency of polkit
- Change POLKIT_SITE to the above polkit-duktape GitHub repository.
--- .../0001-make-netgroup-support-optional.patch | 19 ++++++----- package/polkit/0002-jsauthority-memleak.patch | 28 --------------- ...lkit-0.116-pkttyagent-sigttou-bg-job.patch | 34 ------------------- package/polkit/Config.in | 24 ++++--------- package/polkit/polkit.hash | 4 +-- package/polkit/polkit.mk | 12 +++---- package/systemd/Config.in | 17 +++------- package/udisks/Config.in | 23 ++++--------- 8 files changed, 37 insertions(+), 124 deletions(-) delete mode 100644 package/polkit/0002-jsauthority-memleak.patch delete mode 100644 package/polkit/0003-polkit-0.116-pkttyagent-sigttou-bg-job.patch
package/polkit/0001-make-netgroup-support-optional.patch +10 -9
@@ -25,11 +25,11 @@ Signed-off-by: Thomas Petazzoni <[email protected]> src/polkit/polkitidentity.c | 16 ++ src/polkit/polkitunixnetgroup.c | 3 + .../polkitbackendinteractiveauthority.c | 14 +- - .../polkitbackendjsauthority.cpp | 2 + + .../polkitbackendjsauthority.cpp | 3 +- test/polkit/polkitidentitytest.c | 9 +- test/polkit/polkitunixnetgrouptest.c | 3 + .../test-polkitbackendjsauthority.c | 2 + - 9 files changed, 185 insertions(+), 8 deletions(-) + 9 files changed, 185 insertions(+), 9 deletions(-) create mode 100644 buildutil/introspection.m4 diff --git a/buildutil/introspection.m4 b/buildutil/introspection.m4
@@ -184,7 +184,7 @@ diff --git a/configure.ac b/configure.ac index 5cedb4e..87aa0ad 100644 --- a/configure.ac +++ b/configure.ac -@@ -99,7 +99,7 @@ AC_CHECK_LIB(expat,XML_ParserCreate,[EXPAT_LIBS="-lexpat"], +@@ -100,7 +100,7 @@ AC_CHECK_LIB(expat,XML_ParserCreate,[EXPAT_LIBS="-lexpat"], [AC_MSG_ERROR([Can't find expat library. Please install expat.])]) AC_SUBST(EXPAT_LIBS)
@@ -298,7 +298,7 @@ diff --git a/src/polkitbackend/polkitbackendjsauthority.cpp b/src/polkitbackend/ index 9b752d1..09b2878 100644 --- a/src/polkitbackend/polkitbackendjsauthority.cpp +++ b/src/polkitbackend/polkitbackendjsauthority.cpp -@@ -1502,6 +1502,7 @@ js_polkit_user_is_in_netgroup (JSContext *cx, +@@ -1520,6 +1520,7 @@ js_polkit_user_is_in_netgroup (JSContext *cx, JS::CallArgs args = JS::CallArgsFromVp (argc, vp);
@@ -306,14 +306,15 @@ index 9b752d1..09b2878 100644 JS::RootedString usrstr (authority->priv->cx); usrstr = args[0].toString(); user = JS_EncodeStringToUTF8 (cx, usrstr); -@@ -1519,6 +1520,7 @@ js_polkit_user_is_in_netgroup (JSContext *cx, - - JS_free (cx, netgroup); - JS_free (cx, user); +@@ -1534,7 +1535,7 @@ js_polkit_user_is_in_netgroup (JSContext *cx, + { + is_in_netgroup = true; + } +- +#endif - ret = true; + args.rval ().setBoolean (is_in_netgroup); diff --git a/test/polkit/polkitidentitytest.c b/test/polkit/polkitidentitytest.c index e91967b..e829aaa 100644 --- a/test/polkit/polkitidentitytest.c
package/polkit/0002-jsauthority-memleak.patch deleted +0 -28
@@ -1,28 +0,0 @@ -From 28e3a6653d8c3777b07e0128a0d97d46e586e311 Mon Sep 17 00:00:00 2001 -From: Jan Rybar <[email protected]> -Date: Tue, 8 Oct 2019 13:28:18 +0000 -Subject: [PATCH] jsauthority: Fix two minor memory leaks - -(cherry picked from commit 28e3a6653d8c3777b07e0128a0d97d46e586e311) -Signed-off-by: Jan Rybar <[email protected]> -Signed-off-by: Adam Duskett <[email protected]> ---- - src/polkitbackend/polkitbackendjsauthority.cpp | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/src/polkitbackend/polkitbackendjsauthority.cpp b/src/polkitbackend/polkitbackendjsauthority.cpp -index 9b752d1..e97b8aa 100644 ---- a/src/polkitbackend/polkitbackendjsauthority.cpp -+++ b/src/polkitbackend/polkitbackendjsauthority.cpp -@@ -567,6 +567,8 @@ polkit_backend_js_authority_finalize (GObject *object) - g_strfreev (authority->priv->rules_dirs); - - delete authority->priv->ac; -+ delete authority->priv->js_global; -+ delete authority->priv->js_polkit; - - JS_DestroyContext (authority->priv->cx); - /* JS_ShutDown (); */ --- -2.24.1 -
package/polkit/0003-polkit-0.116-pkttyagent-sigttou-bg-job.patch deleted +0 -34
@@ -1,34 +0,0 @@ -From 76aae4fce586b400f5fe08df31497db19d624609 Mon Sep 17 00:00:00 2001 -From: Jan Rybar <[email protected]> -Date: Thu, 1 Aug 2019 06:46:10 +0000 -Subject: [PATCH] pkttyagent: process stopped by SIGTTOU if run in background - job - - -(cherry picked from commit 76aae4fce586b400f5fe08df31497db19d624609) -Signed-off-by: Jan Rybar <[email protected]> -Signed-off-by: Adam Duskett <[email protected]> ---- - src/programs/pkttyagent.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/src/programs/pkttyagent.c b/src/programs/pkttyagent.c -index 3c8d502..13879a2 100644 ---- a/src/programs/pkttyagent.c -+++ b/src/programs/pkttyagent.c -@@ -264,6 +264,12 @@ main (int argc, char *argv[]) - - memset (&sa, 0, sizeof (sa)); - sa.sa_handler = &tty_handler; -+/* If tty_handler() resets terminal while pkttyagent is run in background job, -+ the process gets stopped by SIGTTOU. This impacts systemctl, hence it must -+ be blocked for a while and then the process gets killed anyway. -+ */ -+ sigemptyset(&sa.sa_mask); -+ sigaddset(&sa.sa_mask, SIGTTOU); - sigaction (SIGTERM, &sa, &savesigterm); - sigaction (SIGINT, &sa, &savesigint); - sigaction (SIGTSTP, &sa, &savesigtstp); --- -2.24.1 -
package/polkit/Config.in +7 -17
@@ -1,18 +1,14 @@ config BR2_PACKAGE_POLKIT bool "polkit" - depends on BR2_HOST_GCC_AT_LEAST_4_9 # spidermonkey - depends on BR2_INSTALL_LIBSTDCPP # spidermonkey - depends on BR2_PACKAGE_SPIDERMONKEY_ARCH_SUPPORTS # spidermonkey - depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # spidermonkey - depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # spidermonkey + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_7 # C++17 + depends on BR2_TOOLCHAIN_HAS_THREADS # libglib2, dbus depends on BR2_USE_MMU # libglib2, dbus depends on BR2_USE_WCHAR # libglib2 - depends on !BR2_STATIC_LIBS # spidermonkey - depends on !BR2_TOOLCHAIN_USES_UCLIBC # spidermonkey + depends on !BR2_STATIC_LIBS # duktape select BR2_PACKAGE_DBUS # runtime + select BR2_PACKAGE_DUKTAPE select BR2_PACKAGE_EXPAT select BR2_PACKAGE_LIBGLIB2 - select BR2_PACKAGE_SPIDERMONKEY help PolicyKit is a toolkit for defining and handling authorizations. It is used for allowing unprivileged
@@ -20,13 +16,7 @@ config BR2_PACKAGE_POLKIT http://www.freedesktop.org/wiki/Software/polkit -comment "polkit needs a glibc or musl toolchain with C++, wchar, dynamic library, NPTL, gcc >= 4.9" +comment "polkit needs a toolchain with dynamic library, wchar, threads, gcc >= 7" depends on BR2_USE_MMU - depends on BR2_PACKAGE_SPIDERMONKEY_ARCH_SUPPORTS - depends on BR2_TOOLCHAIN_USES_UCLIBC || \ - !BR2_INSTALL_LIBSTDCPP || \ - BR2_STATIC_LIBS || \ - !BR2_TOOLCHAIN_HAS_THREADS_NPTL || \ - !BR2_HOST_GCC_AT_LEAST_4_9 || \ - !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 || \ - !BR2_USE_WCHAR + depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_GCC_AT_LEAST_7 || \ + BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS
package/polkit/polkit.hash +2 -2
@@ -1,5 +1,5 @@ # Locally calculated after checking pgp signature -sha256 88170c9e711e8db305a12fdb8234fac5706c61969b94e084d0f117d8ec5d34b1 polkit-0.116.tar.gz +sha256 999bd3c2e50e02b464efd14a81da6ddef8c8359b3b720ce4c68dc23820a9567e polkit-0.119.tar.gz # Locally calculated -sha256 d2e2aa973e29c75e1b492e67ea7b7da9de2d501d49a934657971fd74f9a0b0a8 COPYING +sha256 d2e2aa973e29c75e1b492e67ea7b7da9de2d501d49a934657971fd74f9a0b0a8 COPYING
package/polkit/polkit.mk +6 -6
@@ -4,8 +4,8 @@ # ################################################################################ -POLKIT_VERSION = 0.116 -POLKIT_SITE = http://www.freedesktop.org/software/polkit/releases +POLKIT_VERSION = 0.119 +POLKIT_SITE = $(call github,aduskett,polkit-duktape,$(POLKIT_VERSION)) POLKIT_LICENSE = GPL-2.0 POLKIT_LICENSE_FILES = COPYING POLKIT_CPE_ID_VENDOR = polkit_project
@@ -13,11 +13,10 @@ POLKIT_AUTORECONF = YES POLKIT_INSTALL_STAGING = YES POLKIT_DEPENDENCIES = \ - libglib2 host-intltool expat spidermonkey $(TARGET_NLS_DEPENDENCIES) + duktape libglib2 host-intltool expat $(TARGET_NLS_DEPENDENCIES) -# spidermonkey needs C++11 POLKIT_CONF_ENV = \ - CXXFLAGS="$(TARGET_CXXFLAGS) -std=c++11" \ + CXXFLAGS="$(TARGET_CXXFLAGS)" \ LIBS=$(TARGET_NLS_LIBS) POLKIT_CONF_OPTS = \
@@ -25,7 +24,8 @@ POLKIT_CONF_OPTS = \ --disable-man-pages \ --disable-examples \ --disable-libelogind \ - --disable-libsystemd-login + --disable-libsystemd-login \ + --with-duktape ifeq ($(BR2_PACKAGE_GOBJECT_INTROSPECTION),y) POLKIT_CONF_OPTS += --enable-introspection
package/systemd/Config.in +5 -12
@@ -320,11 +320,8 @@ config BR2_PACKAGE_SYSTEMD_NETWORKD config BR2_PACKAGE_SYSTEMD_POLKIT bool "enable polkit support" - depends on BR2_HOST_GCC_AT_LEAST_4_9 # polkit - depends on BR2_INSTALL_LIBSTDCPP # polkit - depends on BR2_PACKAGE_SPIDERMONKEY_ARCH_SUPPORTS # polkit - depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # polkit - depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # polkit + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_7 # polkit -> c++17 + depends on BR2_TOOLCHAIN_HAS_THREADS # polkit depends on BR2_USE_WCHAR # libglib2 select BR2_PACKAGE_POLKIT help
@@ -335,13 +332,9 @@ config BR2_PACKAGE_SYSTEMD_POLKIT http://wiki.freedesktop.org/www/Software/polkit/ -comment "polkit support needs a toolchain with C++, wchar, NPTL, gcc >= 4.9" - depends on BR2_PACKAGE_SPIDERMONKEY_ARCH_SUPPORTS - depends on !BR2_INSTALL_LIBSTDCPP || \ - !BR2_TOOLCHAIN_HAS_THREADS_NPTL || \ - !BR2_HOST_GCC_AT_LEAST_4_9 || \ - !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 || \ - !BR2_USE_WCHAR +comment "polkit support needs a toolchain with threads, wchar, gcc >= 7" + depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_GCC_AT_LEAST_7 || \ + !BR2_TOOLCHAIN_HAS_THREADS config BR2_PACKAGE_SYSTEMD_PORTABLED bool "enable portable services"
package/udisks/Config.in +7 -16
@@ -1,16 +1,12 @@ config BR2_PACKAGE_UDISKS bool "udisks" depends on BR2_ENABLE_LOCALE # parted - depends on BR2_HOST_GCC_AT_LEAST_4_9 # spidermonkey - depends on BR2_INSTALL_LIBSTDCPP # spidermonkey depends on BR2_PACKAGE_HAS_UDEV - depends on BR2_PACKAGE_SPIDERMONKEY_ARCH_SUPPORTS # spidermonkey - depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # spidermonkey - depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # polkit + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_7 # polkit -> C++17 + depends on BR2_TOOLCHAIN_HAS_THREADS # polkit depends on BR2_USE_WCHAR # dbus-glib -> glib2 depends on BR2_TOOLCHAIN_HAS_SYNC_4 # libblockdev -> cryptsetup -> json-c - depends on !BR2_TOOLCHAIN_USES_UCLIBC # polkit - depends on !BR2_STATIC_LIBS # spidermonkey + depends on !BR2_STATIC_LIBS # polkit -> duktape select BR2_PACKAGE_DBUS select BR2_PACKAGE_DBUS_GLIB select BR2_PACKAGE_LIBATASMART
@@ -43,14 +39,9 @@ comment "udisks needs udev /dev management" depends on BR2_USE_MMU depends on !BR2_PACKAGE_HAS_UDEV -comment "udisks needs a glibc or musl toolchain with locale, C++, wchar, dynamic library, NPTL, gcc >= 4.9" +comment "udisks needs a toolchain with dynamic library, locale, wchar, threads, gcc >= 7" depends on BR2_USE_MMU - depends on BR2_PACKAGE_SPIDERMONKEY_ARCH_SUPPORTS depends on BR2_TOOLCHAIN_HAS_SYNC_4 - depends on !BR2_ENABLE_LOCALE || BR2_TOOLCHAIN_USES_UCLIBC || \ - !BR2_INSTALL_LIBSTDCPP || \ - BR2_STATIC_LIBS || \ - !BR2_TOOLCHAIN_HAS_THREADS_NPTL || \ - !BR2_HOST_GCC_AT_LEAST_4_9 || \ - !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 || \ - !BR2_USE_WCHAR + depends on BR2_STATIC_LIBS || !BR2_ENABLE_LOCALE || \ + !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || \ + !BR2_TOOLCHAIN_GCC_AT_LEAST_7
Signature · 1 line
2.31.1
PATCH 2/5 package/polkit: bump version to 0.119 and use duktape
Hello,
Thanks for this work!
Quoted 6 lines · On Sun, 4 Jul 2021 22:40:57 -0700 Adam Duskett <[email protected]> wrote:
As Thomas also suggested, I have forked polkit on Github
(https://github.com/aduskett/polkit-duktape), with the above duktape merge request applied, and a release made with the same tag as upstream (0.119), with one small change: Netgroup support was yet again made optional. :) I refrained from also adding 0001-make-netgroup-support-optional.patch as it is outside of the scope of why the fork exists.
I'm a bit confused with this paragraph. In the first sentence, you say that the work is polkit upstream + duktape support + netgroup support being made yet again optional.
And then in the second sentence, you say that the fork is not intended to make netgroup support optional, so that was kept as a patch in Buildroot.
So this is rather confusing :-/
Could you clarify this point ? No need to resend, just explain what you meant, and we can adjust when applying.
Thanks a lot!
Thomas
Signature · 3 lines
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH 2/5 package/polkit: bump version to 0.119 and use duktape
Sorry; you are completely correct. I should have extended the patch instead of incorporating the "make netgroup support optional" patch into the fork.
If you wish for me to rebase I will. Sorry for any inconvenience!
Adam
Quoted 35 lines · Thomas Petazzoni
Hello,
Thanks for this work!
Quoted 6 lines · On Sun, 4 Jul 2021 22:40:57 -0700 Adam Duskett <[email protected]> wrote:
As Thomas also suggested, I have forked polkit on Github
(https://github.com/aduskett/polkit-duktape), with the above duktape merge request applied, and a release made with the same tag as upstream (0.119), with one small change: Netgroup support was yet again made optional. :) I refrained from also adding 0001-make-netgroup-support-optional.patch as it is outside of the scope of why the fork exists.I'm a bit confused with this paragraph. In the first sentence, you say that the work is polkit upstream + duktape support + netgroup support being made yet again optional.
And then in the second sentence, you say that the fork is not intended to make netgroup support optional, so that was kept as a patch in Buildroot.
So this is rather confusing :-/
Could you clarify this point ? No need to resend, just explain what you meant, and we can adjust when applying.
Thanks a lot!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
PATCH 2/5 package/polkit: bump version to 0.119 and use duktape
Quoted 5 lines · On Tue, 20 Jul 2021 07:46:06 -0700 Adam Duskett <[email protected]> wrote:
Sorry; you are completely correct. I should have extended the patch instead of incorporating the "make netgroup support optional" patch into the fork.
If you wish for me to rebase I will. Sorry for any inconvenience!
I'm not sure to understand what you're proposing. Will you integrate the "make netgroup support optional" feature in the fork, or keep it as a patch in Buildroot ?
Thomas
Signature · 3 lines
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH 2/5 package/polkit: bump version to 0.119 and use duktape
Either one you want is fine by me.
Adam
Quoted 19 lines · Thomas Petazzoni
Quoted 5 lines · On Tue, 20 Jul 2021 07:46:06 -0700 Adam Duskett <[email protected]> wrote:
Sorry; you are completely correct. I should have extended the patch instead of incorporating the "make netgroup support optional" patch into the fork.
If you wish for me to rebase I will. Sorry for any inconvenience!
I'm not sure to understand what you're proposing. Will you integrate the "make netgroup support optional" feature in the fork, or keep it as a patch in Buildroot ?
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
PATCH 3/5 package/polkit/S50polkit: new file
In reply to Adam DuskettThe Polkit source does not come with non-systemd init script. Add one that is modeled after package/busybox/S01syslogd.
--- package/polkit/S50polkit | 51 ++++++++++++++++++++++++++++++++++++++++ package/polkit/polkit.mk | 4 ++++ 2 files changed, 55 insertions(+) create mode 100755 package/polkit/S50polkit
package/polkit/S50polkit new file +51 -0
@@ -0,0 +1,51 @@ +#!/bin/sh + +DAEMON="polkitd" +DAEMON_PATH="/usr/lib/polkit-1/${DAEMON}" +PIDFILE="/var/run/${DAEMON}.pid" +POLKITD_ARGS="--no-debug" + +# polkitd does not create a pidfile, so pass "-n" in the command line +# and use "-m" to instruct start-stop-daemon to create one. +start() { + printf 'Starting %s: ' "${DAEMON}" + # shellcheck disable=SC2086 # we need the word splitting + start-stop-daemon -bmSqp "$PIDFILE" -x ${DAEMON_PATH} -- ${POLKITD_ARGS} + status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" + fi + return "$status" +} + +stop() { + printf 'Stopping %s: ' "${DAEMON}" + start-stop-daemon -Kqp "$PIDFILE" + status=$? + if [ "$status" -eq 0 ]; then + rm -f "$PIDFILE" + echo "OK" + else + echo "FAIL" + fi + return "$status" +} + +restart() { + stop + sleep 1 + start +} + +case "$1" in + start|stop|restart|reload) + "$1";; + reload) + # Restart, since there is no true "reload" feature. + restart;; + *) + echo "Usage: $0 {start|stop|restart|reload}" + exit 1 +esac
package/polkit/polkit.mk +4 -0
@@ -54,7 +54,11 @@ endef define POLKIT_INSTALL_INIT_SYSTEMD $(INSTALL) -D -m 644 $(POLKIT_PKGDIR)/polkit.service \ $(TARGET_DIR)/usr/lib/systemd/system/polkit.service +endef +define POLKIT_INSTALL_INIT_SYSV + $(INSTALL) -D -m 0755 package/polkit/S50polkit \ + $(TARGET_DIR)/etc/init.d/S50polkit endef $(eval $(autotools-package))
Signature · 1 line
2.31.1
PATCH 4/5 support/testing: add polkit tests
In reply to Adam DuskettThis test script tests polkit with and without systemd.
The Systemd test does the following:
- The brtest user attempts to restart the systemd-timesyncd service and is denied.
- A systemd-timesyncd-restart.rules file provided by polkit-rules-test is copied from /root/ to /etc/polkit-1/rules.d
- The brtest user attempts to restart the systemd-timesyncd service and should now succeed.
The initd test does the following:
- The brtest user attempts to run the test application "hello-polkit" with the command "pkexec hello-polkit" and is denied.
- A hello-polkit.rules file provided by polkit-rules-test is copied from /root/ to /etc/polkit-1/rules.d
- The brtest user attempts to re-run the test hello-polkit binary with "pkexec hello-polkit" and succeeds.
--- .../package/br2-external/polkit/Config.in | 1 + .../package/br2-external/polkit/external.desc | 1 + .../package/br2-external/polkit/external.mk | 1 + .../package/polkit-rules-test/Config.in | 6 ++ .../polkit-rules-test/initd/hello-polkit.c | 6 ++ .../initd/hello-polkit.policy | 14 ++++ .../initd/hello-polkit.rules | 6 ++ .../polkit-rules-test/polkit-rules-test.mk | 38 ++++++++++ .../systemd/systemd-timesyncd-restart.rules | 7 ++ support/testing/tests/package/test_polkit.py | 70 +++++++++++++++++++ 10 files changed, 150 insertions(+) create mode 100644 support/testing/tests/package/br2-external/polkit/Config.in create mode 100644 support/testing/tests/package/br2-external/polkit/external.desc create mode 100644 support/testing/tests/package/br2-external/polkit/external.mk create mode 100644 support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/Config.in create mode 100644 support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/initd/hello-polkit.c create mode 100644 support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/initd/hello-polkit.policy create mode 100644 support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/initd/hello-polkit.rules create mode 100644 support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/polkit-rules-test.mk create mode 100644 support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/systemd/systemd-timesyncd-restart.rules create mode 100644 support/testing/tests/package/test_polkit.py
support/testing/tests/package/br2-external/polkit/Config.in new file +1 -0
@@ -0,0 +1 @@ +source "$BR2_EXTERNAL_POLKIT_PATH/package/polkit-rules-test/Config.in"
support/testing/tests/package/br2-external/polkit/external.desc new file +1 -0
@@ -0,0 +1 @@ +name: POLKIT
support/testing/tests/package/br2-external/polkit/external.mk new file +1 -0
@@ -0,0 +1 @@ +include $(sort $(wildcard $(BR2_EXTERNAL_POLKIT_PATH)/package/*/*.mk))
support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/Config.in new file +6 -0
@@ -0,0 +1,6 @@ +config BR2_PACKAGE_POLKIT_RULES_TEST + bool "polkit rules test" + depends on BR2_PACKAGE_POLKIT + help + Simple test to ensure polkit is loading and enforcing rules + correctly.
support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/initd/hello-polkit.c new file +6 -0
@@ -0,0 +1,6 @@ +#include <stdio.h> + +int main (void ){ +printf ("Hello polkit!\n" ); +return 0 ; +}
support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/initd/hello-polkit.policy new file +14 -0
@@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE policyconfig PUBLIC + "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" + "http://www.freedesktop.org/software/polkit/policyconfig-1.dtd"> +<policyconfig> + <action id="org.freedesktop.policykit.pkexec.hello-polkit"> + <message>Authentication is required to run the hello world test program</message> + <defaults> + <allow_inactive>no</allow_inactive> + <allow_active>no</allow_active> + </defaults> + <annotate key="org.freedesktop.policykit.exec.path">/usr/bin/hello-polkit</annotate> + </action> +</policyconfig>
support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/initd/hello-polkit.rules new file +6 -0
@@ -0,0 +1,6 @@ +polkit.addRule(function(action, subject) { + if (action.id == "org.freedesktop.policykit.pkexec.hello-polkit" && + subject.user == "brtest") { + return polkit.Result.YES; + } +});
support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/polkit-rules-test.mk new file +38 -0
@@ -0,0 +1,38 @@ +################################################################################ +# +# polkit-rules-test +# +################################################################################ + +POLKIT_RULES_TEST_DEPENDENCIES = polkit + +define POLKIT_RULES_TEST_USERS + brtest -1 brtest -1 =password /home/brtest /bin/sh brtest +endef + +define POLKIT_RULES_TEST_BUILD_CMDS + $(INSTALL) -D $(POLKIT_RULES_TEST_PKGDIR)/initd/hello-polkit.c $(@D)/hello-polkit.c + $(TARGET_CC) $(@D)/hello-polkit.c -o $(@D)/hello-polkit +endef + +# Install the rules file to /root. Test_polkit.py first tests that restarting +# timesyncd as a user fails, then moves the rules file and confirmes restarting +# timesyncd as a user succeeds. +define POLKIT_RULES_TEST_INSTALL_INIT_SYSTEMD + mkdir -p $(TARGET_DIR)/etc/polkit-1/rules.d + $(INSTALL) -D $(POLKIT_RULES_TEST_PKGDIR)/systemd/systemd-timesyncd-restart.rules \ + $(TARGET_DIR)/root/systemd-timesyncd-restart.rules +endef + +define POLKIT_RULES_TEST_INSTALL_INIT_SYSV + mkdir -p $(TARGET_DIR)/usr/share/polkit-1/actions/ + $(INSTALL) -D $(@D)/hello-polkit $(TARGET_DIR)/usr/bin/hello-polkit + + $(INSTALL) -D $(POLKIT_RULES_TEST_PKGDIR)/initd/hello-polkit.policy \ + $(TARGET_DIR)/usr/share/polkit-1/actions/hello-polkit.policy + + $(INSTALL) -D $(POLKIT_RULES_TEST_PKGDIR)/initd/hello-polkit.rules \ + $(TARGET_DIR)/root/hello-polkit.rules +endef + +$(eval $(generic-package))
support/testing/tests/package/br2-external/polkit/package/polkit-rules-test/systemd/systemd-timesyncd-restart.rules new file +7 -0
@@ -0,0 +1,7 @@ +polkit.addRule(function(action, subject) { + if (action.id == "org.freedesktop.systemd1.manage-units" && + action.lookup("unit") == "systemd-timesyncd.service" && + subject.user == "brtest") { + return polkit.Result.YES; + } +});
support/testing/tests/package/test_polkit.py new file +70 -0
70 lines not on this page · raw message
Signature · 1 line
2.31.1
PATCH 5/5 package/spidermonkey: drop package
In reply to Adam DuskettNow that Spidermonkey is no longer required to build the polkit package, and no other packages require Spidermonkey, and python2 is required to build the package, it is safe to drop the package.
--- Config.in.legacy | 9 ++ package/Config.in | 1 - .../0001-allow-newer-autoconf-versions.patch | 61 -------- .../0002-allow-building-in-tree.patch | 47 ------ ...-allow-unknown-configuration-options.patch | 35 ----- .../0004-fix-building-with-musl.patch | 133 ---------------- .../spidermonkey/0005-add-riscv-support.patch | 121 --------------- ...ers-on-install-instead-of-symlinking.patch | 34 ----- ...ng-on-64-bit-and-32-bit-be-platforms.patch | 144 ------------------ ...-on-ARM64-for-generated-unboxed-obje.patch | 66 -------- ...-clobbering-it-in-the-regex-compiler.patch | 100 ------------ ...lent-year-to-determine-the-time-zone.patch | 103 ------------- ....in-install-shell-only-if-it-s-built.patch | 28 ---- package/spidermonkey/Config.in | 60 -------- package/spidermonkey/spidermonkey.hash | 3 - package/spidermonkey/spidermonkey.mk | 64 -------- 16 files changed, 9 insertions(+), 1000 deletions(-) delete mode 100644 package/spidermonkey/0001-allow-newer-autoconf-versions.patch delete mode 100644 package/spidermonkey/0002-allow-building-in-tree.patch delete mode 100644 package/spidermonkey/0003-allow-unknown-configuration-options.patch delete mode 100644 package/spidermonkey/0004-fix-building-with-musl.patch delete mode 100644 package/spidermonkey/0005-add-riscv-support.patch delete mode 100644 package/spidermonkey/0006-copy-headers-on-install-instead-of-symlinking.patch delete mode 100644 package/spidermonkey/0007-ensure-proper-running-on-64-bit-and-32-bit-be-platforms.patch delete mode 100644 package/spidermonkey/0008-save-and-restore-non-volatile-x28-on-ARM64-for-generated-unboxed-obje.patch delete mode 100644 package/spidermonkey/0009-save-x28-before-clobbering-it-in-the-regex-compiler.patch delete mode 100644 package/spidermonkey/0010-always-use-the-equivalent-year-to-determine-the-time-zone.patch delete mode 100644 package/spidermonkey/0011-js-src-Makefile.in-install-shell-only-if-it-s-built.patch delete mode 100644 package/spidermonkey/Config.in delete mode 100644 package/spidermonkey/spidermonkey.hash delete mode 100644 package/spidermonkey/spidermonkey.mk
Config.in.legacy +9 -0
@@ -146,6 +146,15 @@ endif comment "Legacy options removed in 2021.05" +config BR2_PACKAGE_SPIDERMONKEY + bool "The spidermonkey package has been removed" + select BR2_LEGACY + help + The spidermonkey package was removed. The only package that + depended on spidermonkey was polkit. The spidermonkey + dependency is replaced with duktape, which saves 24~MB of + space on the target and 2.7G~ on the host. + config BR2_PACKAGE_PHP_EXT_XMLRPC bool "PHP XMLRPC extension removed" select BR2_LEGACY
package/Config.in +0 -1
@@ -1635,7 +1635,6 @@ endif source "package/jszip/Config.in" source "package/openlayers/Config.in" source "package/popperjs/Config.in" - source "package/spidermonkey/Config.in" source "package/vuejs/Config.in" endmenu
package/spidermonkey/0001-allow-newer-autoconf-versions.patch deleted +0 -61
61 lines not on this page · raw message
package/spidermonkey/0002-allow-building-in-tree.patch deleted +0 -47
47 lines not on this page · raw message
package/spidermonkey/0003-allow-unknown-configuration-options.patch deleted +0 -35
@@ -1,35 +0,0 @@ -From 4a06a1a6a71293decb83aee7adb74bc709493106 Mon Sep 17 00:00:00 2001 -From: Philip Chimento <[email protected]> -Date: Wed, 5 Jul 2017 22:57:09 -0700 -Subject: [PATCH] allow unknown configuration options - -By default, if an unknown parameter is passed to configure, an error is raised. -Replace the raise with a pass and continue. - -Fixes: https://bugzilla.mozilla.org/show_bug.cgi?id=1379540 - -Signed-off-by: Philip Chimento <[email protected]> -Signed-off-by: Adam Duskett <[email protected]> ---- - js/src/configure | 9 +++++++++ - python/mozbuild/mozbuild/configure/__init__.py | 2 +- - python/mozbuild/mozbuild/configure/options.py | 6 +++++- - 3 files changed, 15 insertions(+), 2 deletions(-) - create mode 100755 js/src/configure - -diff --git a/python/mozbuild/mozbuild/configure/__init__.py b/python/mozbuild/mozbuild/configure/__init__.py -index 0fe640ca..09b460d3 100644 ---- a/python/mozbuild/mozbuild/configure/__init__.py -+++ b/python/mozbuild/mozbuild/configure/__init__.py -@@ -421,7 +421,7 @@ def run(self, path=None): - # All options should have been removed (handled) by now. - for arg in self._helper: - without_value = arg.split('=', 1)[0] -- raise InvalidOptionError('Unknown option: %s' % without_value) -+ pass - - # Run the execution queue - for func, args in self._execution_queue: --- -2.23.0 -
package/spidermonkey/0004-fix-building-with-musl.patch deleted +0 -133
133 lines not on this page · raw message
package/spidermonkey/0005-add-riscv-support.patch deleted +0 -121
121 lines not on this page · raw message
package/spidermonkey/0006-copy-headers-on-install-instead-of-symlinking.patch deleted +0 -34
@@ -1,34 +0,0 @@ -From 903a79a1efff18fc7cc50db09a3fe5d768adc9a8 Mon 19 Mar 2018 09:58:06 +0100 -From: Rico Tzschichholz <[email protected]> -Date: Wed, 5 Jul 2017 22:45:59 -0700 -Subject: build: Copy headers on install instead of symlinking - -Patch ported from mozjs52 by Philip Chimento - -Signed-off-by: Rico Tzschichholz <[email protected]> -Signed-off-by: Adam Duskett <[email protected]> ---- - python/mozbuild/mozbuild/backend/recursivemake.py | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py -index dd9020d..6918ef8 100644 ---- a/python/mozbuild/mozbuild/backend/recursivemake.py -+++ b/python/mozbuild/mozbuild/backend/recursivemake.py -@@ -1427,11 +1427,11 @@ class RecursiveMakeBackend(CommonBackend): - raise Exception("Wildcards are only supported in the filename part of " - "srcdir-relative or absolute paths.") - -- install_manifest.add_pattern_link(basepath, wild, path) -+ install_manifest.add_pattern_copy(basepath, wild, path) - else: -- install_manifest.add_pattern_link(f.srcdir, f, path) -+ install_manifest.add_pattern_copy(f.srcdir, f, path) - else: -- install_manifest.add_link(f.full_path, dest) -+ install_manifest.add_copy(f.full_path, dest) - else: - install_manifest.add_optional_exists(dest) - backend_file.write('%s_FILES += %s\n' % ( --- -2.23.0
package/spidermonkey/0007-ensure-proper-running-on-64-bit-and-32-bit-be-platforms.patch deleted +0 -144
144 lines not on this page · raw message
package/spidermonkey/0008-save-and-restore-non-volatile-x28-on-ARM64-for-generated-unboxed-obje.patch deleted +0 -66
66 lines not on this page · raw message
package/spidermonkey/0009-save-x28-before-clobbering-it-in-the-regex-compiler.patch deleted +0 -100
100 lines not on this page · raw message
package/spidermonkey/0010-always-use-the-equivalent-year-to-determine-the-time-zone.patch deleted +0 -103
103 lines not on this page · raw message
package/spidermonkey/0011-js-src-Makefile.in-install-shell-only-if-it-s-built.patch deleted +0 -28
@@ -1,28 +0,0 @@ -From b5e4a9926cf50d12e9c5c05c6d1b161e5b662d62 Mon Sep 17 00:00:00 2001 -From: Carlos Santos <[email protected]> -Date: Sat, 7 Mar 2020 23:42:02 -0300 -Subject: [PATCH] js/src/Makefile.in: install shell only if it's built - -Prevents an installation error if we configure with --disable-js-shell. - -Signed-off-by: Carlos Santos <[email protected]> ---- - js/src/Makefile.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/js/src/Makefile.in b/js/src/Makefile.in -index 4ac9f48..9c8fb64 100644 ---- a/js/src/Makefile.in -+++ b/js/src/Makefile.in -@@ -136,7 +136,7 @@ endif - - install:: - $(MAKE) -C build install -- $(MAKE) -C shell install -+ if [ -d shell ]; then $(MAKE) -C shell install; fi - - ifdef HAVE_DTRACE - javascript-trace.h: $(srcdir)/devtools/javascript-trace.d --- -2.18.2 -
package/spidermonkey/Config.in deleted +0 -60
60 lines not on this page · raw message
package/spidermonkey/spidermonkey.hash deleted +0 -3
@@ -1,3 +0,0 @@ -# Locally computed -sha256 f51039c997415fd0f13f8e01966b4a8ff80cbf90deb8b14c18827104a369cc0d mozjs-60.5.2.tar.bz2 -sha256 aaac93a33bec26d5d1a9c5efc1e7dc6bd215d8a4f1e1a7fc5315a67adfd51338 moz.configure
package/spidermonkey/spidermonkey.mk deleted +0 -64
64 lines not on this page · raw message
Signature · 1 line
2.31.1