Page MenuHomeFreeBSD

If rootdev is set, use it as currdev.
ClosedPublic

Authored by imp on Jul 18 2018, 3:28 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 17, 3:51 PM
Unknown Object (File)
Sun, Oct 27, 10:51 PM
Unknown Object (File)
Oct 22 2024, 7:31 AM
Unknown Object (File)
Oct 22 2024, 2:27 AM
Unknown Object (File)
Oct 22 2024, 2:20 AM
Unknown Object (File)
Oct 3 2024, 4:46 PM
Unknown Object (File)
Oct 2 2024, 2:20 PM
Unknown Object (File)
Oct 2 2024, 2:20 PM

Details

Reviewers
tsoome
Summary

PR: 229770

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 18121
Build 17856: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Jul 18 2018, 3:34 PM

I confirmed this patch was working fine.

P.S. I found this patch is working with rEFInd but not working with loader alone.

See below comment.
stand/efi/loader/main.c
287

const char *rootdev.

Sorry, although this patch is good working from rEFInd, it is not working for loader prompt.
While showing boot menu, press '3' and go to loader prompt.
OK set rootdev=disk0pX
OK boot
The OS is booted from currdev, not from rootdev.

Sorry, although this patch is good working from rEFInd, it is not working for loader prompt.
While showing boot menu, press '3' and go to loader prompt.
OK set rootdev=disk0pX
OK boot
The OS is booted from currdev, not from rootdev.

it cannot - the rootdev is only consulted in very early startup. from prompt set currdev directly. However, if you do change currdev, you also probably want to re-initialize the configuration, for that you need:
ok unload \ unload loaded kernel/modules if there are any
ok free-module-options \ this will release memory from internal module config
ok start \ this will read all the config from new currdev

it cannot - the rootdev is only consulted in very early startup. from prompt set currdev directly. However, if you do change currdev, you also probably want to re-initialize the configuration, for that you need:
ok unload \ unload loaded kernel/modules if there are any
ok free-module-options \ this will release memory from internal module config
ok start \ this will read all the config from new currdev

Thank you. I understood.
I think it should display 'free-module-options' and 'start' when running '?'(lists available commands) with loader prompt.
Also, I think that the sequence of 'set currdev', 'unload', 'free-module-options', 'start' and 'boot' should be explained in the loader (8) man page.
It is very useful information.
Now I can change to the zfs boot from the ufs boot on loader prompt with the sequence of 'set currdev', 'unload', 'free-module-options', 'start' and 'boot'.