Skip to content

Commit

Permalink
makes opt an overlay of /.system/opt and /var/opt
Browse files Browse the repository at this point in the history
  • Loading branch information
taukakao committed Nov 21, 2024
1 parent b6301c3 commit 7c511d3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions cmd/mount-sys.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,16 @@ func mountOverlayMounts(rootLabel string, dryRun bool) error {

overlays := []overlayMount{
{"/.system/etc", []string{"/.system/etc"}, "/var/lib/abroot/etc/" + rootLabel, "/var/lib/abroot/etc/" + rootLabel + "-work"},
{"/opt", []string{"/.system/opt"}, "/var/opt", "/var/opt-work"},
}

for _, overlay := range overlays {
if _, err := os.Lstat(overlay.workdir); os.IsNotExist(err) {
err := os.MkdirAll(overlay.workdir, 0o755)
cmdr.Warning.Println(err)
// failing the boot here won't help so ingore any error
}

lowerCombined := strings.Join(overlay.lowerdirs, ":")
options := "lowerdir=" + lowerCombined + ",upperdir=" + overlay.upperdir + ",workdir=" + overlay.workdir

Expand Down Expand Up @@ -278,7 +285,7 @@ func adjustFstab(uuid string, dryRun bool) error {
}

// this is here to keep compatibility with older systems
// e.g. /home was a bind mount instead of a symlink to /var/home
// /home was a bind mount instead of a symlink to /var/home
func compatBindMounts(dryRun bool) (err error) {
type bindMount struct {
from, to string
Expand All @@ -287,7 +294,6 @@ func compatBindMounts(dryRun bool) (err error) {

binds := []bindMount{
{"/var/home", "/home", 0},
{"/var/opt", "/opt", 0},
}

for _, bind := range binds {
Expand Down
2 changes: 1 addition & 1 deletion core/integrity.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ var linksToRepair = [...][2]string{
{"var/home", "home"},
{"var/media", "media"},
{"var/mnt", "mnt"},
{"var/opt", "opt"},
{"var/root", "root"},
}

Expand All @@ -41,6 +40,7 @@ var pathsToRepair = [...]string{
".system",
"boot",
"dev",
"opt",
"part-future",
"proc",
"run",
Expand Down

0 comments on commit 7c511d3

Please sign in to comment.