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)
Thu, Apr 11, 9:59 PM
Unknown Object (File)
Mon, Apr 1, 1:14 PM
Unknown Object (File)
Mar 3 2024, 11:03 PM
Unknown Object (File)
Mar 3 2024, 11:03 PM
Unknown Object (File)
Mar 2 2024, 8:25 PM
Unknown Object (File)
Feb 28 2024, 10:46 PM
Unknown Object (File)
Feb 19 2024, 8:46 PM
Unknown Object (File)
Jan 11 2024, 10:48 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'.