git.sr.ht/~pingoo/stdx@v0.0.0-20240218134121-094174641f6e/sysinfo/board.go (about)

     1  // Copyright © 2016 Zlatko Čalušić
     2  //
     3  // Use of this source code is governed by an MIT-style license that can be found in the LICENSE file.
     4  
     5  package sysinfo
     6  
     7  // Board information.
     8  type Board struct {
     9  	Name     string `json:"name,omitempty"`
    10  	Vendor   string `json:"vendor,omitempty"`
    11  	Version  string `json:"version,omitempty"`
    12  	Serial   string `json:"serial,omitempty"`
    13  	AssetTag string `json:"assettag,omitempty"`
    14  }
    15  
    16  func (si *SysInfo) getBoardInfo() {
    17  	si.Board.Name = slurpFile("/sys/class/dmi/id/board_name")
    18  	si.Board.Vendor = slurpFile("/sys/class/dmi/id/board_vendor")
    19  	si.Board.Version = slurpFile("/sys/class/dmi/id/board_version")
    20  	si.Board.Serial = slurpFile("/sys/class/dmi/id/board_serial")
    21  	si.Board.AssetTag = slurpFile("/sys/class/dmi/id/board_asset_tag")
    22  }