Date: Wed, 16 Sep 2009 09:43:18 +0400 From: "Andrey V. Elsukov" <bu7cher@yandex.ru> To: Scott Long <scottl@samsco.org> Cc: FreeBSD CURRENT Mailing List <freebsd-current@freebsd.org>, Hans Petter Selasky <hselasky@c2i.net>, Randi Harper <randi@freebsd.org>, James Butler <sweetnavelorange@gmail.com> Subject: Re: Can't boot 8.0-BETA4 from USB stick Message-ID: <4AB07AF6.7010503@yandex.ru> In-Reply-To: <EEB6EC98-AA07-4E3C-9B03-84A45D4D9ABE@samsco.org> References: <f0dd9eb90909080402m27558850g6aaa2a5e4c477758@mail.gmail.com> <200909091631.01446.hselasky@c2i.net> <f0dd9eb90909092137o25d00f3l8bfba581a9d1aab8@mail.gmail.com> <200909100911.10237.hselasky@c2i.net> <f0dd9eb90909101448r5ad0c375r47cc253038aaa5f9@mail.gmail.com> <e277d6c80909101505t1932472bo22d41ded69c58dd8@mail.gmail.com> <f0dd9eb90909101522l2e56f8dardae165976d6c00c0@mail.gmail.com> <e277d6c80909101552s6e2eaf70ja87ccfc69e788292@mail.gmail.com> <f0dd9eb90909132032v29e72572wb0b53e6f436ea8e2@mail.gmail.com> <EEB6EC98-AA07-4E3C-9B03-84A45D4D9ABE@samsco.org>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------060503090601000308090708
Content-Type: text/plain; charset=KOI8-R; format=flowed
Content-Transfer-Encoding: 7bit
Scott Long wrote:
> Delaying the mountroot doesn't fix the problem. The problem is that
> there's a race between the process doing the USB tree discovery, and the
> process doing the CAM/SCSI bus scan. The tree discovery needs to happen
> before the bus scan, and no amount of root delay tweaks will help that,
> except maybe accidentally by shifting timings. I'm working on the
> correct solution. I'll hopefully have something tomorrow.
Hi, Scott.
I wrote small kld which i load from boot prompt and now my flash device
detected (i know it's hack, but it can help until you are working on right solution) :)
--
WBR, Andrey V. Elsukov
--------------060503090601000308090708
Content-Type: text/plain;
name="wait.c.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="wait.c.txt"
/*-
* Copyright (c) 2009 Andrey V. Elsukov <bu7cher@yandex.ru>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/module.h>
#include <sys/systm.h>
static struct callout wait_callout;
static struct root_hold_token *wait_hold = NULL;
static int wait_seconds = 15;
static void
wait_timeout(void *arg)
{
if (wait_hold != NULL)
root_mount_rel(wait_hold);
}
static int
wait_modevent(module_t mod, int type, void *unused)
{
switch (type) {
case MOD_LOAD:
wait_hold = root_mount_hold("USB Flash");
if (wait_hold != NULL) {
callout_init(&wait_callout, 0);
callout_reset(&wait_callout, hz * wait_seconds,
wait_timeout, NULL);
}
break;
case MOD_UNLOAD:
if (wait_hold != NULL)
callout_stop(&wait_callout);
break;
};
return (0);
}
static moduledata_t waitmod = {
"wait",
wait_modevent,
0
};
DECLARE_MODULE(wait, waitmod, SI_SUB_ROOT_CONF, SI_ORDER_ANY);
--------------060503090601000308090708--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4AB07AF6.7010503>
