i have a pretty specific setup : i load the same freebsd system both physically and virtually, and when virtually the disk where freebsd is installed is not always the first one
for now, i have a grub config that does a good job with this by booting the kernel directly and setting vfs.root.mountfrom appropriately (actually it autodetects freebsd systems and boots them wherever they are)
my goal is the following : i want the above to be compatible with systems that have settings in loader.conf, and this is where things get complicated
if i boot the loader instead of the kernel, the currdev and bootdev are both set to wherever the grub config file resides, so the loader cannot load the kernel. booting the proper kernel from the loader's command line works fine.
i'm not interested in solutions involving to set stuff in loader.rc or loader.conf because this does not fit the autodetect goal, and it would not work anyway since the loader cannot find either of those files fior the same reason it cannot find the kernel
i naively tried to set kFreeBSD.currdev to no avail (boots but currdev is not changed)
i tried to chainload boot2 and ended up with "Invalid signature" (grub2 message when it cannot chainload something... no idea what it actually means)
i did not try chain.b (yet) because for some reason it does not happen to exist in my /boot (regular freebsd 10 install using the new installer)... ideas welcome while i'm looking for a copy, but i'd rather not rely on something that may or may not be there
i tried to chainload boot0 but (at least in qemu, it only displays "F1" with no system facing it and F6 for pxe boot. whatever key i press just prints a '#'. anyway i did not really expected it to do anything useful, i just though it might give a useful hint)
as a side note (or perhaps side question), i'd like to find a way to tell the loader where the root partiton is so it in turn can tell the kernel
any ideas ?
thanks for your input