xref: /linux/Documentation/userspace-api/liveupdate.rst (revision 959393e81cf1fe7f2a75d639b90cd7c816103f25)
1.. SPDX-License-Identifier: GPL-2.0
2
3================
4Live Update uAPI
5================
6:Author: Pasha Tatashin <pasha.tatashin@soleen.com>
7
8ioctl interface
9===============
10.. kernel-doc:: kernel/liveupdate/luo_core.c
11   :doc: LUO ioctl Interface
12
13ioctl uAPI
14===========
15.. kernel-doc:: include/uapi/linux/liveupdate.h
16
17Note on Compatibility
18=====================
19
20Note that the Live Update feature is still under development and subject to
21change, so compatibility is not guaranteed when kexec rebooting between
22different kernel versions. This is expected to change and stabilize in a future
23version.
24
25Userspace Integration
26=====================
27
28systemd (since version v261) uses LUO to preserve its per-service file
29descriptor store across a kexec-based live update. Services opt in by setting
30``FileDescriptorStoreMax=`` and ``FileDescriptorStorePreserve=`` in their unit,
31and push file descriptors with a name into the store via
32``sd_pid_notify_with_fds(... "FDSTORE=1\nFDNAME=foo")``.
33
34Services may also create their own LUO sessions (via ``/dev/liveupdate``) and
35push the resulting session fds into their file descriptor store like any other
36fd. systemd detects such session fds and handles them accordingly, and
37hands the re-retrieved session fd back to the service after kexec, using the
38existing file descriptor store service interface.
39
40For details, see:
41
42- `File Descriptor Store <https://systemd.io/FILE_DESCRIPTOR_STORE/>`_
43- `systemd.service(5) FileDescriptorStorePreserve=
44  <https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html#FileDescriptorStorePreserve=>`_
45- `sd_pid_notify_with_fds(3)
46  <https://www.freedesktop.org/software/systemd/man/latest/sd_pid_notify_with_fds.html>`_
47
48See Also
49========
50
51- :doc:`Live Update Orchestrator </core-api/liveupdate>`
52