Skip to content

Commit 7c511d3

Browse files
committed
makes opt an overlay of /.system/opt and /var/opt
1 parent b6301c3 commit 7c511d3

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

cmd/mount-sys.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,16 @@ func mountOverlayMounts(rootLabel string, dryRun bool) error {
188188

189189
overlays := []overlayMount{
190190
{"/.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"},
191192
}
192193

193194
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+
194201
lowerCombined := strings.Join(overlay.lowerdirs, ":")
195202
options := "lowerdir=" + lowerCombined + ",upperdir=" + overlay.upperdir + ",workdir=" + overlay.workdir
196203

@@ -278,7 +285,7 @@ func adjustFstab(uuid string, dryRun bool) error {
278285
}
279286

280287
// 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
282289
func compatBindMounts(dryRun bool) (err error) {
283290
type bindMount struct {
284291
from, to string
@@ -287,7 +294,6 @@ func compatBindMounts(dryRun bool) (err error) {
287294

288295
binds := []bindMount{
289296
{"/var/home", "/home", 0},
290-
{"/var/opt", "/opt", 0},
291297
}
292298

293299
for _, bind := range binds {

core/integrity.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ var linksToRepair = [...][2]string{
3232
{"var/home", "home"},
3333
{"var/media", "media"},
3434
{"var/mnt", "mnt"},
35-
{"var/opt", "opt"},
3635
{"var/root", "root"},
3736
}
3837

@@ -41,6 +40,7 @@ var pathsToRepair = [...]string{
4140
".system",
4241
"boot",
4342
"dev",
43+
"opt",
4444
"part-future",
4545
"proc",
4646
"run",

0 commit comments

Comments
 (0)