Systemd/src/shared
Lennart Poettering d4dffb8533 dissect: introduce new recognizable partition types for /var and /var/tmp
This has been requested many times before. Let's add it finally.

GPT auto-discovery for /var is a bit more complex than for other
partition types: the other partitions can to some degree be shared
between multiple OS installations on the same disk (think: swap, /home,
/srv). However, /var is inherently something bound to an installation,
i.e. specific to its identity, or actually *is* its identity, and hence
something that cannot be shared.

To deal with this this new code is particularly careful when it comes to
/var: it will not mount things blindly, but insist that the UUID of the
partition matches a hashed version of the machine-id of the
installation, so that each installation has a very specific /var
associated with it, and would never use any other. (We actually use
HMAC-SHA256 on the GPT partition type for /var, keyed by the machine-id,
since machine-id is something we want to keep somewhat private).

Setting the right UUID for installations takes extra care. To make
things a bit simpler to set up, we avoid this safety check for nspawn
and RootImage= in unit files, under the assumption that such container
and service images unlikely will have multiple installations on them.
The check is hence only required when booting full machines, i.e. in
in systemd-gpt-auto-generator.

To help with putting together images for full machines, PR #14368
introduces a repartition tool that can automatically fill in correctly
calculated UUIDs on first boot if images have the var partition UUID
initialized to all zeroes. With that in place systems can be put
together in a way that on first boot the machine ID is determined and
the partition table automatically adjusted to have the /var partition
with the right UUID.
2019-12-23 14:43:59 +01:00
..
linux network: support matching based on wifi interfece type 2019-10-25 16:43:18 +09:00
acl-util.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
acl-util.h
acpi-fpdt.c
acpi-fpdt.h
apparmor-util.c
apparmor-util.h
ask-password-api.c shared/ask-password-api: modify keyctl break value 2019-11-28 08:58:29 +01:00
ask-password-api.h tty-ask-pwd-agent: move ask_password_plymouth() in ask-password-api.c 2019-10-05 08:08:24 +02:00
barrier.c
barrier.h
base-filesystem.c shared: be friendly to EROFS images 2019-04-03 17:27:20 +02:00
base-filesystem.h
bitmap.c shared/exit-status: use Bitmap instead of Sets 2019-07-29 15:54:53 +02:00
bitmap.h shared/exit-status: use Bitmap instead of Sets 2019-07-29 15:54:53 +02:00
blkid-util.h shared/blkid-util: do not include util.h needlessly 2018-12-07 02:49:03 +01:00
boot-timestamps.c util-lib: split shared/efivars into basic/efivars and shared/efi-loader 2019-09-16 18:08:53 +02:00
boot-timestamps.h
bootspec.c boot: Deduplicate old-style loader entries. 2019-11-21 15:50:03 -08:00
bootspec.h boot: Deduplicate old-style loader entries. 2019-11-21 15:50:03 -08:00
bpf-program.c tree-wide: drop missing.h 2019-10-31 17:57:03 +09:00
bpf-program.h bpf-firewall: custom BPF programs through IP(Ingress|Egress)FilterPath= 2019-06-25 09:56:16 +02:00
bus-unit-procs.c shared: no need to check result of strndupa() 2019-07-16 12:40:22 +02:00
bus-unit-procs.h bus-unit-util: split out code that shows a unit's process tree 2019-03-13 17:41:41 +01:00
bus-unit-util.c pid1: make TimeoutAbortSec settable for transient units 2019-11-27 13:56:29 +01:00
bus-unit-util.h bus-unit-util: split out code that shows a unit's process tree 2019-03-13 17:41:41 +01:00
bus-util.c core: do not propagate polkit error to caller 2019-11-15 08:17:01 +01:00
bus-util.h bus-util: convert bus_log_{parse,create}_error into defines 2019-07-29 15:54:53 +02:00
bus-wait-for-jobs.c shared: add some minor comments 2019-04-02 05:34:53 +09:00
bus-wait-for-jobs.h tree-wide: normalize includes of public headers 2019-11-28 09:14:22 +01:00
bus-wait-for-units.c shared: fix assert call 2019-07-17 11:35:04 +02:00
bus-wait-for-units.h shared: add generic logic for waiting for a unit to enter some state 2019-07-11 12:18:51 +02:00
calendarspec.c tree-wide: fix how we set $TZ 2019-11-13 12:30:22 +01:00
calendarspec.h
cgroup-setup.c tree-wide: drop double newline 2019-11-04 00:30:32 +09:00
cgroup-setup.h util-lib: move some functions from basic/cgroup-util to shared/cgroup-setup 2019-09-16 18:08:00 +02:00
cgroup-show.c cgls: visually separate processes from cgroups 2019-11-20 17:51:28 +01:00
cgroup-show.h Rework cmdline printing to use unicode 2019-05-22 10:08:17 +02:00
chown-recursive.c chown-recursive: add fd based API 2019-12-17 20:03:40 +01:00
chown-recursive.h chown-recursive: add fd based API 2019-12-17 20:03:40 +01:00
clean-ipc.c tree-wide: drop dirent.h when dirent-util.h is included 2019-11-04 00:30:32 +09:00
clean-ipc.h
clock-util.c util: split out errno related stuff 2019-03-14 13:25:51 +01:00
clock-util.h
condition.c tree-wide: drop stat.h or statfs.h when stat-util.h is included 2019-11-04 00:30:32 +09:00
condition.h Merge pull request #12030 from poettering/condition-memory 2019-04-02 08:01:42 +09:00
conf-parser.c udev: support AlternativeName= setting in .link file 2019-12-16 10:52:22 +09:00
conf-parser.h udev: support AlternativeName= setting in .link file 2019-12-16 10:52:22 +09:00
cpu-set-util.c Rename EXTRACT_QUOTES to EXTRACT_UNQUOTE 2019-06-28 11:35:05 +02:00
cpu-set-util.h core: introduce NUMAPolicy and NUMAMask options 2019-06-24 16:58:54 +02:00
crypt-util.c
crypt-util.h cryptsetup: bump minimum libcryptsetup version to v2.0.1 2019-10-01 13:34:06 +02:00
daemon-util.h sd-daemon: add notify_start() and notify_on_cleanup() helper function 2018-12-08 18:09:25 +09:00
dev-setup.c core: create inaccessible nodes for users when making runtime dirs 2019-12-18 11:09:30 -08:00
dev-setup.h
dissect-image.c dissect: introduce new recognizable partition types for /var and /var/tmp 2019-12-23 14:43:59 +01:00
dissect-image.h dissect: introduce new recognizable partition types for /var and /var/tmp 2019-12-23 14:43:59 +01:00
dm-util.c tree-wide: drop string.h when string-util.h or friends are included 2019-11-04 00:30:32 +09:00
dm-util.h dissect: split out DM deferred remove into src/shared/dm-util.c 2019-07-05 02:19:24 +09:00
dns-domain.c tree-wide: drop string.h when string-util.h or friends are included 2019-11-04 00:30:32 +09:00
dns-domain.h resolve: reject host names with leading or trailing dashes in /etc/hosts 2018-12-10 09:56:56 +01:00
dropin.c shared/dropin: fix assert for invalid drop-in 2019-12-18 08:43:40 +01:00
dropin.h basic/set: constify operations which don't modify Set 2019-07-19 16:51:14 +02:00
efi-loader.c shared/efi-loader: add some debugging statements 2019-12-15 21:06:42 +01:00
efi-loader.h util-lib: split shared/efivars into basic/efivars and shared/efi-loader 2019-09-16 18:08:53 +02:00
enable-mempool.c
env-file-label.c util-lib: split out env file parsing code into env-file.c 2018-12-02 13:22:29 +01:00
env-file-label.h util-lib: split out env file parsing code into env-file.c 2018-12-02 13:22:29 +01:00
ethtool-util.c udev: tiny update for log messages 2019-11-26 10:42:54 +01:00
ethtool-util.h tree-wide: drop double newline 2019-11-04 00:30:32 +09:00
exec-util.c core: add ExecStartXYZEx= with dbus support for executable prefixes 2019-05-30 20:41:42 -07:00
exec-util.h core: add ExecStartXYZEx= with dbus support for executable prefixes 2019-05-30 20:41:42 -07:00
exit-status.c shared/exit-status: fix off-by-one in comment 2019-08-05 16:38:20 +02:00
exit-status.h exit-status: rename EXIT_STATUS_GLIBC → EXIT_STATUS_LIBC 2019-07-29 19:05:25 +02:00
fdset.c tree-wide: drop alloca.h when alloc-util.h is included 2019-11-04 00:30:32 +09:00
fdset.h nspawn: don't free "fds" twice 2019-03-22 18:11:27 +01:00
fileio-label.c util-lib: split out env file parsing code into env-file.c 2018-12-02 13:22:29 +01:00
fileio-label.h util-lib: split out env file parsing code into env-file.c 2018-12-02 13:22:29 +01:00
firewall-util.c tree-wide: drop socket.h when socket-util.h is included 2019-11-04 00:30:32 +09:00
firewall-util.h
format-table.c shared/format-table: disable ellipsization when piped 2019-11-05 17:50:09 +01:00
format-table.h format-table: add UID/GID output support to format-table.h 2019-11-19 12:10:44 +01:00
fsck-util.h fsck: split out fsck return code definitions into a header file of its own 2019-07-05 02:31:12 +09:00
fstab-util.c core: swap priority can be negative 2019-12-04 08:57:08 +01:00
fstab-util.h Allow overriding /etc/fstab with $SYSTEMD_FSTAB 2019-11-13 22:04:51 +01:00
generate-ip-protocol-list.sh scripts: use 4 space indentation 2019-04-12 08:30:31 +02:00
generator.c cryptsetup-generator: unconfuse writing of the device timeout 2019-12-03 17:20:19 +01:00
generator.h Pull in systemd-remount-fs.service only when required 2019-01-03 15:30:28 +01:00
gpt.h dissect: introduce new recognizable partition types for /var and /var/tmp 2019-12-23 14:43:59 +01:00
id128-print.c id128: drop "MESSAGE_" prefix of pretty output 2019-11-15 19:07:05 +01:00
id128-print.h id128: add new "-u" switch for outputting Ids in UUID format 2019-11-15 19:07:05 +01:00
ima-util.c
ima-util.h
import-util.c tree-wide: drop string.h when string-util.h or friends are included 2019-11-04 00:30:32 +09:00
import-util.h
initreq.h
install-printf.c tree-wide: drop string.h when string-util.h or friends are included 2019-11-04 00:30:32 +09:00
install-printf.h Mark *data and *userdata params to specifier_printf() as const 2018-12-12 16:45:33 +01:00
install.c shared/install: log syntax error for invalid DefaultInstance= 2019-12-16 14:19:49 +01:00
install.h Create src/shared/unit-file.[ch] for unit-file related ops 2019-07-19 16:51:14 +02:00
ip-protocol-list.c ip-protocol-list: sort headers 2018-12-04 09:18:21 +01:00
ip-protocol-list.h
ip-protocol-to-name.awk
journal-importer.c tree-wide: drop duplicated blank lines 2019-07-15 18:41:27 +02:00
journal-importer.h tree-wide: normalize includes of public headers 2019-11-28 09:14:22 +01:00
journal-util.c codespell: fix spelling errors 2019-04-29 16:47:18 +02:00
journal-util.h
json-internal.h
json.c json: add new output flag JSON_PRETTY_AUTO 2019-12-02 09:47:00 +01:00
json.h json: add new output flag JSON_PRETTY_AUTO 2019-12-02 09:47:00 +01:00
libmount-util.h shared/mount-util: make sure utab is ignored in umount_recursive() 2019-04-23 23:52:15 +02:00
libshared.sym
local-addresses.c local-addresses: filter out any routing tables but the main one 2019-07-24 09:07:30 +02:00
local-addresses.h netlink: move local-addresses.[ch] to src/shared 2019-07-24 09:06:50 +02:00
lockfile-util.c lockfile-util.c: fix build without F_OFD_SETLK 2019-01-11 17:37:36 +01:00
lockfile-util.h lockfile: drop unnecessary headers from lockfile-util.h 2018-12-06 13:31:16 +01:00
log-link.h tree-wide: use PROJECT_FILE instead of __FILE__ 2019-07-04 10:36:00 +02:00
logs-show.c tree-wide: use SD_ID128_STRING_MAX where appropriate 2019-12-10 11:56:18 +01:00
logs-show.h
loop-util.c shared/loop-util: rename function 2019-12-18 08:48:33 +01:00
loop-util.h shared/loop-util: rename function 2019-12-18 08:48:33 +01:00
machine-image.c dissect: introduce new recognizable partition types for /var and /var/tmp 2019-12-23 14:43:59 +01:00
machine-image.h
machine-pool.c tree-wide: drop stat.h or statfs.h when stat-util.h is included 2019-11-04 00:30:32 +09:00
machine-pool.h
main-func.h main-func: send main exit code to parent via sd_notify() on exit 2019-12-04 10:59:59 +01:00
meson.build chown-recursive: move src/core/chown-recursive.[ch] → src/shared/ 2019-12-17 20:03:40 +01:00
module-util.c shared: small typo 2019-10-28 21:39:55 +01:00
module-util.h
mount-util.c core: create inaccessible nodes for users when making runtime dirs 2019-12-18 11:09:30 -08:00
mount-util.h core: create inaccessible nodes for users when making runtime dirs 2019-12-18 11:09:30 -08:00
nscd-flush.c codespell: fix spelling errors 2019-04-29 16:47:18 +02:00
nscd-flush.h shared: add helper for flushing nscd caches 2018-12-15 12:10:19 +01:00
nsflags.c util: drop missing.h from socket-util.h 2018-12-06 13:31:16 +01:00
nsflags.h nsflsgs: drop missing.h and use missing_sched.h 2018-12-06 13:31:16 +01:00
openssl-util.h Make openssl dependency optional again 2019-12-18 11:24:44 +01:00
os-util.c basic/fs-util: change CHASE_OPEN flag into a separate output parameter 2019-10-24 22:44:24 +09:00
os-util.h
output-mode.c output-mode: add generic helper to pick right JsonFormatFlags for given OutputMode 2018-12-03 22:42:38 +01:00
output-mode.h output-mode: add new helper OUTPUT_MODE_IS_JSON() 2018-12-03 22:42:38 +01:00
pager.c tree-wide: drop signal.h when signal-util.h is included 2019-11-04 00:30:32 +09:00
pager.h
path-lookup.c tree-wide: drop string.h when string-util.h or friends are included 2019-11-04 00:30:32 +09:00
path-lookup.h core: stop removing non-existent and duplicate lookup paths 2019-08-27 18:12:20 +02:00
pe-header.h bootspec: also look for boot loader spec type 2 entries (i.e. unified kernel images) 2019-03-01 12:41:32 +01:00
pkcs11-util.c shared: add pkcs11-util.[ch] 2019-12-09 19:25:25 +01:00
pkcs11-util.h Make openssl dependency optional again 2019-12-18 11:24:44 +01:00
pretty-print.c analyze: make cat-config work with relabel-extra.d 2019-08-19 10:20:01 +02:00
pretty-print.h
ptyfwd.c
ptyfwd.h tree-wide: add whitespace between type and variable name 2018-12-04 09:29:54 +01:00
reboot-util.c util-lib: move shall_restore_state() to shared/reboot-util 2019-09-16 18:08:01 +02:00
reboot-util.h util-lib: move shall_restore_state() to shared/reboot-util 2019-09-16 18:08:01 +02:00
resize-fs.c growfs: port over to resize_fs() 2019-12-05 10:15:49 +01:00
resize-fs.h growfs: port over to resize_fs() 2019-12-05 10:15:49 +01:00
resolve-util.c resolved: switch cache option to a tri-state option (systemd#5552). 2019-07-17 10:42:53 -04:00
resolve-util.h resolved: switch cache option to a tri-state option (systemd#5552). 2019-07-17 10:42:53 -04:00
seccomp-util.c shared/seccomp: avoid possibly writing bogus errno code in debug log 2019-12-06 15:12:40 +01:00
seccomp-util.h shared: Add ProtectKernelLogs property 2019-11-11 12:11:56 -08:00
securebits-util.c Rename EXTRACT_QUOTES to EXTRACT_UNQUOTE 2019-06-28 11:35:05 +02:00
securebits-util.h missing: rename securebits.h to missing_securebits.h 2018-12-04 07:49:24 +01:00
serialize.c tree-wide: drop mman.h when missing_mman.h is included 2019-11-04 00:30:32 +09:00
serialize.h util-lib: move yes_no() and friends to string-util.h 2019-09-16 18:06:20 +02:00
sleep-config.c shared/sleep-config: fix potential SEGV 2019-11-09 09:19:36 +00:00
sleep-config.h systemd-sleep: always prefer resume device or file 2019-10-24 07:38:24 -07:00
spawn-ask-password-agent.c ask-password-agent: introduce ask_password_agent_open_if_enabled() 2019-11-15 11:11:52 +01:00
spawn-ask-password-agent.h ask-password-agent: introduce ask_password_agent_open_if_enabled() 2019-11-15 11:11:52 +01:00
spawn-polkit-agent.c polkit-agent: don't use an inline function 2019-11-15 11:11:14 +01:00
spawn-polkit-agent.h polkit-agent: don't use an inline function 2019-11-15 11:11:14 +01:00
specifier.c tree-wide: drop string.h when string-util.h or friends are included 2019-11-04 00:30:32 +09:00
specifier.h Mark *data and *userdata params to specifier_printf() as const 2018-12-12 16:45:33 +01:00
switch-root.c tree-wide: drop stdio.h when stdio-util.h is included 2019-11-04 00:30:32 +09:00
switch-root.h
sysctl-util.c tree-wide: drop string.h when string-util.h or friends are included 2019-11-04 00:30:32 +09:00
sysctl-util.h sysctl: add sysctl_writef() helper 2019-07-13 11:05:07 +02:00
test-tables.h
tests.c tests: modify enter_cgroup_subroot() to return the new path 2019-11-11 14:55:57 +01:00
tests.h tests: modify enter_cgroup_subroot() to return the new path 2019-11-11 14:55:57 +01:00
tmpfile-util-label.c
tmpfile-util-label.h
tomoyo-util.c
tomoyo-util.h
udev-util.c udev: warn when we fail to parse udev.conf 2019-07-04 10:36:19 +02:00
udev-util.h util: make device_wait_for_initialization() optionally takes timeout value 2019-06-04 01:19:43 +09:00
uid-range.c util: split out sorting related calls to new sort-util.[ch] 2019-03-13 12:16:43 +01:00
uid-range.h
unit-file.c basic/fs-util: change CHASE_OPEN flag into a separate output parameter 2019-10-24 22:44:24 +09:00
unit-file.h util-lib: move runlevel_to_target() to shared/unit-file 2019-09-16 18:08:00 +02:00
utmp-wtmp.c tree-wide: drop string.h when string-util.h or friends are included 2019-11-04 00:30:32 +09:00
utmp-wtmp.h
varlink.c varlink: add varlink_close_unref() helper 2019-12-17 20:05:46 +01:00
varlink.h varlink: add varlink_close_unref() helper 2019-12-17 20:05:46 +01:00
verbs.c tree-wide: drop string.h when string-util.h or friends are included 2019-11-04 00:30:32 +09:00
verbs.h shared/verbs: drop now-unused VERB_MUST_BE_ROOT 2019-05-08 11:51:51 +02:00
vlan-util.c network: re-implement parse_vid_range() 2019-07-05 16:35:06 +09:00
vlan-util.h network: re-implement parse_vid_range() 2019-07-05 16:35:06 +09:00
volatile-util.c volatile-util: tweak query_volatile_mode() a bit 2019-03-01 14:11:07 +01:00
volatile-util.h nspawn: add --volatile=overlay support 2019-03-01 14:11:06 +01:00
watchdog.c shared/watchdog: close watchdog device when done with it 2019-08-20 21:15:13 +02:00
watchdog.h
web-util.c
web-util.h
wifi-util.c network: support matching based on wifi interfece type 2019-10-25 16:43:18 +09:00
wifi-util.h network: support matching based on wifi interfece type 2019-10-25 16:43:18 +09:00
xml.c tree-wide: drop string.h when string-util.h or friends are included 2019-11-04 00:30:32 +09:00
xml.h