From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Domsch Date: Mon, 07 Feb 2005 18:30:50 +0000 Subject: Re: [RFC][PATCH 2.6.11-rc2] Linux SCSI hotplug infrastructure Message-Id: <20050207183050.GD16526@lists.us.dell.com> List-Id: References: <20050207182753.GA16526@lists.us.dell.com> In-Reply-To: <20050207182753.GA16526@lists.us.dell.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-scsi@vger.kernel.org, linux-hotplug-devel@lists.sourceforge.net On Mon, Feb 07, 2005 at 12:27:53PM -0600, Matt Domsch wrote: > /etc/hotplug/scsi_topology.agent > handles the hotplug call, and invokes /sys/class/scsi_host/hostX/scan > and /sys/class/scsi_device/H:C:T:L:/device/delete as appropriate. And here's scsi_topology.agent. Signed-off-by: Matt Domsch -- Matt Domsch Software Architect Dell Linux Solutions linux.dell.com & www.dell.com/linux Linux on Dell mailing lists @ http://lists.us.dell.com #!/bin/bash # # SCSI Topology hotplug agent. # Copyright (C) 2005 Dell, Inc. # # This is invoked when a device, not currently known to the system, is # added or removed from a SCSI topology. This includes creation of a # logical drive on a RAID controller, or manually inserting a disk # into a SCSI disk enclosure. This script then invokes the scan # method of the scsi_host, or the delete method of the scsi_device, to # inform the kernel of the change made on the topology. # # SCSI_TOPOLOGY_EVENT_HCTL is used to know that the data to pass to # scan is a Host:Controller:Target ID:LUN tuple. This is to provide # for future SCSI implmentations that may use a native addressing # scheme rather than only HCTL. [ ${SCSI_TOPOLOGY_EVENT} != "1" ] && exit [ ${SCSI_TOPOLOGY_EVENT_HCTL} != "1" ] && exit if [ "${ACTION}" = "add" ]; then MYPATH=/sys/class/scsi_host/host${SCSI_HOST}/scan [ -f ${MYPATH} ] && echo "${SCSI_CHANNEL} ${SCSI_ID} ${SCSI_LUN}" > ${MYPATH} fi if [ "${ACTION}" = "remove" ]; then MYPATH=/sys/class/scsi_device/${SCSI_HOST}:${SCSI_CHANNEL}:${SCSI_ID}:${SCSI_LUN}/device/delete [ -f ${MYPATH} ] && echo "1" > ${MYPATH} fi ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95&alloc_id396&op=click _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel