From owner-freebsd-questions@FreeBSD.ORG Mon Dec 22 19:42:06 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABACE1065676 for ; Mon, 22 Dec 2008 19:42:06 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe15.swip.net [212.247.155.193]) by mx1.freebsd.org (Postfix) with ESMTP id 112A68FC2B for ; Mon, 22 Dec 2008 19:42:05 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=xRNF5UixfvkA:10 a=J7eJdbkFtDMA:10 a=6I5d2MoRAAAA:8 a=zmbqK66cGwQApszikeUA:9 a=9wEoMHBacMjzFg6YWIUA:7 a=fNQkmNDoo6shxJDyOuvvUUanl0cA:4 a=SV7veod9ZcQA:10 a=50e4U0PicR4A:10 a=qNfsqeB5S6M8GqLfWEUA:9 a=sHe3vdHnRMbs7Sbp2UMA:7 a=F5YzBXDzJjiwOpYNm4yZFR7I9fIA:4 a=rPt6xJ-oxjAA:10 Received: from [193.217.167.134] (account mc467741@c2i.net HELO [10.0.0.186]) by mailfe15.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 424645017; Mon, 22 Dec 2008 19:42:02 +0100 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Mon, 22 Dec 2008 19:44:14 +0100 User-Agent: KMail/1.9.7 References: In-Reply-To: MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_BA+TJdRTB4mJOsd" Message-Id: <200812221944.17694.hselasky@c2i.net> Cc: clemens fischer , freebsd-questions@freebsd.org Subject: Re: [solved] Re: usb-stick accessible, but doesn't boot X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Dec 2008 19:42:06 -0000 --Boundary-00=_BA+TJdRTB4mJOsd Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, Try the attached patch to "sys/kern/vfs_mount.c" Thanks for reporting. I have been aware about this issue for some time now, but the patch has not been committed to current yet. I have FreeSBIE reliably up and running with USB2. --HPS On Monday 22 December 2008, clemens fischer wrote: > On Sun, 21 Dec 2008 14:47:54 +0100 clemens fischer wrote: > > [ re. a bootable CURRENT backup system on a USB stick] > > > I am very sorry for this inaccurate information. As it turns out, > > only the GENERIC kernel is bootable, my custom configuration doesn't. > > On the bright side, this indicates some feature missing from my > > normally very lean kernels, nothing is kaputt beyond repair. I'll > > just have to find out which module just has to be in the kernel to > > make it boot from an USB stick. > > The "custom configuration" uses the new USB2 stack, whereas GENERIC > still includes the older one. When replacing USB2 with the old stack, > I can reliably boot the system from the stick. > > I have another backup on a MMC card in a $5 card reader, but that one > boots with USB2. > > The USB stick which only runs on the old stack identifies as: > > ugen1.2: at usbus1 > umass0: on > usbus1 pass0: Removable Direct Access SCSI-0 > device da0: Removable Direct Access SCSI-0 > device umass0: SCSI over Bulk-Only; quirks = 0x0000 > > I don't know if any quirks would make this product work. To me it seems > as if it has to do with bulk handling? > > -c > > _______________________________________________ > freebsd-usb@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-usb > To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org" --Boundary-00=_BA+TJdRTB4mJOsd Content-Type: text/x-diff; charset="iso-8859-1"; name="vfs_mount.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="vfs_mount.c.diff" --- 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."); --Boundary-00=_BA+TJdRTB4mJOsd--