From owner-freebsd-usb@FreeBSD.ORG Sat Jan 10 14:06:24 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 733C91065693 for ; Sat, 10 Jan 2009 14:06:24 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe08.swip.net [212.247.154.225]) by mx1.freebsd.org (Postfix) with ESMTP id A2DFF8FC22 for ; Sat, 10 Jan 2009 14:06:23 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=nklthdr5v5AUSfVrlghuJA==:17 a=H-fVbl1J6fLFWf8n26EA:9 a=hP4Q4e9l3prc7L0ch4gA:7 a=ynDTplAVL6A8YRsm_jDxkkft3lwA:4 a=SV7veod9ZcQA:10 a=LY0hPdMaydYA:10 Received: from [62.113.132.62] (account mc467741@c2i.net [62.113.132.62] verified) by mailfe08.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 1176389191; Sat, 10 Jan 2009 15:06:22 +0100 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Sat, 10 Jan 2009 15:08:43 +0100 User-Agent: KMail/1.9.7 References: <200901101332.04206.Thomas.Sparrevohn@btinternet.com> In-Reply-To: <200901101332.04206.Thomas.Sparrevohn@btinternet.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200901101508.44659.hselasky@c2i.net> Cc: Ed Maste Subject: Re: Advice on booting from usb2 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jan 2009 14:06:24 -0000 On Saturday 10 January 2009, Thomas Sparrevohn wrote: > I have a 4GB SDHC card that I have formatted with ufs and installed a > current kernel on - Its connected to a USB reader. Now here is the thing - > I can boot the kernel with USB2 well enough but when it comes to mount root > - it looks like USB2 has not probed and attached the device yet and I get > the "mount root from" prompt - however it does not show the cam devices > > Any advice? It's being worked on by "Ed Maste ". Temporary patch is available here for kern/vfs_mount.c : --- vfs_mount.c.orig Mon Dec 22 14:43:36 2008 +++ vfs_mount.c Mon Dec 22 15:09:14 2008 @@ -58,6 +58,7 @@ #include #include #include +#include #include #include @@ -1606,7 +1607,11 @@ vfs_mountroot(void) { char *cp; - int error, i, asked = 0; + const char *rootdevname_orig; + int error; + unsigned int i; + unsigned char asked = 0; /* set if asked for mount point */ + unsigned char timeout = 16; /* seconds */ root_mount_prepare(); @@ -1624,6 +1629,10 @@ asked = 1; } + /* store a copy of the initial root device name */ + rootdevname_orig = ctrootdevname; + retry: + /* * The root filesystem information is compiled in, and we are * booted with instructions to use it. @@ -1674,12 +1683,27 @@ if (!vfs_mountroot_try(ctrootdevname)) goto mounted; /* - * Everything so far has failed, prompt on the console if we haven't - * already tried that. + * Check if we should try more times. + */ + if (timeout != 0) { + timeout--; + pause("WROOT", hz); + if (cncheckc() == -1) { + /* no key press - try again */ + ctrootdevname = rootdevname_orig; + goto retry; + } + } + + /* + * Everything so far has failed, prompt on the console if we + * haven't already tried that. */ - if (!asked) + if (!asked) { + printf("\n"); if (!vfs_mountroot_ask()) goto mounted; + } panic("Root mount failed, startup aborted."); --HPS