summaryrefslogtreecommitdiff
path: root/libre/systemd/systemd-hook
diff options
context:
space:
mode:
Diffstat (limited to 'libre/systemd/systemd-hook')
-rw-r--r--libre/systemd/systemd-hook8
1 files changed, 8 insertions, 0 deletions
diff --git a/libre/systemd/systemd-hook b/libre/systemd/systemd-hook
index 00252cf79..d40fad3b9 100644
--- a/libre/systemd/systemd-hook
+++ b/libre/systemd/systemd-hook
@@ -1,6 +1,14 @@
#!/bin/sh -e
+is_chrooted() {
+ if systemd-detect-virt --chroot; then
+ echo >&2 " Skipped: Running in chroot."
+ exit 0
+ fi
+}
+
systemd_live() {
+ is_chrooted
if [ ! -d /run/systemd/system ]; then
echo >&2 " Skipped: Current root is not booted."
exit 0