From owner-freebsd-usb@FreeBSD.ORG Sat Jan 10 15:56:22 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 799251065672 for ; Sat, 10 Jan 2009 15:56:22 +0000 (UTC) (envelope-from olivier@gid0.org) Received: from mail-bw0-f20.google.com (mail-bw0-f20.google.com [209.85.218.20]) by mx1.freebsd.org (Postfix) with ESMTP id D80468FC0A for ; Sat, 10 Jan 2009 15:56:21 +0000 (UTC) (envelope-from olivier@gid0.org) Received: by bwz13 with SMTP id 13so3961791bwz.19 for ; Sat, 10 Jan 2009 07:56:20 -0800 (PST) Received: by 10.223.105.140 with SMTP id t12mr19521029fao.12.1231601028826; Sat, 10 Jan 2009 07:23:48 -0800 (PST) Received: by 10.223.112.75 with HTTP; Sat, 10 Jan 2009 07:23:48 -0800 (PST) Message-ID: <367b2c980901100723h19dc2ff6x55a48c96dcdce9b3@mail.gmail.com> Date: Sat, 10 Jan 2009 16:23:48 +0100 From: "Olivier SMEDTS" To: "Hans Petter Selasky" In-Reply-To: <200901101508.44659.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200901101332.04206.Thomas.Sparrevohn@btinternet.com> <200901101508.44659.hselasky@c2i.net> Cc: Ed Maste , freebsd-usb@freebsd.org 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 15:56:22 -0000 2009/1/10 Hans Petter Selasky : > 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 : Great, my ZFS-only USB key could only boot by mounting root manually. I'll try this. Cheers > --- 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 > _______________________________________________ > 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" > -- Olivier Smedts _ ASCII ribbon campaign ( ) e-mail: olivier@gid0.org - against HTML email & vCards X www: http://www.gid0.org - against proprietary attachments / \ "Il y a seulement 10 sortes de gens dans le monde : ceux qui comprennent le binaire, et ceux qui ne le comprennent pas."