@@ -188,9 +188,16 @@ func mountOverlayMounts(rootLabel string, dryRun bool) error {
188
188
189
189
overlays := []overlayMount {
190
190
{"/.system/etc" , []string {"/.system/etc" }, "/var/lib/abroot/etc/" + rootLabel , "/var/lib/abroot/etc/" + rootLabel + "-work" },
191
+ {"/opt" , []string {"/.system/opt" }, "/var/opt" , "/var/opt-work" },
191
192
}
192
193
193
194
for _ , overlay := range overlays {
195
+ if _ , err := os .Lstat (overlay .workdir ); os .IsNotExist (err ) {
196
+ err := os .MkdirAll (overlay .workdir , 0o755 )
197
+ cmdr .Warning .Println (err )
198
+ // failing the boot here won't help so ingore any error
199
+ }
200
+
194
201
lowerCombined := strings .Join (overlay .lowerdirs , ":" )
195
202
options := "lowerdir=" + lowerCombined + ",upperdir=" + overlay .upperdir + ",workdir=" + overlay .workdir
196
203
@@ -278,7 +285,7 @@ func adjustFstab(uuid string, dryRun bool) error {
278
285
}
279
286
280
287
// this is here to keep compatibility with older systems
281
- // e.g. /home was a bind mount instead of a symlink to /var/home
288
+ // /home was a bind mount instead of a symlink to /var/home
282
289
func compatBindMounts (dryRun bool ) (err error ) {
283
290
type bindMount struct {
284
291
from , to string
@@ -287,7 +294,6 @@ func compatBindMounts(dryRun bool) (err error) {
287
294
288
295
binds := []bindMount {
289
296
{"/var/home" , "/home" , 0 },
290
- {"/var/opt" , "/opt" , 0 },
291
297
}
292
298
293
299
for _ , bind := range binds {
0 commit comments