Files
udev/source-files/0001-artix-standalone-install.patch
T

313 lines
12 KiB
Diff

From 8fe1b550905c906afa6e8ffd0e1bb93e661763c4 Mon Sep 17 00:00:00 2001
From: artoo <[email protected]>
Date: Sat, 20 Jun 2026 12:47:27 +0200
Subject: [PATCH] udev standalone install
---
meson.build | 13 ++++++----
meson_options.txt | 3 +++
rules.d/meson.build | 4 ++--
shell-completion/bash/meson.build | 40 -------------------------------
shell-completion/zsh/meson.build | 33 -------------------------
src/core/meson.build | 5 ----
src/hwdb/meson.build | 2 +-
src/libudev/meson.build | 9 ++++++-
src/udev/meson.build | 8 +++----
src/udev/udevd.c | 2 +-
test/meson.build | 2 +-
11 files changed, 29 insertions(+), 92 deletions(-)
diff --git a/meson.build b/meson.build
index ff11c0c10c..172bd1dc96 100644
--- a/meson.build
+++ b/meson.build
@@ -96,6 +96,7 @@ conf.set10('HAVE_SPLIT_BIN', split_bin,
description : 'bin and sbin directories are separate')
have_standalone_binaries = get_option('standalone-binaries')
+have_standalone_udev = get_option('standalone-udev')
conf.set10('CREATE_LOG_DIRS', get_option('create-log-dirs'))
@@ -128,7 +129,7 @@ includedir = prefixdir / get_option('includedir')
datadir = prefixdir / get_option('datadir')
localstatedir = '/' / get_option('localstatedir')
-libexecdir = prefixdir / 'lib/systemd'
+libexecdir = bindir
libexecdir_to_bin = '../../bin/'
pkglibdir = libdir / 'systemd'
@@ -2465,7 +2466,6 @@ subdir('shell-completion/zsh')
subdir('sysctl.d')
subdir('sysusers.d')
subdir('tmpfiles.d')
-subdir('units')
install_subdir('factory/etc',
install_dir : factorydir)
@@ -2487,6 +2487,11 @@ install_data('LICENSE.GPL2',
install_subdir('LICENSES',
install_dir : docdir)
+install_data('LICENSE.GPL2',
+ 'LICENSE.LGPL2.1',
+ install_tag : 'udev',
+ install_dir : datadir / 'doc/udev')
+
#####################################################################
# Ensure that changes to the docs/ directory do not break the
@@ -2700,10 +2705,10 @@ udev_targets = []
foreach bin : udev_binaries
udev_targets += executables_by_name.get(bin, [])
endforeach
-alias_target('udev', buildable_rules, udev_targets, udev_units)
+alias_target('udev', buildable_rules, udev_targets)
if conf.get('ENABLE_HWDB') == 1
- alias_target('hwdb', auto_suspend_rules, executables_by_name.get('systemd-hwdb'), hwdb_units)
+ alias_target('hwdb', auto_suspend_rules, executables_by_name.get('udev-hwdb'))
endif
alt_time_epoch = run_command('date', '-Is', '-u', '-d', f'@@time_epoch@', check : false)
diff --git a/meson_options.txt b/meson_options.txt
index b5856dd8f8..868048ad7c 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -576,3 +576,6 @@ option('default-mountfsd-trusted-directories', type : 'boolean', value: false,
option('default-oci-registry', type : 'string', value : 'docker.io',
description : 'Default OCI registry name')
+
+option('standalone-udev', type : 'boolean', value : false,
+ description : 'build standalone version of udev')
diff --git a/rules.d/meson.build b/rules.d/meson.build
index aa469ef7a7..8c56d96b04 100644
--- a/rules.d/meson.build
+++ b/rules.d/meson.build
@@ -2,7 +2,8 @@
install_data(
'README',
- install_dir : udevrulesdir)
+ install_dir : udevrulesdir,
+ install_tag : 'udev')
rules = [
[files('60-autosuspend.rules',
@@ -67,7 +68,6 @@ rules_in = [
['50-udev-default.rules'],
['60-persistent-storage.rules'],
['64-btrfs.rules'],
- ['99-systemd.rules'],
['70-uaccess.rules', conf.get('ENABLE_LOGIND') == 1 and conf.get('HAVE_ACL') == 1],
['71-seat.rules', conf.get('ENABLE_LOGIND') == 1],
diff --git a/shell-completion/bash/meson.build b/shell-completion/bash/meson.build
index cddf742059..0181111975 100644
--- a/shell-completion/bash/meson.build
+++ b/shell-completion/bash/meson.build
@@ -20,47 +20,7 @@ custom_target(
install_dir : bashcompletiondir)
foreach item : [
- ['bootctl', ''],
- ['busctl', ''],
- ['coredumpctl', 'ENABLE_COREDUMP'],
- ['homectl', 'ENABLE_HOMED'],
- ['hostnamectl', 'ENABLE_HOSTNAMED'],
- ['importctl', 'ENABLE_IMPORTD'],
- ['journalctl', ''],
- ['kernel-install', 'ENABLE_KERNEL_INSTALL'],
- ['localectl', 'ENABLE_LOCALED'],
- ['loginctl', 'ENABLE_LOGIND'],
- ['machinectl', 'ENABLE_MACHINED'],
- ['networkctl', 'ENABLE_NETWORKD'],
- ['oomctl', 'ENABLE_OOMD'],
- ['portablectl', 'ENABLE_PORTABLED'],
- ['resolvectl', 'ENABLE_RESOLVE'],
- ['run0', ''],
- ['storagectl', ''],
- ['systemd-analyze', ''],
- ['systemd-cat', ''],
- ['systemd-cgls', ''],
- ['systemd-cgtop', ''],
- ['systemd-confext', 'ENABLE_SYSEXT'],
- ['systemd-creds', ''],
- ['systemd-cryptenroll', 'HAVE_LIBCRYPTSETUP'],
- ['systemd-delta', ''],
- ['systemd-detect-virt', ''],
- ['systemd-dissect', 'HAVE_BLKID'],
- ['systemd-hwdb', 'ENABLE_HWDB'],
- ['systemd-id128', ''],
- ['systemd-nspawn', 'ENABLE_NSPAWN'],
- ['systemd-path', ''],
- ['systemd-resolve', 'ENABLE_RESOLVE'],
- ['systemd-run', ''],
- ['systemd-sysext', 'ENABLE_SYSEXT'],
- ['systemd-sysinstall', 'ENABLE_SYSINSTALL'],
- ['systemd-vmspawn', 'ENABLE_VMSPAWN'],
- ['systemd-vpick', ''],
- ['timedatectl', 'ENABLE_TIMEDATED'],
['udevadm', ''],
- ['userdbctl', 'ENABLE_USERDB'],
- ['varlinkctl', ''],
]
if item[1] == '' or conf.get(item[1]) == 1
diff --git a/shell-completion/zsh/meson.build b/shell-completion/zsh/meson.build
index f10ba7be61..5758d95479 100644
--- a/shell-completion/zsh/meson.build
+++ b/shell-completion/zsh/meson.build
@@ -15,40 +15,7 @@ custom_target(
install_dir : zshcompletiondir)
foreach item : [
- ['_bootctl', ''],
- ['_busctl', ''],
- ['_coredumpctl', 'ENABLE_COREDUMP'],
- ['_hostnamectl', 'ENABLE_HOSTNAMED'],
- ['_journalctl', ''],
- ['_kernel-install', 'ENABLE_KERNEL_INSTALL'],
- ['_localectl', 'ENABLE_LOCALED'],
- ['_loginctl', 'ENABLE_LOGIND'],
- ['_machinectl', 'ENABLE_MACHINED'],
- ['_networkctl', 'ENABLE_NETWORKD'],
- ['_oomctl', 'ENABLE_OOMD'],
- ['_resolvectl', 'ENABLE_RESOLVE'],
- ['_run0', ''],
- ['_sd_bus_address', ''],
- ['_sd_hosts_or_user_at_host', ''],
- ['_sd_machines', 'ENABLE_MACHINED'],
- ['_sd_outputmodes', ''],
- ['_sd_unit_files', ''],
- ['_storagectl', ''],
- ['_systemd', ''],
- ['_systemd-analyze', ''],
- ['_systemd-delta', ''],
- ['_systemd-hwdb', 'ENABLE_HWDB'],
- ['_systemd-id128', ''],
- ['_systemd-inhibit', 'ENABLE_LOGIND'],
- ['_systemd-nspawn', ''],
- ['_systemd-path', ''],
- ['_systemd-run', ''],
- ['_systemd-sysinstall', 'ENABLE_SYSINSTALL'],
- ['_systemd-tmpfiles', 'ENABLE_TMPFILES'],
- ['_timedatectl', 'ENABLE_TIMEDATED'],
['_udevadm', ''],
- ['_userdbctl', ''],
- ['_varlinkctl', ''],
]
if item[1] == '' or conf.get(item[1]) == 1
diff --git a/src/core/meson.build b/src/core/meson.build
index af50a2a4fa..c24a37b725 100644
--- a/src/core/meson.build
+++ b/src/core/meson.build
@@ -304,11 +304,6 @@ if install_sysconfdir
install_dir : sysconfdir / 'xdg/systemd')
endif
-assert(fs.parent(sbindir) / 'lib/systemd' == libexecdir)
-install_symlink('init',
- pointing_to : '../lib/systemd/systemd',
- install_dir : sbindir)
-
############################################################
core_test_template = test_template + {
diff --git a/src/hwdb/meson.build b/src/hwdb/meson.build
index 57ace3ad44..96c0b185d0 100644
--- a/src/hwdb/meson.build
+++ b/src/hwdb/meson.build
@@ -2,7 +2,7 @@
executables += [
executable_template + {
- 'name' : 'systemd-hwdb',
+ 'name' : 'udev-hwdb',
'public' : true,
'conditions' : ['ENABLE_HWDB'],
'sources' : files('hwdb.c'),
diff --git a/src/libudev/meson.build b/src/libudev/meson.build
index 854628aed4..ffed0018e6 100644
--- a/src/libudev/meson.build
+++ b/src/libudev/meson.build
@@ -25,6 +25,13 @@ libudev_sym_path = libudev_dir_path / 'libudev.sym'
install_headers('libudev.h')
libudev_h_path = libudev_dir_path / 'libudev.h'
+if have_standalone_udev
+ install_data(
+ libudev_h_path,
+ install_dir: includedir,
+ install_tag: 'libudev-devel')
+endif
+
libudev_basic = static_library(
'udev-basic',
libudev_sources,
@@ -42,5 +49,5 @@ libudev_pc = custom_target(
output : 'libudev.pc',
command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
install : pkgconfiglibdir != 'no',
- install_tag : 'devel',
+ install_tag : 'libudev-devel',
install_dir : pkgconfiglibdir)
diff --git a/src/udev/meson.build b/src/udev/meson.build
index 375645e759..ea353f5600 100644
--- a/src/udev/meson.build
+++ b/src/udev/meson.build
@@ -256,9 +256,9 @@ executables += [
},
]
-install_symlink('systemd-udevd',
- pointing_to : libexecdir_to_bin + 'udevadm',
- install_dir : libexecdir,
+install_symlink('udevd',
+ pointing_to : bindir / 'udevadm',
+ install_dir : bindir,
install_tag : 'udev')
if install_sysconfdir_samples
@@ -275,7 +275,7 @@ udev_pc = custom_target(
output : 'udev.pc',
command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
install : pkgconfigdatadir != 'no',
- install_tag : 'devel',
+ install_tag : 'udev-devel',
install_dir : pkgconfigdatadir)
if install_sysconfdir
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index 4cbc481c76..ca2e207ead 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -67,7 +67,7 @@ int run_udevd(int argc, char *argv[]) {
if (arg_daemonize) {
pid_t pid;
- log_info("Starting systemd-udevd version " GIT_VERSION);
+ log_info("Starting udevd version " GIT_VERSION);
/* connect /dev/null to stdin, stdout, stderr */
if (log_get_max_level() < LOG_DEBUG) {
diff --git a/test/meson.build b/test/meson.build
index fd3dba3a60..8284b24615 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -40,7 +40,7 @@ endif
############################################################
if want_tests != 'false' and conf.get('ENABLE_HWDB') == 1
- exe = executables_by_name.get('systemd-hwdb')
+ exe = executables_by_name.get('udev-hwdb')
test('hwdb-test',
files('hwdb-test.sh'),
suite : 'dist',
--
2.54.0