summaryrefslogtreecommitdiff
path: root/src/basic/meson.build
Commit message (Collapse)AuthorAgeFilesLines
* chase-symlinks: Rename chase_symlinks() to chase()Daan De Meyer2023-03-241-1/+1
| | | | | | | | | Chasing symlinks is a core function that's used in a lot of places so it deservers a less verbose names so let's rename it to chase() and chaseat(). We also slightly change the pattern used for the chaseat() helpers so we get chase_and_openat() and similar.
* Merge pull request #26641 from medhefgo/boot-elf2efiYu Watanabe2023-03-111-6/+9
|\ | | | | boot: Drop gnu-efi / Add elf2efi.py
| * meson: Introduce userspace depJan Janssen2023-03-101-6/+9
| | | | | | | | This will help in a later commit to separate userspace from EFI builds.
* | Merge pull request #26726 from DaanDeMeyer/cleanupsDaan De Meyer2023-03-101-0/+1
|\ \ | | | | | | Various small cleanups
| * | lock-util: Move to src/basicDaan De Meyer2023-03-101-0/+1
| |/
* | basic: add RuntimeScope enumLennart Poettering2023-03-101-0/+1
|/ | | | | | | | | | | | In various tools and services we have a per-system and per-user concept. So far we sometimes used a boolean indicating whether we are in system mode, or a reversed boolean indicating whether we are in user mode, or the LookupScope enum used by the lookup path logic. Let's address that, in introduce a common enum for this, we can use all across the board. This is mostly just search/replace, no actual code changes.
* shared: move psi-util.[ch] to basic/ so that we can use it in sd-eventLennart Poettering2023-02-171-0/+1
|
* meson: Do not include headers in source listsJan Janssen2023-01-241-170/+3
| | | | | | Meson+ninja+compiler do this for us and are better at it. https://mesonbuild.com/FAQ.html#do-i-need-to-add-my-headers-to-the-sources-list-like-in-autotools
* Rename def.h to constants.hZbigniew Jędrzejewski-Szmek2022-11-081-1/+1
| | | | | | The name "def.h" originates from before the rule of "no needless abbreviations" was established. Let's rename the file to clarify that it contains a collection of various semi-related constants.
* basic: rename util.h to logarithm.hZbigniew Jędrzejewski-Szmek2022-11-081-1/+1
| | | | | util.h is now about logarithms only, so we can rename it. Many files included util.h for no apparent reason… Those includes are dropped.
* basic: move a bunch of cmdline-related funcs to new argv-util.c+hZbigniew Jędrzejewski-Szmek2022-11-081-1/+2
| | | | | | | | | | | | | I wanted to move saved_arg[cv] to process-util.c+h, but this causes problems: process-util.h includes format-util.h which includes net/if.h, which conflicts with linux/if.h. So we can't include process-util.h in some files. But process-util.c is very long anyway, so it seems nice to create a new file. rename_process(), invoked_as(), invoked_by_systemd(), and argv_looks_like_help() which lived in process-util.c refer to saved_argc and saved_argv, so it seems reasonable to move them to the new file too. util.c is now empty, so it is removed. util.h remains.
* basic: create new basic/initrd-util.[ch] for initrd-related functionsZbigniew Jędrzejewski-Szmek2022-11-081-0/+2
| | | | | | | | | I changed imports of util.h to initrd-util.h, or added an import of initrd-util.h, to keep compilation working. It turns out that many files didn't import util.h directly. When viewing the patch, don't be confused by git rename detection logic: a new .c file is added and two functions moved into it.
* meson: drop repeated output in error messageZbigniew Jędrzejewski-Szmek2022-10-171-1/+0
|
* tree-wide: replace "plural(s)" by "plurals"Zbigniew Jędrzejewski-Szmek2022-10-171-1/+1
| | | | | | | | (s) is just ugly with a vibe of DOS. In most cases just using the normal plural form is more natural and gramatically correct. There are some log_debug() statements left, and texts in foreign licenses or headers. Those are not touched on purpose.
* uid-range: move to src/basic/Yu Watanabe2022-09-081-0/+2
| | | | To make the functions defined in the files usable by libsystemd library.
* meson: use files in run_command with relativized pathEli Schwartz2022-07-301-1/+1
| | | | | | | | | | | | Passing a file as a command argument in string form assumes that run_command has the current subdir as its cwd, but Meson's documentation *explicitly* calls this out as undefined and wrong to use. Indeed, muon has a different implementation that uses a different cwd, and this argument cannot be found. Instead, passing a files() object means that it's the job of meson itself to verify the file exists, then pass it to the run_command in some format that guarantees it is a valid path reference.
* math-util: introduce iszero_safe() and fp_equal()Yu Watanabe2022-07-211-0/+1
|
* basic/missing-syscalls: add PARISC (HPPA support)Sam James2022-06-281-0/+1
| | | | Bug: https://github.com/systemd/systemd/issues/23180
* Move basic/recovery-key.* to shared/Zbigniew Jędrzejewski-Szmek2022-06-021-2/+0
| | | | | No particular reason to have it in basic/. We should let homectl and other users share the single copy through libsystemd-shared.
* basic: move compress.[ch] → src/basic/Lennart Poettering2022-04-261-0/+18
| | | | | | | | | | | | The compression helpers are used both in journal code and in coredump code, and there's a good chance we'll use them later for other stuff. Let's hence move them into src/basic/, to make them a proper internal API we can use from everywhere where that's desirable. (pstore might be a candidate, for example) No real code changes, just some moving around, build system rearrangements, and stripping of journal-def.h inclusion.
* basic: split out dev_t related calls into new devno-util.[ch]Lennart Poettering2022-04-131-0/+2
| | | | | | | | | | | | | | No actual code changes, just splitting out of some dev_t handling related calls from stat-util.[ch], they are quite a number already, and deserve their own module now I think. Also, try to settle on the name "devnum" as the name for the concept, instead of "devno" or "dev" or "devid". "devnum" is the name exported in udev APIs, hence probably best to stick to that. (this just renames a few symbols to "devum", local variables are left untouched, to make the patch not too invasive) No actual code changes.
* meson: do not use split() in file listsZbigniew Jędrzejewski-Szmek2022-03-021-258/+257
| | | | | | | | | | | The approach to use '''…'''.split() instead of a list of strings was initially used when converting from automake because it allowed identical blocks of lines to be used for both, making the conversion easier. But over the years we have been using normal lists more and more, especially when there were just a few filenames listed. This converts the rest. No functional change.
* meson: Add check argument to remaining run_command() callsJan Janssen2022-01-111-1/+1
|
* meson: stop building out convenience libraries by defaultZbigniew Jędrzejewski-Szmek2021-12-161-2/+3
| | | | | | | | | | | | | | | | | The meson default for static_library() are: build_by_default=true, install=false. We never interact with the static libraries, and we only care about them as a stepping-stone towards the installable executables or libraries. Thus let's only build them if they are a dependency of something else we are building. While at it, let's drop install:false, since this appears to be the default. This change would have fixed the issue with lib_import_common failing to build too: we wouldn't attempt to build it. In practice this changes very little, because we generally only declare static libraries where there's something in the default target that will make use of them. But it seems to be a better pattern to set build_by_default to false.
* syscalls: add LoongArch 64bit syscallsXiaotian Wu2021-12-011-0/+1
|
* shared: split out ioprio related stuff into ioprio-util.[ch]Lennart Poettering2021-11-241-0/+2
| | | | No actual code changes, just some splitting out.
* filesystems: add internal APIs to convert fs magic to nameLennart Poettering2021-11-151-3/+13
| | | | | We previously had tooling for the opposite direction, let's complete the work.
* arphrd-util: rename arphrd-list.[ch] -> arphrd-util.[ch]Yu Watanabe2021-11-091-2/+2
|
* basic: remove khash helpersLuca Boccassi2021-10-081-2/+0
| | | | No longer used anywhere. So long, and thanks for all the hashes!
* basic: add hmac_sha256 implementationLuca Boccassi2021-10-081-0/+2
| | | | | | Based on the FIPS 198 specification. Not optimized and probably completely unsafe, to be used only for non-strong-cryptographic purposes when OpenSSL cannot be used.
* basic: add new recurse_dir() tool as replacement for nftw()Lennart Poettering2021-10-071-0/+2
| | | | | | | libc nftw() shows its age a bit, let's replace it with a more moden infra that is built around openat(), O_PATH, statx(). This makes the interface less prone to races and cleans up the API a bit adding substantially more functionality.
* basic: use filesystem databaseIago López Galeiras2021-10-061-0/+28
|
* basic: add filesystem databaseIago López Galeiras2021-10-061-0/+2
| | | | Stores filesystem_name -> magic_number(s).
* basic: spit out chase_symlinks() from fs-util.[ch] → chase-symlinks.[ch]Lennart Poettering2021-10-051-0/+2
|
* basic: split out inotify-related calls from fs-util.h → inotify-util.hLennart Poettering2021-10-051-0/+2
|
* basic: split out glyph/emoji related calls from locale-util.[ch] into ↵Lennart Poettering2021-10-051-0/+2
| | | | | | | | glyph-util.[ch] These functions are used pretty much independently of locale, i.e. the only info relevant is whether th locale is UTF-8 or not. Hence let's give this its own pair of .c/.h files.
* basic: split out sync() family of calls from fs-util.[ch] into new c/h fileLennart Poettering2021-10-051-0/+2
| | | | No changes in code, just some splitting out.
* basic: delete loadavg.h copyLuca Boccassi2021-09-251-1/+0
| | | | | | | | | | loadavg.h is an internal header of the Linux source repository, and as such it is licensed as GPLv2-only, without syscall exception. We use it only for 4 macros, which are simply doing some math calculations that cannot thus be subject to copyright. Reimplement the same calculations in another internal header and delete loadavg.h from our tree.
* Get rid of ioprio.h and add a minimalistic reimplementation of the apiZbigniew Jędrzejewski-Szmek2021-09-221-1/+1
|
* Drop bundled copy of linux/if_arp.hZbigniew Jędrzejewski-Szmek2021-09-211-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | As far as I can see, we use this to get a list of ARPHRD_* defines (used in particular for Type= in .link files). If we drop our copy, and build against old kernel headers, the user will have a shorter list of types available. This seems OK, and I don't think it's worth carrying our own version of this file just to have newest possible entries. 7c5b9952c4f6e2b72f90edbe439982528b7cf223 recently updated this file, but we'd have to update it every time the kernel adds new entries. But if we look at the failure carefully: src/basic/arphrd-from-name.gperf:65:16: error: ‘ARPHRD_MCTP’ undeclared (first use in this function); did you mean ‘ARPHRD_FCPP’? 65 | MCTP, ARPHRD_MCTP | ^~ | ARPHRD_FCPP we see that the list we were generating was from the system headers, so it was only as good as the system headers anyway, without the newer entries in our bundled copy, if there were any. So let's make things simpler by always using system headers. And if somebody wants to fix things so that we always have the newest list, then we should just generate and store the converted list, not the full header.
* basic/linux: add more bridge headersYu Watanabe2021-08-311-0/+2
|
* basic: copy genetlink.h to repositoryYu Watanabe2021-08-291-0/+1
|
* util: move src/basic/creds-util.[ch] → src/shared/Lennart Poettering2021-07-081-2/+0
| | | | | | | This is preparation for adding encryption support to the credentials logic, and we thus would like to add more deps. Let's hence move things from src/basic/ to src/shared, so that we can rely on the OpenSSL utilities already in src/shared.
* meson: drop libseccomp and libselinux from libbasic linkageZbigniew Jędrzejewski-Szmek2021-06-241-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This means libsystemd.so is without them now. This is important because countless programs link to libsystemd.so, and do not need to pull in selinux now. And libselinux.so pulls in libpcre2, so we trim a nice dependency tree. I'm not sure why libseccomp was listed there. No code seems to refer to it. $ diff -u <(ldd ../systemd/build/libsystemd.so|sed 's/0x.*/0x…/') <(ldd build/libsystemd.so|sed 's/0x.*/0x…/') @@ -4,11 +4,9 @@ libzstd.so.1 => /lib64/libzstd.so.1 (0x… liblz4.so.1 => /lib64/liblz4.so.1 (0x… libcap.so.2 => /lib64/libcap.so.2 (0x… - libselinux.so.1 => /lib64/libselinux.so.1 (0x… libgcrypt.so.20 => /lib64/libgcrypt.so.20 (0x… libpthread.so.0 => /lib64/libpthread.so.0 (0x… libc.so.6 => /lib64/libc.so.6 (0x… /lib64/ld-linux-x86-64.so.2 (0x… - libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x… libdl.so.2 => /lib64/libdl.so.2 (0x… libgpg-error.so.0 => /lib64/libgpg-error.so.0 (0x… $ diff -u <(ldd ../systemd/build/libudev.so|sed 's/0x.*/0x…/') <(ldd build/libudev.so|sed 's/0x.*/0x…/') @@ -1,8 +1,5 @@ linux-vdso.so.1 (0x… librt.so.1 => /lib64/librt.so.1 (0x… - libselinux.so.1 => /lib64/libselinux.so.1 (0x… libpthread.so.0 => /lib64/libpthread.so.0 (0x… libc.so.6 => /lib64/libc.so.6 (0x… /lib64/ld-linux-x86-64.so.2 (0x… - libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x… - libdl.so.2 => /lib64/libdl.so.2 (0x…
* basic,shared: move a bunch of files to src/shared/Zbigniew Jędrzejewski-Szmek2021-06-241-18/+0
| | | | | | | | | | | | The goal is to move everything that requires selinux or smack away from src/basic/. This means that src/basic/label.[ch] must move, which implies btrfs-util.[ch], copy.[ch], and a bunch of other files which form a cluster of internal use. This is just moving text around, so there should be no functional difference. test-blockdev-util is new, because path_is_encrypted() is moved to blockdev-util.c, and so far we didn't have any tests for code there.
* basic,shared: move dlopen helpers to shared/Zbigniew Jędrzejewski-Szmek2021-06-241-4/+1
| | | | | | | | This was added in 88d775b734644f26fb490836769c2bc275498fde, with the apparent intent of using in shared/ and the rest of our code. It doesn't matter much for our code, since libdl is part of glibc anyway, but moving it removes one linkage from libsystemd. (libshared was already linking to libdl explicitly).
* basic: move acquire_data_fd() and fd_duplicate_data_fd() to new data-fd-util.cZbigniew Jędrzejewski-Szmek2021-06-241-0/+2
| | | | | | | | | | | fd_duplicate_data_fd() is renamed to copy_data_fd(). This makes the two functions have nicely similar names. Now fd-util.[ch] is again about low-level file descriptor manipulations. copy_data_fd() is a complex function that internally wraps the other functions in copy.c. I want to move copy.c and the whole cluster of related code from basic/ to shared/ later on, and this is a preparatory step for that.
* basic,shared: move quota-util.[ch] to src/shared/Zbigniew Jędrzejewski-Szmek2021-06-241-2/+0
| | | | No need for this to in basic/.
* mount-util: make mount_flags_to_string() show flag name instead of numberYu Watanabe2021-06-211-0/+1
| | | | | This also adds missing MS_NOSYMFOLLOW flag. Moreover, this makes the function always add unhandled flags in number.
* syscalls: add riscv32Yu Watanabe2021-06-151-1/+3
|