mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-09-07 06:03:51 +00:00
gpt-auto-generator: exit immediately if in container
Otherwise we get an ugly warning when running systemd in a container.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user