The serial number of the board in use is not displayed when invoking show version
vyos@vyos:~$ show version Version: VyOS 1.2.1 Built by: Sentrium S.L. Built on: Sun 14 Apr 2019 12:13 UTC Build ID: 4ccd819a-db31-452e-b34b-a0b24af4e984 Architecture: x86_64 Boot via: installed image System type: bare metal Hardware vendor: PC Engines Hardware model: apu4 Hardware S/N: Unknown Hardware UUID: Unknown Copyright: VyOS maintainers and contributors
Calling dmidecode unveils the proper serial number:
root@vyos:/home/vyos# dmidecode
# dmidecode 2.12
SMBIOS 2.7 present.
7 structures occupying 307 bytes.
Table at 0xDFFD7020.
Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
Vendor: coreboot
Version: v4.0.24
Release Date: 02/04/2019
ROM Size: 8192 kB
Characteristics:
PCI is supported
PC Card (PCMCIA) is supported
BIOS is upgradeable
Selectable boot is supported
ACPI is supported
Targeted content distribution is supported
BIOS Revision: 4.0
Firmware Revision: 0.0
Handle 0x0001, DMI type 1, 27 bytes
System Information
Manufacturer: PC Engines
Product Name: apu4
Version: 1.0
Serial Number: 13xxxxx
UUID: Not Settable
Wake-up Type: Reserved
SKU Number: 4 GB
Family: Not Specified
Handle 0x0002, DMI type 2, 8 bytes
Base Board Information
Manufacturer: PC Engines
Product Name: apu4
Version: 1.0
Serial Number: 13xxxxxThe problem is that the script gathering all the information /usr/libexec/vyos/op_mode/version.py required root priviledges to access certain files in /sys/class/dmi as indicated by the code itself:
# These two assume script is run as root, normal users can't access those files
version_data['hardware_serial'] = read_file('/sys/class/dmi/id/subsystem/id/product_serial')
version_data['hardware_uuid'] = read_file('/sys/class/dmi/id/subsystem/id/product_uuid')