来源:systemd-stable-251:https ://github.com/systemd/systemd-stable
wget https://github.com/systemd/systemd-stable/archive/refs/heads/v251-stable.zip
unzip v251-stable.zip
cd systemd-stable-251-stable/
使用命令:
./configure --auto-features=disabled \
--default-library=static \
-D standalone-binaries=true \
-D static-libsystemd=true \
-D static-libudev=true \
-D link-udev-shared=false \
-D link-systemctl-shared=false \
-D link-networkd-shared=false \
-D link-timesyncd-shared=false \
-D link-boot-shared=false && make
还尝试仅使用静态库并仅启用独立选项。
配置:
Features
enabled : IMA, SELinux, SMACK, blkid, gcrypt, gnutls, libidn2, openssl, p11kit, xkbcommon, xz, zlib, bzip2, backlight, binfmt, coredump, environment.d, efi, firstboot, hibernate, hostnamed, hwdb, initrd, kernel-install, localed, logind, machined, networkd, nss-myhostname, nss-mymachines, nss-resolve, nss-systemd, oomd, portabled, pstore, quotacheck, randomseed, resolve, rfkill, sysext, systemd-analyze, sysusers, timedated, timesyncd, tmpfiles, userdb, vconsole, xdg-autostart, idn, polkit, nscd, dbus, glib, tpm, SysV compat, utmp, ldconfig, adm group, wheel group, gshadow, standalone-binaries, static-libsystemd(true), static-libudev(true), cryptolib(gcrypt), DNS-over-TLS(openssl)
disabled : ACL, AUDIT, AppArmor, PAM, SECCOMP, elfutils, libbpf, libcryptsetup, libcryptsetup-plugins, libcurl, libfdisk, libfido2, libidn, libiptc, microhttpd, pcre2, pwquality, qrencode, tpm2, zstd, lz4, bpf-framework, gnu-efi, homed, importd, repart, sysupdate, legacy-pkla, kmod, man pages, html pages, man page indices, compat-mutable-uid-boundaries, debug hashmap, debug mmap cache, debug siphash, valgrind, trace logging, install tests, link-udev-shared, link-systemctl-shared, link-networkd-shared, link-timesyncd-shared, link-boot-shared, fexecve, coverage
用户定义选项 auto_features : 禁用 default_library : 静态 link-boot-shared : false link-networkd-shared : false link-systemctl-shared : false link-timesyncd-shared : false link-udev-shared : false 独立二进制文件 : true static -libsystemd:真静态libdev:真
共享对象:
# file build/udevadm
build/udevadm: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=f6b7c1a3509d45ebcafda9b49f4dd2332e786738, with debug_info, not stripped
我期待看到一个 ELF 可执行文件而不是共享对象文件。
选项的文档
standalone-binaries
说:这似乎充其量是模棱两可的。查看
meson_build
文件,我们发现:这似乎表明该选项仅影响
systemd-sysusers
andsystemd-tmpfiles
,实际上,当构建完成时,我们看到:看起来事情正在按设计运行。