Blame 0020-virt-add-possibility-to-skip-the-check-for-chroot-43.patch
|
Jan Synacek |
14572d |
From 08a28eeca70eeefb55af61191b63e4c938daca73 Mon Sep 17 00:00:00 2001
|
|
Jan Synacek |
14572d |
From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Nykr=C3=BDn?= <lnykryn@redhat.com>
|
|
Jan Synacek |
14572d |
Date: Sat, 15 Oct 2016 19:54:58 +0200
|
|
Jan Synacek |
14572d |
Subject: [PATCH] virt: add possibility to skip the check for chroot (#4374)
|
|
Jan Synacek |
14572d |
|
|
Jan Synacek |
14572d |
https://bugzilla.redhat.com/show_bug.cgi?id=1379852
|
|
Jan Synacek |
14572d |
---
|
|
Jan Synacek |
14572d |
src/basic/virt.c | 4 ++++
|
|
Jan Synacek |
14572d |
1 file changed, 4 insertions(+)
|
|
Jan Synacek |
14572d |
|
|
Jan Synacek |
14572d |
diff --git a/src/basic/virt.c b/src/basic/virt.c
|
|
Jan Synacek |
14572d |
index 10a2043..41012d5 100644
|
|
Jan Synacek |
14572d |
--- a/src/basic/virt.c
|
|
Jan Synacek |
14572d |
+++ b/src/basic/virt.c
|
|
Jan Synacek |
14572d |
@@ -33,6 +33,7 @@
|
|
Jan Synacek |
14572d |
#include "string-table.h"
|
|
Jan Synacek |
14572d |
#include "string-util.h"
|
|
Jan Synacek |
14572d |
#include "virt.h"
|
|
Jan Synacek |
14572d |
+#include "env-util.h"
|
|
Jan Synacek |
14572d |
|
|
Jan Synacek |
14572d |
static int detect_vm_cpuid(void) {
|
|
Jan Synacek |
14572d |
|
|
Jan Synacek |
14572d |
@@ -487,6 +488,9 @@ int detect_virtualization(void) {
|
|
Jan Synacek |
14572d |
int running_in_chroot(void) {
|
|
Jan Synacek |
14572d |
int ret;
|
|
Jan Synacek |
14572d |
|
|
Jan Synacek |
14572d |
+ if (getenv_bool("SYSTEMD_IGNORE_CHROOT") > 0)
|
|
Jan Synacek |
14572d |
+ return 0;
|
|
Jan Synacek |
14572d |
+
|
|
Jan Synacek |
14572d |
ret = files_same("/proc/1/root", "/");
|
|
Jan Synacek |
14572d |
if (ret < 0)
|
|
Jan Synacek |
14572d |
return ret;
|
|
Jan Synacek |
14572d |
--
|
|
Jan Synacek |
14572d |
2.7.4
|
|
Jan Synacek |
14572d |
|