RISC-V root device question

Mitchell Horne mhorne at freebsd.org
Mon Dec 7 21:56:52 UTC 2020


On Mon, Dec 7, 2020 at 4:54 PM Michael Dexter <editor at callfortesting.org> wrote:
>
> All,
>
> The FreeBSD wiki page on RISC-V reads:
>
> If you get mountroot prompt, then indicate to the kernel the location of
> rootfs:
>
> mountroot> ufs:/dev/vtbd0
>
> This indeed appears to be remain the case on CURRENT as of last week.
>
> Specifying a device and partition, or disklabel at the mountroot> prompt
> works every time but none of these do not help in loader.conf (tested
> individually):
>
> cam.boot_delay="100000"
> vfs.root.mountfrom="ufs:/dev/vtbd0p3"
> vfs.root.mountfrom="ufs:/dev/gpt/rootfs"
> rootdev="/dev/vtbd0p3"
> rootdev="vtbd0p3"
> currdev="vtbd0p3"
>
> Or these in the fstab:
>
> /dev/gpt/rootfs /       ufs     rw,noatime      1       1
> /dev/vtbd0p3   /       ufs     rw,noatime      1       1
>
> Are there any other options? Perhaps building the device name into the
> kernel?
>
> Thank you!
>
> Michael

Hi Michael,

If you have followed the directions on that wiki page exactly, then
you have booted without FreeBSD's loader(8), and that is why your
loader.conf variables are not taking effect. There are a couple
solutions to this.

As you suggest, it is possible to overwrite the default root device in
the kernel config, by adding a line such as:
  options ROOTDEVNAME=\"ufs:/dev/vtbd0p3\"

You can also override it using the QEMU commandline, which is simpler
since you won't need to recompile anything. Adding the following
argument should suffice:
  -append="vfs.root.mountfrom=ufs:/dev/vtbd0p3"
Note that you can set arbitrary kernel environment variables this way ^^

Finally, we do have support for loader.efi on RISC-V, although I have
not yet documented how to use it on the wiki page. If you would like
to try this method, please follow up with me and I can provide
instructions.

Otherwise, you can expect to see weekly RISC-V snapshots appear in the
next week or two, and I will ensure that the wiki page is up to date
with how to run them.

Cheers,
Mitchell

> _______________________________________________
> freebsd-current at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe at freebsd.org"


More information about the freebsd-current mailing list