Method: GrubConfig#config_for_platform

Defined in:
lib/resources/grub_conf.rb

#config_for_platform(path) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/resources/grub_conf.rb', line 33

def config_for_platform(path)
  os = inspec.os
  if os.redhat? || os[:name] == 'fedora'
    config_for_redhatish(path)
  elsif os.debian?
    @conf_path = path || '/boot/grub/grub.cfg'
    @defaults_path = '/etc/default/grub'
    @version = 'grub2'
  elsif os[:name] == 'amazon' # rubocop:disable Style/GuardClause
    @conf_path = path || '/etc/grub.conf'
    @version = 'legacy'
  else
    fail UnknownGrubConfig
  end
end