diff --git a/README b/README index 109c093a6c..f75fb9d5a5 100644 --- a/README +++ b/README @@ -207,7 +207,7 @@ REQUIREMENTS: python-jinja2 python-lxml (optional, required to build the indices) python >= 3.5 - meson >= 0.53.2 (>= 0.54.0 is required to build with 'meson compile') + meson >= 0.53.2 ninja gcc, awk, sed, grep, and similar tools clang >= 10.0, llvm >= 10.0 (optional, required to build BPF programs @@ -225,7 +225,7 @@ REQUIREMENTS: polkit (optional) To build in directory build/: - meson setup build/ && meson compile -C build/ + meson setup build/ && ninja -C build/ Any configuration options can be specified as -Darg=value... arguments to meson. After the build directory is initially configured, meson will @@ -235,13 +235,13 @@ REQUIREMENTS: their current values. Useful commands: - meson compile -v -C build/ some/target + ninja -C build -v some/target meson test -C build/ sudo meson install -C build/ DESTDIR=... meson install -C build/ A tarball can be created with: - git archive --format=tar --prefix=systemd-222/ v222 | xz > systemd-222.tar.xz + v=250 && git archive --prefix=systemd-$v/ v$v | zstd >systemd-$v.tar.zstd When systemd-hostnamed is used, it is strongly recommended to install nss-myhostname to ensure that, in a world of diff --git a/docs/CODE_QUALITY.md b/docs/CODE_QUALITY.md index b1f7dd109e..29dfdd8ae0 100644 --- a/docs/CODE_QUALITY.md +++ b/docs/CODE_QUALITY.md @@ -38,18 +38,19 @@ available functionality: `./tools/find-tabs.sh recpatch` to fix them. (Again, grain of salt, foreign headers should usually be left unmodified.) -6. Use `meson compile -C build check-api-docs` to compare the list of exported - symbols of `libsystemd.so` and `libudev.so` with the list of man pages. Symbols +6. Use `ninja -C build check-api-docs` to compare the list of exported symbols + of `libsystemd.so` and `libudev.so` with the list of man pages. Symbols lacking documentation are highlighted. -7. Use `meson compile -C build update-hwdb` to automatically download and import the - PCI, USB and OUI databases into hwdb. +7. Use `ninja -C build update-hwdb` and `ninja -C build update-hwdb-autosuspend` + to automatically download and import the PCI, USB, and OUI databases and the + autosuspend quirks into the hwdb. -8. Use `meson compile -C build update-man-rules` to update the meson rules for - building man pages automatically from the docbook XML files included in - `man/`. +8. Use `ninja -C build update-man-rules` to update the meson rules for building + man pages automatically from the docbook XML files included in `man/`. -9. There are multiple CI systems in use that run on every github PR submission. +9. There are multiple CI systems in use that run on every github pull request + submission or update. 10. [Coverity](https://scan.coverity.com/) is analyzing systemd `main` branch in regular intervals. The reports are available diff --git a/docs/HACKING.md b/docs/HACKING.md index 4b334715c7..f6b42297e0 100644 --- a/docs/HACKING.md +++ b/docs/HACKING.md @@ -95,16 +95,16 @@ for systemd: # available there or from the github repository otherwise) $ git clone https://github.com/systemd/systemd.git $ cd systemd -$ git checkout -b # where BRANCH is the name of the branch -$ vim src/core/main.c # or wherever you'd like to make your changes -$ meson build # configure the build -$ meson compile -C build # build it locally, see if everything compiles fine -$ meson test -C build # run some simple regression tests -$ sudo mkosi # build a test image -$ sudo mkosi boot # boot up the test image -$ git add -p # interactively put together your patch -$ git commit # commit it -$ git push -u # where REMOTE is your "fork" on GitHub +$ git checkout -b # where BRANCH is the name of the branch +$ vim src/core/main.c # or wherever you'd like to make your changes +$ meson build # configure the build +$ ninja -C build # build it locally, see if everything compiles fine +$ meson test -C build # run some simple regression tests +$ sudo mkosi # build a test image +$ sudo mkosi boot # boot up the test image +$ git add -p # interactively put together your patch +$ git commit # commit it +$ git push -u # where REMOTE is your "fork" on GitHub ``` And after that, head over to your repo on GitHub and click "Compare & pull request" diff --git a/docs/RELEASE.md b/docs/RELEASE.md index c5da09b62c..4a1f394aee 100644 --- a/docs/RELEASE.md +++ b/docs/RELEASE.md @@ -8,17 +8,18 @@ SPDX-License-Identifier: LGPL-2.1-or-later # Steps to a Successful Release 1. Add all items to NEWS -2. Update the contributors list in NEWS (`meson compile -C build git-contrib`) +2. Update the contributors list in NEWS (`ninja -C build git-contrib`) 3. Update the time and place in NEWS -4. Update hwdb (`meson compile -C build update-hwdb update-hwdb-autosuspend`) -5. [RC1] Update version and library numbers in `meson.build` -6. Check dbus docs with `meson compile -C build update-dbus-docs` -7. Tag the release: `version=vXXX-rcY && git tag -s "${version}" -m "systemd ${version}"` -8. Do `meson compile -C build` -9. Make sure that the version string and package string match: `build/systemctl --version` -10. Upload the documentation: `meson compile -C build doc-sync` -11. [FINAL] Close the github milestone and open a new one (https://github.com/systemd/systemd/milestones) -12. "Draft" a new release on github (https://github.com/systemd/systemd/releases/new), mark "This is a pre-release" if appropriate. -13. Check that announcement to systemd-devel, with a copy&paste from NEWS, was sent. This should happen automatically. -14. Update IRC topic (`/msg chanserv TOPIC #systemd Version NNN released`) -15. [FINAL] Push commits to stable, create an empty -stable branch: `git push systemd-stable --atomic origin/main:main origin/main:refs/heads/${version}-stable`, and change the default branch to latest release (https://github.com/systemd/systemd-stable/settings/branches). +4. Update hwdb (`ninja -C build update-hwdb`, `ninja -C build update-hwdb-autosuspend`, commit separately). +5. Update syscall numbers (`ninja -C build update-syscall-tables update-syscall-headers`). +6. [RC1] Update version and library numbers in `meson.build` +7. Check dbus docs with `ninja -C build update-dbus-docs` +8. Tag the release: `version=vXXX-rcY && git tag -s "${version}" -m "systemd ${version}"` +9. Do `ninja -C build` +10. Make sure that the version string and package string match: `build/systemctl --version` +11. Upload the documentation: `ninja -C build doc-sync` +12. [FINAL] Close the github milestone and open a new one (https://github.com/systemd/systemd/milestones) +13. "Draft" a new release on github (https://github.com/systemd/systemd/releases/new), mark "This is a pre-release" if appropriate. +14. Check that announcement to systemd-devel, with a copy&paste from NEWS, was sent. This should happen automatically. +15. Update IRC topic (`/msg chanserv TOPIC #systemd Version NNN released`) +16. [FINAL] Push commits to stable, create an empty -stable branch: `git push systemd-stable --atomic origin/main:main origin/main:refs/heads/${version}-stable`, and change the default branch to latest release (https://github.com/systemd/systemd-stable/settings/branches). diff --git a/docs/TRANSLATORS.md b/docs/TRANSLATORS.md index 135f35793b..58708bcd58 100644 --- a/docs/TRANSLATORS.md +++ b/docs/TRANSLATORS.md @@ -27,7 +27,7 @@ To create a translation to a language not yet available, start by creating the initial template: ``` -$ meson compile -C build/ systemd-pot +$ ninja -C build/ systemd-pot ``` This will generate file `po/systemd.pot` in the source tree. @@ -51,7 +51,7 @@ using the `poedit` GUI editor.) Start by updating the `*.po` files from the latest template: ``` -$ meson compile -C build/ systemd-update-po +$ ninja -C build/ systemd-update-po ``` This will touch all the `*.po` files, so you'll want to pay attention when @@ -75,7 +75,7 @@ using `git checkout -- po/` after you commit the changes you do want to keep.) You can recompile the `*.po` files using the following command: ``` -$ meson compile -C build/ systemd-gmo +$ ninja -C build/ systemd-gmo ``` The resulting files will be saved in the `build/po/` directory. diff --git a/man/libudev.xml b/man/libudev.xml index 4b87962fc0..8632ea9420 100644 --- a/man/libudev.xml +++ b/man/libudev.xml @@ -37,8 +37,10 @@ Description - libudev.h provides APIs to introspect - and enumerate devices on the local system. + libudev.h provides an API to introspect and enumerate devices on the local + system. This library is supported, but should not be used in new projects. Please see + sd-device3 for an + equivalent replacement with a more modern API. All functions require a libudev context to operate. This context can be create via diff --git a/man/os-release.xml b/man/os-release.xml index 7e3e9a73a8..875ac946f0 100644 --- a/man/os-release.xml +++ b/man/os-release.xml @@ -117,7 +117,7 @@ change between the build and the deployment phases, it is possible to relax this check: if exactly one file whose name matches extension-release.* is present in this directory, and the file is tagged with a user.extension-release.strict - xattr7 set to the + xattr7 set to the string 0, it will be used instead. The rest of this document that talks about os-release should be understood @@ -499,14 +499,14 @@ VERSION_ID=32 Reading <filename>os-release</filename> in - <citerefentry><refentrytitle>sh</refentrytitle><manvolnum>1</manvolnum></citerefentry> + sh1 Reading <filename>os-release</filename> in - <citerefentry><refentrytitle>python</refentrytitle><manvolnum>1</manvolnum></citerefentry> (versions >= 3.10) + python1 (versions >= 3.10) @@ -517,7 +517,7 @@ VERSION_ID=32 Reading <filename>os-release</filename> in - <citerefentry><refentrytitle>python</refentrytitle><manvolnum>1</manvolnum></citerefentry> (any version) + python1 (any version) diff --git a/man/rules/meson.build b/man/rules/meson.build index add28a724c..55376c0ecc 100644 --- a/man/rules/meson.build +++ b/man/rules/meson.build @@ -117,6 +117,7 @@ manpages = [ 'SD_NOTICE', 'SD_WARNING'], ''], + ['sd-device', '3', [], ''], ['sd-event', '3', [], ''], ['sd-hwdb', '3', [], ''], ['sd-id128', @@ -515,6 +516,7 @@ manpages = [ 'sd_device_get_sysname', 'sd_device_get_sysnum'], ''], + ['sd_device_ref', '3', ['sd_device_unref', 'sd_device_unrefp'], ''], ['sd_event_add_child', '3', ['sd_event_add_child_pidfd', diff --git a/man/sd-device.xml b/man/sd-device.xml new file mode 100644 index 0000000000..7af839b4bd --- /dev/null +++ b/man/sd-device.xml @@ -0,0 +1,62 @@ + + + + + + + + sd-device + systemd + + + + sd-device + 3 + + + + sd-device + API for enumerating and introspecting local devices + + + + + #include <systemd/sd-device.h> + + + + pkg-config --cflags --libs libsystemd + + + + + + Description + + sd-device.h provides an API to introspect and enumerate devices on the local + system. It provides a programmatic interface to the database of devices and their properties mananaged by + systemd-udevd.service8. + This API is a replacement for + libudev3 and + libudev.h. + + See + sd_device_get_syspath3, +sd_device_ref3 + + for more information about the functions available. + + + + + + See Also + + systemd1, + sd-event3, + udevadm8 + + + + diff --git a/man/sd_bus_message_new.xml b/man/sd_bus_message_new.xml index 4907c5a755..c56df615a6 100644 --- a/man/sd_bus_message_new.xml +++ b/man/sd_bus_message_new.xml @@ -99,14 +99,13 @@ sd_bus_message_set_allow_interactive_authorization3. - sd_bus_message_ref() increases the reference counter of + sd_bus_message_ref() increases the internal reference counter of m by one. - sd_bus_message_unref() decreases the reference counter of + sd_bus_message_unref() decreases the internal reference counter of m by one. Once the reference count has dropped to zero, message object is - destroyed and cannot be used anymore, so further calls to - sd_bus_message_ref() or sd_bus_message_unref() are - illegal. + destroyed and cannot be used anymore, so further calls to sd_bus_message_ref() or + sd_bus_message_unref() are illegal. sd_bus_message_unrefp() is similar to sd_bus_message_unref() but takes a pointer to a diff --git a/man/sd_bus_new.xml b/man/sd_bus_new.xml index 355b34bad8..41964640b6 100644 --- a/man/sd_bus_new.xml +++ b/man/sd_bus_new.xml @@ -109,7 +109,7 @@ pointer to an sd_bus object. This call is useful in conjunction with GCC's and LLVM's Clean-up - Variable Attribute. Note that this function is defined as + Variable Attribute. Note that this function is defined as an inline function. Use a declaration like the following, in order to allocate a bus object that is freed automatically as the code block is left: @@ -124,12 +124,10 @@ … } - sd_bus_ref() and sd_bus_unref() - execute no operation if the passed in bus object address is - NULL. sd_bus_unrefp() will first - dereference its argument, which must not be NULL, and will - execute no operation if that is NULL. - + sd_bus_ref() and sd_bus_unref() execute no operation if + the argument is NULL. sd_bus_unrefp() will first dereference + its argument, which must not be NULL, and will execute no operation if + that is NULL. sd_bus_close_unref() is similar to sd_bus_unref(), but first executes diff --git a/man/sd_bus_slot_ref.xml b/man/sd_bus_slot_ref.xml index c200bc4a5a..8ada3cbcf1 100644 --- a/man/sd_bus_slot_ref.xml +++ b/man/sd_bus_slot_ref.xml @@ -46,10 +46,10 @@ Description - sd_bus_slot_ref() increases the reference counter of + sd_bus_slot_ref() increases the internal reference counter of slot by one. - sd_bus_slot_unref() decreases the reference counter of + sd_bus_slot_unref() decreases the internal reference counter of slot by one. Once the reference count has dropped to zero, slot object is destroyed and cannot be used anymore, so further calls to sd_bus_slot_ref() or sd_bus_slot_unref() are illegal. diff --git a/man/sd_device_ref.xml b/man/sd_device_ref.xml new file mode 100644 index 0000000000..c2ba6b1571 --- /dev/null +++ b/man/sd_device_ref.xml @@ -0,0 +1,83 @@ + + + + + + + sd_device_ref + systemd + + + + sd_device_ref + 3 + + + + sd_device_ref + sd_device_unref + sd_device_unrefp + + Create or destroy references to a device object + + + + + #include <systemd/sd-device.h> + + + sd_device* sd_device_ref + sd_device *device + + + + sd_device* sd_device_unref + sd_device *device + + + + void sd_device_unrefp + sd_device **device + + + + sd_device_ref() increases the internal reference counter of + device by one. + + sd_device_unref() decreases the internal reference counter of + device by one. Once the reference count has dropped to zero, + device is destroyed and cannot be used anymore, so further calls to + sd_device_ref() or sd_device_unref() are illegal. + + sd_device_unrefp() is similar to sd_device_unref() but + takes a pointer to a pointer to an sd_device object. This call is useful in conjunction with + GCC's and LLVM's Clean-up + Variable Attribute. Note that this function is defined as an inline function. Use a declaration + like the following, in order to allocate a device object that is freed automatically as the code block is + left: + + { + __attribute__((cleanup(sd_device_unrefp))) sd_device *device = NULL; + int r; + … + r = sd_device_new_from_syspath(&device, "…"); + if (r < 0) + fprintf(stderr, "Failed to allocate device: %s\n", strerror(-r)); + … +} + + sd_device_ref() and sd_device_unref() execute no + operation if the argument is NULL. sd_device_unrefp() will + first dereference its argument, which must not be NULL, and will execute no + operation if that is NULL. + + + + Return Value + + sd_device_ref() always returns the argument, and + sd_device_unref() always returns NULL. + + + diff --git a/man/sd_event_source_unref.xml b/man/sd_event_source_unref.xml index a7699e3547..b626e4cf4a 100644 --- a/man/sd_event_source_unref.xml +++ b/man/sd_event_source_unref.xml @@ -59,16 +59,13 @@ Description - sd_event_source_unref() may be used to - decrement by one the reference counter of the event source object - specified as source. The reference counter - is initially set to one, when the event source is created with calls - such as - sd_event_add_io3 - or + sd_event_source_unref() may be used to decrement by one the internal reference + counter of the event source object specified as source. The reference counter is + initially set to one, when the event source is created with calls such as + sd_event_add_io3 or sd_event_add_time3. When - the reference counter reaches zero it is removed from its event loop - object and destroyed. + the reference counter reaches zero, the object is detached from the event loop object and destroyed. + sd_event_source_unrefp() is similar to sd_event_source_unref() but takes a pointer to a @@ -78,9 +75,8 @@ Variable Attribute. Note that this function is defined as inline function. - sd_event_source_ref() may be used - to increase by one the reference counter of the event source object - specified as source. + sd_event_source_ref() may be used to increase by one the internal reference + counter of the event source object specified as source. sd_event_source_unref(), sd_bus_creds_unrefp() and diff --git a/man/systemd-cryptenroll.xml b/man/systemd-cryptenroll.xml index 02f932edfb..3b235fd9c9 100644 --- a/man/systemd-cryptenroll.xml +++ b/man/systemd-cryptenroll.xml @@ -314,8 +314,8 @@ its configuration. The lockout mechanism is a global property of the TPM, systemd-cryptenroll does not control or configure the lockout mechanism. You may use tpm2-tss tools to inspect or configure the dictionary attack lockout, with - tpm2_getcap1 and - tpm2_dictionarylockout1 + tpm2_getcap1 and + tpm2_dictionarylockout1 commands, respectively. diff --git a/man/systemd-integritysetup@.service.xml b/man/systemd-integritysetup@.service.xml index ade5663c28..a47ee4af1a 100644 --- a/man/systemd-integritysetup@.service.xml +++ b/man/systemd-integritysetup@.service.xml @@ -33,8 +33,9 @@ protected block devices. It should be instantiated for each device that requires integrity protection. - At early boot and when the system manager configuration is reloaded, entries from /etc/integritytab are converted into - systemd-integritysetup@.service units by + At early boot and when the system manager configuration is reloaded, entries from + integritytab5 are + converted into systemd-integritysetup@.service units by systemd-integritysetup-generator8. systemd-integritysetup@.service calls systemd-integritysetup. @@ -57,7 +58,7 @@ Create a block device volume using device. See - systemd-integritytab5 + integritytab5 and Kernel dm-integrity documentation for details. diff --git a/man/systemd-run.xml b/man/systemd-run.xml index 66ac26c5f8..ab1fb82567 100644 --- a/man/systemd-run.xml +++ b/man/systemd-run.xml @@ -479,7 +479,7 @@ Dec 08 20:44:48 container systemd[1]: Started /bin/touch /tmp/foo. Allowing access to the tty - The following command invokes bash1 + The following command invokes bash1 as a service passing its standard input, output and error to the calling TTY. # systemd-run -t --send-sighup bash diff --git a/man/systemd-stub.xml b/man/systemd-stub.xml index f2d3b91e20..3a8fc925d7 100644 --- a/man/systemd-stub.xml +++ b/man/systemd-stub.xml @@ -178,7 +178,7 @@ Assembling Kernel Images In order to assemble an UEFI PE kernel image from various components as described above, use an - objcopy1 command line + objcopy1 command line like this: objcopy \ @@ -196,7 +196,7 @@ UEFI boot stub. To then sign the resulting image for UEFI SecureBoot use an - sbsign1 command like + sbsign1 command like the following: sbsign \ @@ -219,8 +219,8 @@ systemd-sysext8, Boot Loader Specification, Boot Loader Interface, - objcopy1, - sbsign1 + objcopy1, + sbsign1 diff --git a/man/systemd-sysusers.xml b/man/systemd-sysusers.xml index 3ad8135dcd..7da7b18dcf 100644 --- a/man/systemd-sysusers.xml +++ b/man/systemd-sysusers.xml @@ -184,7 +184,7 @@ for the first time, it may not be used for changing the password or shell of an account that already exists. - Use mkpasswd1 + Use mkpasswd1 for generating UNIX password hashes from the command line. @@ -202,7 +202,7 @@ sysusers.d5, Users, Groups, UIDs and GIDs on systemd systems, systemd.exec1, - mkpasswd1 + mkpasswd1 diff --git a/man/systemd.netdev.xml b/man/systemd.netdev.xml index 0ba3c85521..ace1dc6336 100644 --- a/man/systemd.netdev.xml +++ b/man/systemd.netdev.xml @@ -2134,7 +2134,7 @@ RoutingAlgorithm= This can be either batman-v or batman-iv and describes which routing_algo - of batctl8 to use. The algorithm + of batctl8 to use. The algorithm cannot be changed after interface creation. Defaults to batman-v. diff --git a/man/udevadm.xml b/man/udevadm.xml index 5994abde8e..b327a4ef7e 100644 --- a/man/udevadm.xml +++ b/man/udevadm.xml @@ -800,7 +800,7 @@ does not probe a block device while changes are made to it, for example partitions created or file systems formatted. Note that many tools that interface with block devices natively support taking relevant locks, see for example - sfdisk8's + sfdisk8's switch. The command expects at least one block device specified via or