1
- From 32835637fe28ddbbf4ff1b1da6321a4e1a45884f Mon Sep 17 00:00:00 2001
1
+ From bd6b8ffb83384e7f9e78dc42a9cee626830b990f Mon Sep 17 00:00:00 2001
2
2
From: Dusty Mabe <dusty@dustymabe.com>
3
3
Date: Wed, 10 Jan 2024 11:07:14 -0500
4
4
Subject: [PATCH 4/5] mounts/ostree.deployment: support deployments on mount
@@ -57,11 +57,11 @@ on the disk. The second mount (of type org.osbuild.ostree.deployment)
57
57
then reconfigures things similar to how an OSTree system is set up.
58
58
---
59
59
mounts/org.osbuild.ostree.deployment | 18 +++++++++++++++---
60
- osbuild/mounts.py | 13 +++++++++++ --
61
- 2 files changed, 26 insertions(+), 5 deletions(-)
60
+ osbuild/mounts.py | 13 ++++++++++- --
61
+ 2 files changed, 25 insertions(+), 6 deletions(-)
62
62
63
63
diff --git a/mounts/org.osbuild.ostree.deployment b/mounts/org.osbuild.ostree.deployment
64
- index b200eca3..e19ac525 100755
64
+ index b200eca3..24df7731 100755
65
65
--- a/mounts/org.osbuild.ostree.deployment
66
66
+++ b/mounts/org.osbuild.ostree.deployment
67
67
@@ -32,6 +32,12 @@ SCHEMA_2 = """
@@ -72,7 +72,7 @@ index b200eca3..e19ac525 100755
72
72
+ "type": "string",
73
73
+ "pattern": "^(mount|tree)$",
74
74
+ "default": "tree",
75
- + "description": "The source of the OSTree filesystem tree"
75
+ + "description": "The source of the OSTree filesystem tree. If 'mount', there should be a preceding mount defined that's mounted at /. "
76
76
+ },
77
77
"deployment": {
78
78
"type": "object",
@@ -111,10 +111,10 @@ index b200eca3..e19ac525 100755
111
111
var = os.path.join(target, "ostree", "deploy", osname, "var")
112
112
boot = os.path.join(target, "boot")
113
113
diff --git a/osbuild/mounts.py b/osbuild/mounts.py
114
- index 86576ad0..3e63c873 100644
114
+ index b938d21d..42b556ba 100644
115
115
--- a/osbuild/mounts.py
116
116
+++ b/osbuild/mounts.py
117
- @@ -180 ,6 +180 ,8 @@ class FileSystemMountService(MountService):
117
+ @@ -181 ,6 +181 ,8 @@ class FileSystemMountService(MountService):
118
118
os.makedirs(mountpoint, exist_ok=True)
119
119
self.mountpoint = mountpoint
120
120
@@ -123,21 +123,20 @@ index 86576ad0..3e63c873 100644
123
123
try:
124
124
subprocess.run(
125
125
["mount"] +
126
- @@ -202 ,12 +204,19 @@ class FileSystemMountService(MountService):
126
+ @@ -203 ,12 +205,17 @@ class FileSystemMountService(MountService):
127
127
if not self.mountpoint:
128
128
return
129
129
130
+ - self.sync()
130
131
+ # It's possible this mountpoint has already been unmounted
131
132
+ # if a umount -R was run by another process, as is done in
132
133
+ # mounts/org.osbuild.ostree.deployment.
133
134
+ if not os.path.ismount(self.mountpoint):
134
135
+ print(f"already unmounted: {self.mountpoint}")
135
136
+ return
136
- +
137
- self.sync()
138
137
139
138
- print("umounting")
140
- + print(f"unmounting { self.mountpoint}" )
139
+ + self.sync( )
141
140
142
141
# We ignore errors here on purpose
143
142
- subprocess.run(["umount", self.mountpoint],
0 commit comments