Page MenuHomeFreeBSD

kern: mountroot: add a mountroot directive to reboot
Needs ReviewPublic

Authored by kevans on May 29 2023, 1:16 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 30 2023, 2:52 PM
Unknown Object (File)
Nov 17 2023, 9:25 PM
Unknown Object (File)
Nov 17 2023, 8:47 PM
Unknown Object (File)
Nov 17 2023, 7:02 PM
Unknown Object (File)
Oct 12 2023, 5:52 AM
Unknown Object (File)
Aug 16 2023, 11:12 AM
Unknown Object (File)
Aug 12 2023, 4:35 AM
Unknown Object (File)
Jul 26 2023, 9:52 AM
Subscribers

Details

Reviewers
marcel
kib
markj
Summary

A future change will add a tunable to control the fallback directive,
currently usually ".ask". This series is motivated by a desire to avoid
the mountroot prompt and just immediately reboot if we failed to mount
root; nextboot(8) is in use and if we made it far enough to be in a
kernel that's trying to mountroot, odds are greater for a botched
kernel/module than a broken root fs (in my case).

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 51752
Build 48643: arc lint + arc unit

Event Timeline

sys/kern/vfs_mountroot.c
712

Shouldn't this just parse it, or are all the other cases parsing and executing?

sys/kern/vfs_mountroot.c
712

parse_dir_ask immediately executes its action, so I believe the latter is OK/not unexpected.

The underlying motivation makes sense to me, but I don't quite understand this patch. Why isn't it sufficient to just support ".onfail reboot"? With this change, you can insert ".reboot" anywhere in the mountfrom specification, and the kernel will reboot without parsing further, but it sounds like you just need to support rebooting as an onfail action.

The underlying motivation makes sense to me, but I don't quite understand this patch. Why isn't it sufficient to just support ".onfail reboot"? With this change, you can insert ".reboot" anywhere in the mountfrom specification, and the kernel will reboot without parsing further, but it sounds like you just need to support rebooting as an onfail action.

The onfail action only happens after everything else has failed, so after the .ask that happens at the end (unless you specify boot_askname to make it happen earlier, which I don't want). Maybe some kind of boot_unattended to just avoid any .ask is what I want? I don't think we have anything else that'll need to check it, though, so I'm unsure