Re: [solved] Re: usb-stick accessible, but doesn't boot
On Wed, 24 Dec 2008 16:53:00 +0100 clemens fischer wrote: On Wed, 24 Dec 2008 15:05:32 +0100 clemens fischer wrote: Hans Petter Selasky: 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. Can you tell me what to do to the kernel configuration? Maybe I don't have to compile any USB functions into the kernel and can put them into loader.conf? I always get these dependency problems. I think I've found my problem. The kernel configuration really needs the line marked required, which builds support for the USB bus: device usb. Except this line, every usb related item is a nodevice now. The USB2 modules needed are kldload'ed in boot/loader.conf from the USB-stick, and this really works. Hans Petter: although I am not sure if my USB-stick needs it, the kernel was built using your patch. So the least I can say about it: It doesn't hurt, and it might sure help with more restive devices. Hans Petter pointed to me to the _real_ solution of my problem, and I want to set the record straight: The USB2 stack works fine, the patch to vfs_mount.c makes the booting process more robust. The easiest way to make a system booting from USB mass storage is to exclude every usb- related device from the kernel and kldload the needed modules in boot/loader.conf: # /boot/loader.conf usb2_controller_ehci_load=YES usb2_controller_ohci_load=YES usb2_controller_uhci_load=YES usb2_storage_mass_load=YES My problem was a left-over device ucom in the kernel configuration, or actually, since I have include GENERIC at the top, the missing nodevice ucom line. It pulled in dependencies on the old USB stack. -c ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: [solved] Re: usb-stick accessible, but doesn't boot
On Tue, 23 Dec 2008 21:10:23 +0100 clemens fischer wrote: Hans Petter Selasky: 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. Sorry, currently I get build errors, possibly unrelated: === zyd (depend) @ - /usr/src-main/sys machine - /usr/src-main/sys/i386/include ln -sf /usr/local/obj/usr/src-main/sys/usb2_fbsd8_i386/opt_usb.h opt_usb.h awk -f @/tools/makeobjops.awk @/kern/bus_if.m -h awk -f @/tools/makeobjops.awk @/kern/device_if.m -h awk -f @/tools/usbdevs2h.awk @/dev/usb/usbdevs -h rm -f .depend mkdep -f .depend -a -nostdinc -D_KERNEL -DKLD_MODULE -DHAVE_KERNEL_OPTION_HEADERS -I. -I@ -I@/contrib/altq -I/usr/local/obj/usr/src-main/sys/usb2_fbsd8_i386 /usr/src-main/sys/modules/zyd/../../dev/usb/if_zyd.c 1 error *** Error code 2 1 error *** Error code 2 1 error I'll svn the repo (to HEAD of CURRENT) and try again. In the meantime the repo is updated to r186477. An old-school USB kernel compiles, but USB2 does not: === zyd (depend) @ - /usr/src-main/sys machine - /usr/src-main/sys/i386/include ln -sf /usr/local/obj/usr/src-main/sys/usb2_fbsd8_i386/opt_usb.h opt_usb.h awk -f @/tools/makeobjops.awk @/kern/bus_if.m -h awk -f @/tools/makeobjops.awk @/kern/device_if.m -h awk -f @/tools/usbdevs2h.awk @/dev/usb/usbdevs -h rm -f .depend mkdep -f .depend -a -nostdinc -D_KERNEL -DKLD_MODULE -DHAVE_KERNEL_OPTION_HEADERS -I. -I@ -I@/contrib/altq -I/usr/local/obj/usr/src-main/sys/usb2_fbsd8_i386 /usr/src-main/sys/modules/zyd/../../dev/usb/if_zyd.c machine - /usr/src-main/sys/i386/include awk -f /usr/src-main/sys/tools/vnode_if.awk /usr/src-main/sys/kern/vnode_if.src -c ... /usr/bin/make -V CFILES -V SYSTEM_CFILES -V GEN_CFILES | MKDEP_CPP=cc -E CC=cc xargs mkdep -a -f .newdep -O2 -pipe -fno-strict-aliasing -march=athlon-mp -std=c99 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc -I. -I/usr/src-main/sys -I/usr/src-main/sys/contrib/altq -I/usr/src-main/sys/contrib/ipfilter -I/usr/src-main/sys/contrib/pf -I/usr/src-main/sys/dev/ath -I/usr/src-main/sys/dev/ath/ath_hal -I/usr/src-main/sys/contrib/ngatm -I/usr/src-main/sys/dev/twa -I/usr/src-main/sys/gnu/fs/xfs/FreeBSD -I/usr/src-main/sys/gnu/fs/xfs/FreeBSD/support -I/usr/src-main/sys/gnu/fs/xfs -I/usr/src-main/sys/contrib/opensolaris/compat -I/usr/src-main/sys/dev/cxgb -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -mno-align-long-strings -mpreferred-stac k-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding -fstack-protector /usr/src-main/sys/dev/usb/ucom.c:92:21: error: usbdevs.h: No such file or directory mkdep: compile failed *** Error code 1 1 error *** Error code 2 1 error *** Error code 2 1 error The manual page to zyd(4) indicates that it wants device usb, so it may be an error in zyd, not USB2. A few questions question though: do I need to specify nodevice usb in an USB2 kernel config as well? In the comments, it says: USB Bus (required), and the compile error says: error: usbdevs.h: No such file or directory. Next, I'll try to exclude the zyd module from building. The kernel doesn't contain it, anyway. -c ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: [solved] Re: usb-stick accessible, but doesn't boot
Hans Petter Selasky: 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. Can you tell me what to do to the kernel configuration? Maybe I don't have to compile any USB functions into the kernel and can put them into loader.conf? I always get these dependency problems. regards, clemens ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: [solved] Re: usb-stick accessible, but doesn't boot
On Wed, 24 Dec 2008 15:05:32 +0100 clemens fischer wrote: Hans Petter Selasky: 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. Can you tell me what to do to the kernel configuration? Maybe I don't have to compile any USB functions into the kernel and can put them into loader.conf? I always get these dependency problems. I think I've found my problem. The kernel configuration really needs the line marked required, which builds support for the USB bus: device usb. Except this line, every usb related item is a nodevice now. The USB2 modules needed are kldload'ed in boot/loader.conf from the USB-stick, and this really works. Hans Petter: although I am not sure if my USB-stick needs it, the kernel was built using your patch. So the least I can say about it: It doesn't hurt, and it might sure help with more restive devices. -c ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: [solved] Re: usb-stick accessible, but doesn't boot
Hans Petter Selasky: 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. Sorry, currently I get build errors, possibly unrelated: === zyd (depend) @ - /usr/src-main/sys machine - /usr/src-main/sys/i386/include ln -sf /usr/local/obj/usr/src-main/sys/usb2_fbsd8_i386/opt_usb.h opt_usb.h awk -f @/tools/makeobjops.awk @/kern/bus_if.m -h awk -f @/tools/makeobjops.awk @/kern/device_if.m -h awk -f @/tools/usbdevs2h.awk @/dev/usb/usbdevs -h rm -f .depend mkdep -f .depend -a -nostdinc -D_KERNEL -DKLD_MODULE -DHAVE_KERNEL_OPTION_HEADERS -I. -I@ -I@/contrib/altq -I/usr/local/obj/usr/src-main/sys/usb2_fbsd8_i386 /usr/src-main/sys/modules/zyd/../../dev/usb/if_zyd.c 1 error *** Error code 2 1 error *** Error code 2 1 error I'll svn the repo (to HEAD of CURRENT) and try again. regards, clemens ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: [solved] Re: usb-stick accessible, but doesn't boot
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 = 0x 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-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: [solved] Re: usb-stick accessible, but doesn't boot
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 = 0x 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-...@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-usb To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org --- 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.); ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: [solved] Re: usb-stick accessible, but doesn't boot
clemens fischer wrote: On Fri, 19 Dec 2008 22:29:15 +0100 clemens fischer wrote: My USB-stick (trekstore, identifies as USB DISK SMI Corporation) is sliced using sade(8), labelled using bsdlabel, accessible using mount /dev/da0s1a /mnt/usb, it has kernel and world, but doesn't boot. The problem had nothing to do with kernel features or setup, except for etc/fstab. I had a what I thought quicksimple md for /var: md /var mfs rw,-s100M,noatime 0 0, but this doesn't account for all the preset stuff in /var needed to run a system. The current version looks like: # /etc/fstab # /dev/ad6s2b noneswap sw 0 0 /dev/da0s1a / ufs rw,noatime 1 1 /dev/da0s1g /home ufs rw,noatime,noexec 0 0 /dev/da0s1f /usrufs rw,noatime 0 0 md /tmpmfs rw,-s24M,noatime 0 0 md /var/runmfs rw,-s4M,noatime 0 0 md /var/logmfs rw,-s32M,noatime 0 0 # proc /proc procfs rw 0 0 Of course the directory structure had been setup with make DESTDIR=/mnt/usb/ufs distrib-dirs distribution. 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. -c ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
[solved] Re: usb-stick accessible, but doesn't boot
On Fri, 19 Dec 2008 22:29:15 +0100 clemens fischer wrote: My USB-stick (trekstore, identifies as USB DISK SMI Corporation) is sliced using sade(8), labelled using bsdlabel, accessible using mount /dev/da0s1a /mnt/usb, it has kernel and world, but doesn't boot. The problem had nothing to do with kernel features or setup, except for etc/fstab. I had a what I thought quicksimple md for /var: md /var mfs rw,-s100M,noatime 0 0, but this doesn't account for all the preset stuff in /var needed to run a system. The current version looks like: # /etc/fstab # /dev/ad6s2b noneswap sw 0 0 /dev/da0s1a / ufs rw,noatime 1 1 /dev/da0s1g /home ufs rw,noatime,noexec 0 0 /dev/da0s1f /usrufs rw,noatime 0 0 md /tmpmfs rw,-s24M,noatime 0 0 md /var/runmfs rw,-s4M,noatime 0 0 md /var/logmfs rw,-s32M,noatime 0 0 # proc /proc procfs rw 0 0 Of course the directory structure had been setup with make DESTDIR=/mnt/usb/ufs distrib-dirs distribution. -c ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
usb-stick accessible, but doesn't boot
Hi, My USB-stick (trekstore, identifies as USB DISK SMI Corporation) is sliced using sade(8), labelled using bsdlabel, accessible using mount /dev/da0s1a /mnt/usb, it has kernel and world, but doesn't boot. The kernel has the following USB modules: # USB core support device usb2_core # # USB controller support device usb2_controller device usb2_controller_ehci device usb2_controller_ohci device usb2_controller_uhci # # USB mass storage support device usb2_storage device usb2_storage_mass # # USB input device support device usb2_input device usb2_input_hid device usb2_input_kbd device usb2_input_ms but it also has: # URL:#USB support some SCSI/USB support needed for system-on-schtick # nodevice uhci# UHCI PCI-USB interface nodevice ohci# OHCI PCI-USB interface nodevice ehci# EHCI PCI-USB interface (USB 2.0) nodevice usb # USB Bus (required) # # URL:#SCSI peripherals some SCSI/USB support needed for system-on-schtick nodevice udbp # USB Double Bulk Pipe devices nodevice ugen # Generic nodevice umass# usb-disks, readers nodevice uhid # Human Interface Devices nodevice ukbd # Keyboard nodevice ulpt # Printer nodevice ums # Mouse nodevice ural # Ralink Technology RT2500USB wireless NICs nodevice rum # Ralink Technology RT2501USB wireless NICs nodevice zyd # ZyDAS zb1211/zb1211b wireless NICs nodevice urio # Diamond Rio 500 MP3 player nodevice uscanner # Scanners When booting, the bootcode wants me to manually type in the root device to mount from and suggests the default in etc/fstab, but when I type ufs:/dev/da0s1a, it won't sing. When I type ?, the USB-stick is _not_ among the devices managed by GEOM. Re. GEOM, I only have: nooptions GEOM_LABEL # Provides labelization in the kernel config. I want it to boot, what should I do? -c ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org