summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrej Shadura <andrew.shadura@collabora.co.uk>2021-04-06 18:55:23 +0200
committerAndrej Shadura <andrew.shadura@collabora.co.uk>2021-04-06 18:55:23 +0200
commit5b23083f590a3a897ff9926c5d8643259583a74e (patch)
treef5550b8c30c686c997ebcb5284877c593ec645a9
parent9e6e55e27ebb27a9debe25ef1e54bf06a65bafe3 (diff)
Add --register=no to systemd-nspawn invocation
-rw-r--r--debian/patches/0001-systemd-nspawn-shall-be-called-with-option-register-.patch29
-rw-r--r--debian/patches/series1
2 files changed, 30 insertions, 0 deletions
diff --git a/debian/patches/0001-systemd-nspawn-shall-be-called-with-option-register-.patch b/debian/patches/0001-systemd-nspawn-shall-be-called-with-option-register-.patch
new file mode 100644
index 0000000..fe6de32
--- /dev/null
+++ b/debian/patches/0001-systemd-nspawn-shall-be-called-with-option-register-.patch
@@ -0,0 +1,29 @@
+From c8f6962c33d28d40deb5d88dd2e4760980bb40ff Mon Sep 17 00:00:00 2001
+From: mtt2hi <thomas.mittelstaedt@de.bosch.com>
+Date: Tue, 6 Apr 2021 09:41:40 +0000
+Subject: [PATCH] systemd-nspawn shall be called with option "--register=no" to
+ prevent error after debootstrap
+
+After debootstrap the call of "debos" fails with message "Failed to register machine: Unit machine-root.scope already exists".
+With the option "--register=no" this works fine. This change is derived from https://gitlab.collabora.com/smcv/flatdeb/-/merge_requests/6
+
+Signed-off-by: mtt2hi <thomas.mittelstaedt@de.bosch.com>
+---
+ commands.go | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/commands.go b/commands.go
+index 7bf45cc..42ba982 100644
+--- a/commands.go
++++ b/commands.go
+@@ -226,6 +226,7 @@ func (cmd Command) Run(label string, cmdline ...string) error {
+ options = append(options, "systemd-nspawn", "-q")
+ options = append(options, "--resolv-conf=off")
+ options = append(options, "--timezone=off")
++ options = append(options, "--register=no")
+ for _, e := range cmd.extraEnv {
+ options = append(options, "--setenv", e)
+
+--
+2.30.1
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..ee209b6
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001-systemd-nspawn-shall-be-called-with-option-register-.patch