mirror of
https://github.com/systemd/systemd.git
synced 2025-03-11 20:58:27 +03:00
When running unprivileged, checking /proc/1/root doesn't work because it requires privileges. Instead, let's add an environment variable so the process that chroot's can tell (systemd) subprocesses whether they're running in a chroot or not. (cherry picked from commit 2701c2f67de592fe2565b084cfaec1667767dbaf)
8 lines
193 B
Bash
Executable File
8 lines
193 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
set -eux
|
|
set -o pipefail
|
|
|
|
SYSTEMD_IN_CHROOT=1 systemd-detect-virt --chroot
|
|
(! SYSTEMD_IN_CHROOT=0 systemd-detect-virt --chroot)
|