summaryrefslogtreecommitdiff
path: root/src/gpt-auto-generator/gpt-auto-generator.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-10-03 22:13:01 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-10-03 22:13:01 -0400
commit9a5cb1371b6d8b0a04bd08665bcf9b06cb40c64c (patch)
treec544fd50a872feac5253bd05fb53369c75d0501c /src/gpt-auto-generator/gpt-auto-generator.c
parent970edce6efcd3a0cf284aa0f43e0b27ecbd415f5 (diff)
gpt-auto-generator: exit immediately if in container
Otherwise we get an ugly warning when running systemd in a container.
Diffstat (limited to 'src/gpt-auto-generator/gpt-auto-generator.c')
-rw-r--r--src/gpt-auto-generator/gpt-auto-generator.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c
index ca54925da4..d2b4213af2 100644
--- a/src/gpt-auto-generator/gpt-auto-generator.c
+++ b/src/gpt-auto-generator/gpt-auto-generator.c
@@ -38,6 +38,7 @@
#include "libudev.h"
#include "special.h"
#include "unit-name.h"
+#include "virt.h"
/* TODO:
*
@@ -481,6 +482,13 @@ int main(int argc, char *argv[]) {
umask(0022);
if (in_initrd()) {
+ log_debug("In initrd, exiting.");
+ r = 0;
+ goto finish;
+ }
+
+ if (detect_container(NULL) > 0) {
+ log_debug("In a container, exiting.");
r = 0;
goto finish;
}