Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Dec 2008 19:44:14 +0100
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        freebsd-usb@freebsd.org
Cc:        clemens fischer <ino-news@spotteswoode.dnsalias.org>, freebsd-questions@freebsd.org
Subject:   Re: [solved] Re: usb-stick accessible, but doesn't boot
Message-ID:  <200812221944.17694.hselasky@c2i.net>
In-Reply-To: <otu426xb6i2.ln2@nntp.spotteswoode.dnsalias.org>
References:  <bagt16xall.ln2@nntp.spotteswoode.dnsalias.org> <a1u126xiu1.ln2@nntp.spotteswoode.dnsalias.org> <otu426xb6i2.ln2@nntp.spotteswoode.dnsalias.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--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: <SanDisk> at usbus1
>   umass0: <SanDisk product 0x5151, class 0/0, rev 2.00/2.00, addr 2> on
> usbus1 pass0: <SanDisk Cruzer Micro 8.02> Removable Direct Access SCSI-0
> device da0: <SanDisk Cruzer Micro 8.02> 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 <sys/sysent.h>
 #include <sys/systm.h>
 #include <sys/vnode.h>
+#include <sys/cons.h>
 #include <vm/uma.h>
 
 #include <geom/geom.h>
@@ -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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812221944.17694.hselasky>