Skip to content

Commit

Permalink
Create symlink doing integrity check rather than doing the mount phase
Browse files Browse the repository at this point in the history
  • Loading branch information
muhdsalm committed Sep 17, 2024
1 parent 47f75de commit f1225b7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 30 deletions.
30 changes: 0 additions & 30 deletions cmd/mount-sys.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,6 @@ func mountSys(cmd *cobra.Command, _ []string) error {
os.Exit(8)
}

err = makeSymlinks(dryRun)
if err != nil {
cmdr.Error.Println(err)
os.Exit(9)
}

if dryRun {
cmdr.Info.Println("Dry run complete.")
} else {
Expand Down Expand Up @@ -208,30 +202,6 @@ func mountOverlayMounts(rootLabel string, dryRun bool) error {
return nil
}

func makeSymlinks(dryRun bool) error {
type symlink struct {
from string
to string
}

symlinks := []symlink{
{"/var/home", "/home"},
}

for _, symlink := range symlinks {
cmdr.FgDefault.Println("symliking " + symlink.from + " to " + symlink.to)
if !dryRun {
err := syscall.Symlink(symlink.from, symlink.to)
if err != nil {
return err
}
}
}

return nil

}

func adjustFstab(uuid string, dryRun bool) error {
cmdr.FgDefault.Println("switching the root in fstab")

Expand Down
1 change: 1 addition & 0 deletions core/integrity.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func NewIntegrityCheck(root ABRootPartition, repair bool) (*IntegrityCheck, erro
"/libx32",
"/sbin",
"/usr",
"/home",
},
rootPaths: []string{ // those paths must be present in the root partition
"/boot",
Expand Down

0 comments on commit f1225b7

Please sign in to comment.