Drop the fatal flag now that every failed check is fatal
This commit is contained in:
@@ -49,20 +49,17 @@ func checkMount(m mountSpec) checkResult {
|
||||
if err == unix.ENOENT {
|
||||
if err := unix.Mkdir(m.dir, 0o755); err != nil {
|
||||
res.err = fmt.Errorf("creating %s: %w", m.dir, err)
|
||||
res.fatal = true
|
||||
return res
|
||||
}
|
||||
err = unix.Statfs(m.dir, &st)
|
||||
}
|
||||
if err != nil {
|
||||
res.err = err
|
||||
res.fatal = true
|
||||
return res
|
||||
}
|
||||
mounted, err := isMountRoot(m.dir)
|
||||
if err != nil {
|
||||
res.err = err
|
||||
res.fatal = true
|
||||
return res
|
||||
}
|
||||
if mounted && int64(st.Type) == m.magic {
|
||||
@@ -71,7 +68,6 @@ func checkMount(m mountSpec) checkResult {
|
||||
}
|
||||
if err := unix.Mount(m.fstype, m.dir, m.fstype, m.flags, ""); err != nil {
|
||||
res.err = err
|
||||
res.fatal = true
|
||||
return res
|
||||
}
|
||||
res.fixed = true
|
||||
@@ -85,7 +81,7 @@ func mountFilesystems() []checkResult {
|
||||
for _, m := range wantMounts {
|
||||
res := checkMount(m)
|
||||
out = append(out, res)
|
||||
if res.fatal {
|
||||
if res.err != nil {
|
||||
return out
|
||||
}
|
||||
}
|
||||
@@ -118,7 +114,6 @@ func waitForTouchscreen() checkResult {
|
||||
}
|
||||
if time.Since(start) >= touchTimeout {
|
||||
res.err = fmt.Errorf("%w after %s", err, touchTimeout)
|
||||
res.fatal = true
|
||||
return res
|
||||
}
|
||||
time.Sleep(touchPoll)
|
||||
@@ -128,7 +123,7 @@ func waitForTouchscreen() checkResult {
|
||||
func bootstrap() []checkResult {
|
||||
out := mountFilesystems()
|
||||
// /dev/input/event* only exists once devtmpfs is mounted above.
|
||||
if out[len(out)-1].fatal {
|
||||
if out[len(out)-1].err != nil {
|
||||
return out
|
||||
}
|
||||
return append(out, waitForTouchscreen())
|
||||
|
||||
Reference in New Issue
Block a user