From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1V0Y4j-0007OB-Qt for mharc-grub-devel@gnu.org; Sat, 20 Jul 2013 10:23:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53071) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0Y4f-0007LS-Pw for Grub-devel@gnu.org; Sat, 20 Jul 2013 10:23:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V0Y4d-0002Hb-00 for Grub-devel@gnu.org; Sat, 20 Jul 2013 10:23:53 -0400 Received: from moutng.kundenserver.de ([212.227.17.9]:64620) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0Y4c-0002HR-M5 for Grub-devel@gnu.org; Sat, 20 Jul 2013 10:23:50 -0400 Received: from [10.0.0.100] (p4FC27535.dip0.t-ipconnect.de [79.194.117.53]) by mrelayeu.kundenserver.de (node=mreu3) with ESMTP (Nemesis) id 0MSTdP-1UXlqI0ztb-00TXi0; Sat, 20 Jul 2013 16:23:49 +0200 Message-ID: <51EA9D73.5010902@hgsys.de> Date: Sat, 20 Jul 2013 16:23:47 +0200 From: Holger Goetz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:23.0) Gecko/20100101 Thunderbird/23.0 MIME-Version: 1.0 To: David Michael Subject: Re: Obtaining the UUID of the system for a PXE boot References: <51E67DC2.1090609@hgsys.de> <51E7C5F0.5000308@hgsys.de> <20130718193501.629d9c69@opensuse.site> <51E94C37.4030300@hgsys.de> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:49Tio8JFAQOXsQmAgEIPICP5Kn5YUqWKzjdcxXYWv8V YZZFkssDjIViJSdst7B6YRYwKJgXXjGxiZ+lZKemNbsJSOl/DY JKJRiiNZnNkBovr3pjrT5gTk5BhuIk9gGxiXIBNIU2xIIGoK7I fFn4VcxsKsc5p9nLUZedgkhrmtGcQ6Ba2HTRNehf9ia73qzM5o Ugq4retU4jfwGZk0eM8hb3qnZZy9aP5vQKLeFwFK1Y/XtoRg/l PjzS57k4LNwGKqJw1ARkybDeaVE91wkC8Q+eQTfANprTjkcNXV w1jr+RWvrUpFJFmxBo51eMJBxr0lH42UJ6sEHsCR8GV4T/Vgw= = X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 212.227.17.9 Cc: Andrey Borzenkov , Grub-devel@gnu.org X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2013 14:23:56 -0000 On 19.07.2013 18:31, David Michael wrote: > Hi, > > On Fri, Jul 19, 2013 at 10:24 AM, Holger Goetz wrote: >> Yes it's towards the right direction. But it is 32bit only if i understand >> correctly, and it basically is a memory access to fixed/hardcoded MEMORY >> address (0x80000001). to pick the veondor id and machine info. > It's true that I've mostly been using the module on 32-bit virtual > machines, so it hasn't really been tested elsewhere. However, I'm not > sure I understand what you mean by the hard-coded memory address. The > first function grub_smbios_locate_eps searches for the SMBIOS entry > point structure as described in the spec. The table entries are then > read at the table address found in the EPS, not a hard-coded location. > >> I have only 64bit - UEFI here - therefore the approach w/ first searching >> the SMBIOS infoblock in memory is probably required. And then properly walk >> through the info-tables/blocks to get to the UUID entry. It doesn'T need to >> be a fixed info to be retrieved from the SMBIOS memory - maybe a generic >> function to query/search a specific entry and return that to be assigned to >> a variable would be more flexible. > The module's command-line interface does use a (dumb) query/search > method. You can specify the desired entry's type and/or handle and > the data to retrieve from it. For example the following command > prints the machine name (i.e. the string at offset 5 in an entry with > type 1). > > smbios -t 1 -s 5 > > I think you may have found the first patch I sent in that old thread, > which was for different functionality. The SMBIOS module can be > downloaded from the list archive[1]. > > Unfortunately it doesn't have any convenient functions to output a > usable UUID. It shouldn't take much to add one: the variable "entry" > in the "main" function is a pointer to the matched entry, so entry[8] > through entry[23] is the UUID in a call "smbios -t 1 ...". I've > verified these bytes correspond to dmidecode output on my physical > hardware with the following. > > for i in 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 > do smbios -t 1 -b $i > done > > If the module isn't salvageable on UEFI, maybe I can send out an > updated version whenever I upgrade to such a system. > > Thanks. > > David > > [1] https://lists.gnu.org/archive/html/grub-devel/2013-04/binx8am8MvVSh.bin > Hi David, you're right i had only found a small patch using cpuid to retrieve vendor&model . Looking at the smbios module briefly it looks very much like what i was hoping for. I'll look into it in detail and will see what needs to be added for the UUID on a x86_64-efi system and let you know. Thanks, Holger