Sha256: e61f6774b7fbbbdce0aef866a87f7e30edcb8660e772728950f583cc402cd72f

Contents?: true

Size: 1.19 KB

Versions: 29

Compression:

Stored size: 1.19 KB

Contents

# frozen_string_literal: true

module Facter
  module Resolvers
    module Freebsd
      class DmiBios < BaseResolver
        init_resolver

        class << self
          #:model

          private

          def post_resolve(fact_name, _options)
            @fact_list.fetch(fact_name) { read_facts(fact_name) }
          end

          def read_facts(fact_name)
            require_relative 'ffi/ffi_helper'

            @fact_list[:bios_date]    = Facter::Freebsd::FfiHelper.kenv(:get, 'smbios.bios.reldate')
            @fact_list[:bios_vendor]  = Facter::Freebsd::FfiHelper.kenv(:get, 'smbios.bios.vendor')
            @fact_list[:bios_version] = Facter::Freebsd::FfiHelper.kenv(:get, 'smbios.bios.version')

            @fact_list[:product_name]   = Facter::Freebsd::FfiHelper.kenv(:get, 'smbios.system.product')
            @fact_list[:product_serial] = Facter::Freebsd::FfiHelper.kenv(:get, 'smbios.system.serial')
            @fact_list[:product_uuid]   = Facter::Freebsd::FfiHelper.kenv(:get, 'smbios.system.uuid')

            @fact_list[:sys_vendor] = Facter::Freebsd::FfiHelper.kenv(:get, 'smbios.system.maker')

            @fact_list[fact_name]
          end
        end
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
facter-4.5.2 lib/facter/resolvers/freebsd/dmi.rb
facter-4.5.1 lib/facter/resolvers/freebsd/dmi.rb
facter-4.5.0 lib/facter/resolvers/freebsd/dmi.rb
facter-4.4.3 lib/facter/resolvers/freebsd/dmi.rb
facter-4.4.2 lib/facter/resolvers/freebsd/dmi.rb
facter-4.4.1 lib/facter/resolvers/freebsd/dmi.rb
facter-4.4.0 lib/facter/resolvers/freebsd/dmi.rb
facter-4.3.1 lib/facter/resolvers/freebsd/dmi.rb
facter-4.3.0 lib/facter/resolvers/freebsd/dmi.rb
facter-4.2.14 lib/facter/resolvers/freebsd/dmi.rb
facter-4.2.13 lib/facter/resolvers/freebsd/dmi.rb
facter-4.2.12 lib/facter/resolvers/freebsd/dmi.rb
facter-4.2.11 lib/facter/resolvers/freebsd/dmi.rb
facter-4.2.10 lib/facter/resolvers/freebsd/dmi.rb
facter-4.2.9 lib/facter/resolvers/freebsd/dmi.rb
facter-4.2.8 lib/facter/resolvers/freebsd/dmi.rb
facter-4.2.7 lib/facter/resolvers/freebsd/dmi.rb
facter-4.2.6 lib/facter/resolvers/freebsd/dmi.rb
facter-4.2.5 lib/facter/resolvers/freebsd/dmi.rb
facter-4.2.4 lib/facter/resolvers/freebsd/dmi.rb