kern/161809: set kern.cam.boot_delay via build options (usb boot)

Ivan rozhuk.im at gmail.com
Wed Oct 19 15:40:13 UTC 2011


>Number:         161809
>Category:       kern
>Synopsis:       set kern.cam.boot_delay via build options (usb boot)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 19 15:40:12 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Ivan
>Release:        FreeBSD 8.2-STABLE
>Organization:
>Environment:
FreeBSD firewall 8.2-STABLE FreeBSD 8.2-STABLE #3: Tue Oct 11 07:33:32 IRKST 2011     root at firewall:/usr/obj/usr/src/sys/RIMx64  amd64
>Description:
Add kernel config option:
CAM_BOOT_DELAY = default value for "kern.cam.boot_delay"

Some devices not using FreeBSD loader and cant set "kern.cam.boot_delay" via loader.conf
>How-To-Repeat:
On FreeBSD 8 with certain USB flash drives and/or USB controllers, when booting from a USB drive the device does not become available until after the system has tried (and failed) to mount / from it. After this has occurred, the user is prompted to manually enter the device name at the mountroot> prompt; for me, even this doesn't work, and the device is not listed in the output from the ? command

(from: pr 138798)
>Fix:
Add to kernel config file and rebuild.

options 	CAM_BOOT_DELAY=4000	# kern.cam.boot_delay: Bus registration wait time

Patch attached with submission follows:

--- /usr/src/sys/cam/cam_xpt_orig.c	2011-10-20 00:08:54.000000000 +0900
+++ /usr/src/sys/cam/cam_xpt.c	2011-10-20 00:09:06.000000000 +0900
@@ -904,6 +904,9 @@
 	mtx_init(&xsoftc.xpt_lock, "XPT lock", NULL, MTX_DEF);
 	mtx_init(&xsoftc.xpt_topo_lock, "XPT topology lock", NULL, MTX_DEF);
 
+#ifdef CAM_BOOT_DELAY
+	xsoftc.boot_delay = CAM_BOOT_DELAY;
+#endif
 	/*
 	 * The xpt layer is, itself, the equivelent of a SIM.
 	 * Allow 16 ccbs in the ccb pool for it.  This should


--- /usr/src/sys/conf/options_orig	2011-10-16 02:17:43.000000000 +0900
+++ /usr/src/sys/conf/options	2011-10-20 00:05:42.000000000 +0900
@@ -301,6 +301,7 @@
 CAM_DEBUG_TARGET	opt_cam.h
 CAM_DEBUG_LUN		opt_cam.h
 CAM_DEBUG_FLAGS		opt_cam.h
+CAM_BOOT_DELAY		opt_cam.h
 SCSI_DELAY		opt_scsi.h
 SCSI_NO_SENSE_STRINGS	opt_scsi.h
 SCSI_NO_OP_STRINGS	opt_scsi.h


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list