From: Michael K. <li...@mk...> - 2018-03-04 22:01:13
|
> Am 04.03.2018 um 22:53 schrieb Lonnie Abelbeck <li...@lo...>: > > Hi Michael, > > Just for completeness, the Linux kernel exposes some DMI (Destktop Management Information) values in the /sys virtual filesystem. > > # grep '.*' /sys/class/dmi/id/[bpc]* > -- APU2 -- > /sys/class/dmi/id/bios_date:03/07/2016 > /sys/class/dmi/id/bios_vendor:coreboot > /sys/class/dmi/id/bios_version:88a4f96 > /sys/class/dmi/id/board_asset_tag: > /sys/class/dmi/id/board_name:apu2 > /sys/class/dmi/id/board_serial:123456789 > /sys/class/dmi/id/board_vendor:PC Engines > /sys/class/dmi/id/board_version:1.0 > /sys/class/dmi/id/chassis_asset_tag: > /sys/class/dmi/id/chassis_serial: > /sys/class/dmi/id/chassis_type:3 > /sys/class/dmi/id/chassis_vendor:PC Engines > /sys/class/dmi/id/chassis_version: > /sys/class/dmi/id/product_name:apu2 > /sys/class/dmi/id/product_serial:123456789 > /sys/class/dmi/id/product_version:1.0 > -- > > And that is one of the more accurately defined boards, many are loaded with "To Be Filled By O.E.M". Yes I tested it, for the Jetway boards you won't get useful informations this way (also not with "dmidecode") :-(. > As suggested below, some hash of the CPU model and the first 3 bytes of the ethernet MAC address would be a better indicator. > > Lonnie > > > On Mar 1, 2018, at 10:39 AM, Lonnie Abelbeck <li...@lo...> wrote: > >> Hi Michael, >> >> There is no direct string containing the vendor/model. By default we don't include the dmidecode command which can retrieve BIOS info, but not always accurate or useful. >> >> A couple ideas ... (example APU2) >> >> # cat /proc/cpuinfo | sed -n -r 's/^model name[[:space:]]*:[[:space:]]*(.+)$/\1/p' >> AMD GX-412TC SOC >> AMD GX-412TC SOC >> AMD GX-412TC SOC >> AMD GX-412TC SOC >> >> You could generate a unique hash string from that ... >> >> # cat /proc/cpuinfo | sed -n -r 's/^model name[[:space:]]*:[[:space:]]*(.+)$/\1/p' | tr -d ' \t' | sha1sum | cut -c 1-8 >> 4e908e0f >> >> Of course this is not totally unique, but for the common boards used with AstLinux it would probably be unique. But you would have to map the hash to a human readable string. >> >> You could further refine it using the MAC address of the NIC's >> >> # ip -o link show | sed -n -r 's#^.*link/ether ([0-9a-fA-F:]+).*$#\1#p' >> 00:0d:b9:01:02:24 >> 00:0d:b9:01:02:25 >> 00:0d:b9:01:02:26 >> 00:0d:b9:01:02:25 >> >> Get the Vendor of the first MAC ... >> >> # ip -o link show | sed -n -r 's#^.*link/ether ([0-9a-fA-F:]+).*$#\1#p' | xargs mac2vendor >> PC Engines GmbH >> >> You can create a very simple shell script to qualify your vendor/model. >> -- >> #!/bin/sh >> >> echo "Network Hardware: $(ip -o link show | sed -n -r 's#^.*link/ether ([0-9a-fA-F:]+).*$#\1#p' | xargs mac2vendor)" >> >> echo "Memory: $(awk '/^MemTotal:/ { print int(($2 + 512) / 1024) }' /proc/meminfo) MB" >> >> case $(cat /proc/cpuinfo | sed -n -r 's/^model name[[:space:]]*:[[:space:]]*(.+)$/\1/p' | tr -d ' \t' | sha1sum | cut -c 1-8) in >> 4e908e0f) echo "PC Engines APU2" ;; >> f24bfcb8) echo "Jetway NF9HG-2930" ;; >> 173fdaba) echo "Soekris net5501" ;; >> *) echo "Model Unknown" ;; >> esac >> -- >> >> Output for APU2: >> -- >> Network Hardware: PC Engines GmbH >> Memory: 3881 MB >> PC Engines APU2 >> -- >> >> Lonnie >> >> On Mar 1, 2018, at 4:49 AM, Michael Knill <mic...@ip...> wrote: >> >>> Ah whoops sorry. Wrong terminology. >>> I meant board vendor/model etc. E.g. is it an APU1, APU2, Jetway ???? >>> >>> Regards >>> Michael Knill >>> On 1/3/18, 9:39 pm, "Michael Keuter" <li...@mk...> wrote: >>> >>>> Am 01.03.2018 um 11:25 schrieb Michael Knill <mic...@ip...>: >>>> >>>> Hi Group >>>> >>>> Is there an easy way to find what board type you have installed in an Astlinux box? >>>> Im starting to lose track of what I have installed ☹ >>>> >>>> Regards >>>> Michael Knill >>> >>> "cat /proc/cmdline" >>> >>> This is from the file: >>> >>> "/oldroot/cdrom/os/astlinux-xxx.run.conf" >>> >>> you can see in the line KCMD under "astlinux=xxx" the board type. >>> >>> Michael Michael http://www.mksolutions.info |