Initial Commit

- initial default booting image
This commit is contained in:
2026-11-06 20:45:42 +01:00
commit b8783708ae
15201 changed files with 602532 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
From 51a1c5b5ab616fe0243b40baddb4864199bbe624 Mon Sep 17 00:00:00 2001
From: Romain Naour <romain.naour@smile.fr>
Date: Sat, 2 Nov 2024 23:33:16 +0100
Subject: [PATCH] meson: disable PIDFD when systemd is not available
Since the Polkit version bump 125, TestPolkitInitd fail due to an
upstream issue related to the new PIDFD support introduced in
Polkit 124 [1].
The PIDFD issue only affect OS without systemd.
Only enable PIDFD support when systemd is available until
upstream fix the issue.
Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/8199992596
[1] https://github.com/polkit-org/polkit/issues/451
Upstream: Not applicable
Signed-off-by: Romain Naour <romain.naour@smile.fr>
---
meson.build | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/meson.build b/meson.build
index 302c189..5c247f4 100644
--- a/meson.build
+++ b/meson.build
@@ -202,8 +202,6 @@ if enable_logind
endif
config_data.set('HAVE_LIBSYSTEMD', enable_logind)
-config_data.set('HAVE_PIDFD_OPEN', cc.get_define('SYS_pidfd_open', prefix: '#include <sys/syscall.h>') != '')
-
# systemd unit / sysuser / tmpfiles.d file installation directories
systemdsystemunitdir = get_option('systemdsystemunitdir')
systemd_dep = dependency('systemd', required : false)
@@ -222,6 +220,10 @@ else
tmpfiles_dir = '/usr/lib/tmpfiles.d'
endif
+# PIDFD is broken with sysvinit based OS since 124 release
+# https://github.com/polkit-org/polkit/issues/451
+config_data.set('HAVE_PIDFD_OPEN', systemd_dep.found() and cc.get_define('SYS_pidfd_open', prefix: '#include <sys/syscall.h>') != '')
+
# User for running polkitd
polkitd_user = get_option('polkitd_user')
config_data.set_quoted('POLKITD_USER', polkitd_user)
--
2.45.0

27
package/polkit/Config.in Normal file
View File

@@ -0,0 +1,27 @@
config BR2_PACKAGE_POLKIT
bool "polkit"
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 # duktape
depends on !BR2_OPTIMIZE_FAST # duktape
select BR2_PACKAGE_DBUS # runtime
select BR2_PACKAGE_DUKTAPE
select BR2_PACKAGE_EXPAT
select BR2_PACKAGE_LIBGLIB2
select BR2_PACKAGE_LIBXCRYPT if BR2_TOOLCHAIN_USES_GLIBC
help
PolicyKit is a toolkit for defining and handling
authorizations. It is used for allowing unprivileged
processes to speak to privileged processes.
http://www.freedesktop.org/wiki/Software/polkit
comment "polkit needs a toolchain with dynamic library, wchar, threads, gcc >= 7"
depends on BR2_USE_MMU
depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_GCC_AT_LEAST_7 || \
BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS
comment "polkit can't be built with Optimize for fast"
depends on BR2_OPTIMIZE_FAST

51
package/polkit/S50polkitd Normal file
View File

@@ -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)
"$1";;
reload)
# Restart, since there is no true "reload" feature.
restart;;
*)
echo "Usage: $0 {start|stop|restart|reload}"
exit 1
esac

View File

@@ -0,0 +1,3 @@
# Locally calculated
sha256 2814a7281989f6baa9e57bd33bbc5e148827e2721ccef22aaf28ab2b376068e8 polkit-126.tar.gz
sha256 d2e2aa973e29c75e1b492e67ea7b7da9de2d501d49a934657971fd74f9a0b0a8 COPYING

75
package/polkit/polkit.mk Normal file
View File

@@ -0,0 +1,75 @@
################################################################################
#
# polkit
#
################################################################################
POLKIT_VERSION = 126
POLKIT_SITE = $(call github,polkit-org,polkit,$(POLKIT_VERSION))
POLKIT_LICENSE = GPL-2.0
POLKIT_LICENSE_FILES = COPYING
POLKIT_CPE_ID_VALID = YES
POLKIT_INSTALL_STAGING = YES
POLKIT_DEPENDENCIES = \
duktape libglib2 host-intltool expat $(TARGET_NLS_DEPENDENCIES)
POLKIT_SELINUX_MODULES = policykit
POLKIT_LDFLAGS = $(TARGET_NLS_LIBS)
POLKIT_CONF_OPTS = \
-Dman=false \
-Dexamples=false \
-Dsession_tracking=ConsoleKit
ifeq ($(BR2_PACKAGE_GOBJECT_INTROSPECTION),y)
POLKIT_CONF_OPTS += -Dintrospection=true
POLKIT_DEPENDENCIES += gobject-introspection
else
POLKIT_CONF_OPTS += -Dintrospection=false
endif
ifeq ($(BR2_PACKAGE_LIBXCRYPT),y)
POLKIT_DEPENDENCIES += libxcrypt
endif
ifeq ($(BR2_PACKAGE_LINUX_PAM),y)
POLKIT_DEPENDENCIES += linux-pam
POLKIT_CONF_OPTS += -Dauthfw=pam
else
POLKIT_CONF_OPTS += -Dauthfw=shadow
endif
# polkit.{its,loc} are needed for gvfs and must be installed in $(HOST_DIR)
# and not $(STAGING_DIR)
define POLKIT_INSTALL_ITS
$(INSTALL) -D -m 644 $(@D)/gettext/its/polkit.its \
$(HOST_DIR)/share/gettext/its/polkit.its
$(INSTALL) -D -m 644 $(@D)/gettext/its/polkit.loc \
$(HOST_DIR)/share/gettext/its/polkit.loc
endef
POLKIT_POST_INSTALL_TARGET_HOOKS += POLKIT_INSTALL_ITS
define POLKIT_USERS
polkitd -1 polkitd -1 * - - - Polkit Daemon
endef
define POLKIT_PERMISSIONS
/etc/polkit-1/rules.d d 750 root polkitd - - - - -
/usr/share/polkit-1/rules.d d 750 root polkitd - - - - -
/usr/bin/pkexec f 4755 root root - - - - -
/usr/lib/polkit-1/polkit-agent-helper-1 f 4755 root root - - - - -
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/S50polkitd \
$(TARGET_DIR)/etc/init.d/S50polkitd
endef
$(eval $(meson-package))

View File

@@ -0,0 +1,12 @@
[Unit]
Description=Authorization Manager
Documentation=man:polkit(8)
[Service]
Type=dbus
BusName=org.freedesktop.PolicyKit1
ExecStart=/usr/lib/polkit-1/polkitd --no-debug
[Install]
WantedBy=multi-user.target