From gregkh at linuxfoundation.org Mon Feb 6 04:47:49 2017 From: gregkh at linuxfoundation.org (Greg KH) Date: Mon, 6 Feb 2017 10:47:49 +0100 Subject: [Fw_Os_Forum] USB Media Path in the Boot Option's device path - inconsistency with USB port parent numbering In-Reply-To: References: Message-ID: <20170206094749.GA8780@kroah.com> On Sun, Feb 05, 2017 at 03:53:08PM -0500, Karen Gabrielyan wrote: > I'm pretty certain of behavior, as I've forced computers to boot into my > USB-based OS through USB multiple ports on multiple USB host controllers. > We tried the behavior on PC-s that have varying number of USB controllers, > different number of USB hubs between USB device and the controller. > And even with cases where there were multiple USB hubs involved in the full > device path, the port numbers of entire USB hub chain had to be wither 0-based > or 1-based. > > PciRoot(0)/PCI(x,y/USB(1,0)/USB(3,0)/USB(2,0) - in this example all USB > components had to have 1-based ports for boot option to load my OS. > PciRoot(0)/PCI(x,y/USB(0,0)/(1,0) - and here all USB components had to have > 0-based ports for my OS to load properly. As you are finding out, USB port and device numbers are not consistant, nor ever will be, sorry, that's not how USB works at all. > I need to find a reliable way to boot into the operating system from USB device > which I know resides on specific USB controller/port/hub. You can't do this by trying to specify the USB port and device numbers, sorry. > And our product requires this to work consistently on different models of > UEFI-based computers. That's a tall order, if not impossible given the different UEFI implementations and hardware configurations. > But this 0-based vs 1-based USB Parent Port numbering throws off the logic of > our software.? > > Can anyone help out with what's at play here with USB port numbers? > Is the port numbering supposed to be strict, or any UEFI vendor is free to > choose their how to interpret it? They can change at any time, even be different between boots, sorry. I don't know if UEFI has any way to scan the partition name and use that, but if so, that's the only way you are going to be able to do this in a reliable way, as that is what is done in other operating systems in order to achive this type of thing. Good luck! greg k-h From pjones at redhat.com Mon Feb 6 10:24:09 2017 From: pjones at redhat.com (Peter Jones) Date: Mon, 6 Feb 2017 10:24:09 -0500 Subject: [Fw_Os_Forum] USB Media Path in the Boot Option's device path - inconsistency with USB port parent numbering In-Reply-To: <20170206094749.GA8780@kroah.com> References: <20170206094749.GA8780@kroah.com> Message-ID: <20170206152409.hln7hflpxwutdynd@redhat.com> On Mon, Feb 06, 2017 at 10:47:49AM +0100, Greg KH wrote: > On Sun, Feb 05, 2017 at 03:53:08PM -0500, Karen Gabrielyan wrote: > > I'm pretty certain of behavior, as I've forced computers to boot into my > > USB-based OS through USB multiple ports on multiple USB host controllers. > > We tried the behavior on PC-s that have varying number of USB controllers, > > different number of USB hubs between USB device and the controller. > > And even with cases where there were multiple USB hubs involved in the full > > device path, the port numbers of entire USB hub chain had to be wither 0-based > > or 1-based. > > > > PciRoot(0)/PCI(x,y/USB(1,0)/USB(3,0)/USB(2,0) - in this example all USB > > components had to have 1-based ports for boot option to load my OS. > > PciRoot(0)/PCI(x,y/USB(0,0)/(1,0) - and here all USB components had to have > > 0-based ports for my OS to load properly. > > As you are finding out, USB port and device numbers are not consistant, > nor ever will be, sorry, that's not how USB works at all. > > > I need to find a reliable way to boot into the operating system from USB device > > which I know resides on specific USB controller/port/hub. > > You can't do this by trying to specify the USB port and device numbers, > sorry. > > > And our product requires this to work consistently on different models of > > UEFI-based computers. > > That's a tall order, if not impossible given the different UEFI > implementations and hardware configurations. > > > But this 0-based vs 1-based USB Parent Port numbering throws off the logic of > > our software.? > > > > Can anyone help out with what's at play here with USB port numbers? > > Is the port numbering supposed to be strict, or any UEFI vendor is free to > > choose their how to interpret it? > > They can change at any time, even be different between boots, sorry. > > I don't know if UEFI has any way to scan the partition name and use > that, but if so, that's the only way you are going to be able to do this > in a reliable way, as that is what is done in other operating systems in > order to achive this type of thing. We have abbreviated device paths that start with the Hard Drive Device Path (HD()), which describe a partition by its start and end and the signature. It's what gets used most of the time for everything. -- Peter