summaryrefslogtreecommitdiff
path: root/docs/ENVIRONMENT.md
diff options
context:
space:
mode:
authorKairui Song <kasong@redhat.com>2021-01-13 00:04:53 +0800
committerKairui Song <kasong@redhat.com>2021-01-14 01:19:09 +0800
commit1f22621ba33f8089d2ae5fbcaf8b3970dd68aaf0 (patch)
tree531e245c979a1550c133949ecf903a88d06ca707 /docs/ENVIRONMENT.md
parent96cceb35e7985f5ee6c9b17e129a76259273cdde (diff)
downloadsystemd-1f22621ba33f8089d2ae5fbcaf8b3970dd68aaf0.tar.gz
initrd: extend SYSTEMD_IN_INITRD to accept non-ramfs rootfs
Sometimes, non-ramfs initrd root are useful. Eg, for kdump, because initramfs is memory consuming, so mount a compressed image in earlier initrd, chroot into it then let systemd do the rest of job is a good solution. But systemd doesn't recognize the initrd environment if rootfs is not a temporary fs. This is a reasonable check, because switch-root in initrd will wipe the whole rootfs, will be a disaster if there are any misdetect. So extend SYSTEMD_IN_INITRD environment variable, now it accepts boolean value and two extra keyword, "auto" and "lenient". "auto" is same as before, and it's the default value. "lenient" will let systemd bypass the rootfs check.
Diffstat (limited to 'docs/ENVIRONMENT.md')
-rw-r--r--docs/ENVIRONMENT.md10
1 files changed, 7 insertions, 3 deletions
diff --git a/docs/ENVIRONMENT.md b/docs/ENVIRONMENT.md
index 74a71bba93..8eb2b9b9e2 100644
--- a/docs/ENVIRONMENT.md
+++ b/docs/ENVIRONMENT.md
@@ -52,9 +52,13 @@ All tools:
* `$SYSTEMD_EFI_OPTIONS` — if set, used instead of the string in the
SystemdOptions EFI variable. Analogous to `$SYSTEMD_PROC_CMDLINE`.
-* `$SYSTEMD_IN_INITRD` — takes a boolean. If set, overrides initrd detection.
- This is useful for debugging and testing initrd-only programs in the main
- system.
+* `$SYSTEMD_IN_INITRD=[auto|lenient|0|1]` — if set, specifies initrd detection
+ method. Defaults to `auto`. Behavior is defined as follows:
+ `auto`: Checks if `/etc/initrd-release` exists, and a temporary fs is mounted
+ on `/`. If both conditions meet, then it's in initrd.
+ `lenient`: Similiar to `auto`, but the rootfs check is skipped.
+ `0|1`: Simply overrides initrd detection. This is useful for debugging and
+ testing initrd-only programs in the main system.
* `$SYSTEMD_BUS_TIMEOUT=SECS` — specifies the maximum time to wait for method call
completion. If no time unit is specified, assumes seconds. The usual other units