mirror of
https://github.com/systemd/systemd.git
synced 2024-12-18 06:33:36 +08:00
virt: add possibility to skip the check for chroot (#4374)
https://bugzilla.redhat.com/show_bug.cgi?id=1379852
This commit is contained in:
parent
7d862ab8c2
commit
08a28eeca7
@ -33,6 +33,7 @@
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "virt.h"
|
||||
#include "env-util.h"
|
||||
|
||||
static int detect_vm_cpuid(void) {
|
||||
|
||||
@ -487,6 +488,9 @@ int detect_virtualization(void) {
|
||||
int running_in_chroot(void) {
|
||||
int ret;
|
||||
|
||||
if (getenv_bool("SYSTEMD_IGNORE_CHROOT") > 0)
|
||||
return 0;
|
||||
|
||||
ret = files_same("/proc/1/root", "/");
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user