From 572fc6efb5ea952569f11efd185250584afbe038 Mon Sep 17 00:00:00 2001 From: artoo Date: Wed, 27 May 2026 15:17:52 +0200 Subject: [PATCH 1/1] udev standalone install --- meson.build | 13 +++++++--- meson_options.txt | 3 +++ rules.d/meson.build | 4 +-- shell-completion/bash/meson.build | 41 ++----------------------------- shell-completion/zsh/meson.build | 34 ++----------------------- 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, 33 insertions(+), 90 deletions(-) diff --git a/meson.build b/meson.build index e98a62d9bc..ba519b7494 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' @@ -2806,7 +2807,6 @@ subdir('shell-completion/zsh') subdir('sysctl.d') subdir('sysusers.d') subdir('tmpfiles.d') -subdir('units') install_subdir('factory/etc', install_dir : factorydir) @@ -2828,6 +2828,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 @@ -3013,10 +3018,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 c1af7ce237..ab1f3d7ae5 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -568,3 +568,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 154910979e..9dc7a8bffe 100644 --- a/shell-completion/bash/meson.build +++ b/shell-completion/bash/meson.build @@ -20,49 +20,12 @@ 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', ''], - ['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-vmspawn', 'ENABLE_VMSPAWN'], - ['systemd-vpick', ''], - ['timedatectl', 'ENABLE_TIMEDATED'], ['udevadm', ''], - ['userdbctl', 'ENABLE_USERDB'], - ['varlinkctl', ''], ] if item[1] == '' or conf.get(item[1]) == 1 install_data(item[0], - install_dir : bashcompletiondir) + install_dir : bashcompletiondir, + install_tag : 'udev') endif endforeach diff --git a/shell-completion/zsh/meson.build b/shell-completion/zsh/meson.build index b1bff151e4..ce6e147bf0 100644 --- a/shell-completion/zsh/meson.build +++ b/shell-completion/zsh/meson.build @@ -15,42 +15,12 @@ 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', ''], - ['_systemd', ''], - ['_systemd-analyze', ''], - ['_systemd-delta', ''], - ['_systemd-hwdb', 'ENABLE_HWDB'], - ['_systemd-id128', ''], - ['_systemd-inhibit', 'ENABLE_LOGIND'], - ['_systemd-nspawn', ''], - ['_systemd-path', ''], - ['_systemd-run', ''], - ['_systemd-tmpfiles', 'ENABLE_TMPFILES'], - ['_timedatectl', 'ENABLE_TIMEDATED'], ['_udevadm', ''], - ['_userdbctl', ''], - ['_varlinkctl', ''], ] if item[1] == '' or conf.get(item[1]) == 1 install_data(item[0], - install_dir : zshcompletiondir) + install_dir : zshcompletiondir, + install_tag : 'udev') endif endforeach diff --git a/src/core/meson.build b/src/core/meson.build index 391dc45a6b..04faeefafe 100644 --- a/src/core/meson.build +++ b/src/core/meson.build @@ -298,11 +298,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 eb9dda79ae..174dcd2a12 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 700a8cc8d5..d2981583ff 100644 --- a/src/udev/meson.build +++ b/src/udev/meson.build @@ -258,9 +258,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 @@ -277,7 +277,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 840febbd42..b772115d3c 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 7bf557cc19..3e16a3bffa 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