early boot prompt not accessible on newly installed system

Johannes Hofmann johannes.hofmann at gmx.de
Mon Feb 15 09:51:15 PST 2010

Johannes Hofmann <johannes.hofmann at gmx.de> wrote:
> Hi,
> on a recently installed system I can't get into the early boot prompt
> (the one before LOADER(8)).
> If I hit enter while the bar is spinning the systems gets stuck.
> If I just wait for the timeout it continues to boot fine with a warning
> "/boot/loader: Not a directory".
> I assume it is related to disklable64 being used by the installer now,
> as the systems which still have a normal disklabel are not affected.
> I can reproduce the problem in VirtualBox with a current snapshot
> build.
> It's not a big deal, as the system boots up ok, if I just wait.

Ok, I think I found out what's going on:

Reading the disklabel64 in pc32/boot2/boot2.c:609 trashes the ufs
buffers which are behind  boot2_dmadat->secbuf.
This is a problem if we reread the same inode after that, because in
that case boot2_ufs_read() would use the buffers directly without
actually reading in the data again.
A potential fix is to invalidate inomap in boot2_ufs_init:

diff --git a/sys/boot/common/ufsread.c b/sys/boot/common/ufsread.c
index 6b94600..8e4c5c5 100644
--- a/sys/boot/common/ufsread.c
+++ b/sys/boot/common/ufsread.c
@@ -166,6 +166,7 @@ boot2_ufs_init(void)
        struct fs *fs;
        size_t n;
+       inomap = 0;
        fs = (struct fs *)fsdmadat->sbbuf;
        for (n = 0; sblock_try[n] != -1; n++) {

Alternatively one could use a private buffer in dskprobe(), but I'm
not sure whether we need to save space here.

There may be more places that need fixing, e.g. for hammer boot


More information about the Users mailing list