Class: Bootloader::AutoinstProfile::BootloaderSection

Inherits:
Installation::AutoinstProfile::SectionWithAttributes
  • Object
show all
Defined in:
src/lib/bootloader/autoinst_profile/bootloader_section.rb

Overview

This class represents an AutoYaST <bootloader> section

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBootloaderSection

Constructor



73
74
75
76
77
# File 'src/lib/bootloader/autoinst_profile/bootloader_section.rb', line 73

def initialize
  super

  @device_map = []
end

Instance Attribute Details

#activateObject

Deprecated.


# File 'src/lib/bootloader/autoinst_profile/bootloader_section.rb', line 49

#device_mapArray<DeviceMapEntrySection>

Returns 'device_map' list.

Returns:



59
60
61
# File 'src/lib/bootloader/autoinst_profile/bootloader_section.rb', line 59

def device_map
  @device_map
end

#globalGlobalSection

Returns 'global' section.

Returns:



57
58
59
# File 'src/lib/bootloader/autoinst_profile/bootloader_section.rb', line 57

def global
  @global
end

#loader_deviceObject

Deprecated.

Replaced by <boot_*> elements in the <global> section.



# File 'src/lib/bootloader/autoinst_profile/bootloader_section.rb', line 46

#loader_typeString

Returns which boot loader to use (default, grub2, grub2-efi and none).

Returns:

  • (String)

    which boot loader to use (default, grub2, grub2-efi and none)

See Also:



# File 'src/lib/bootloader/autoinst_profile/bootloader_section.rb', line 42

#sectionsObject

Deprecated.

It still exists just to log a warning in AutoyastConverter.



# File 'src/lib/bootloader/autoinst_profile/bootloader_section.rb', line 53

Class Method Details

.attributesObject



31
32
33
34
35
36
37
38
# File 'src/lib/bootloader/autoinst_profile/bootloader_section.rb', line 31

def self.attributes
  [
    { name: :loader_type },
    { name: :loader_device }, # deprecated
    { name: :activate }, # deprecated
    { name: :sections } # deprecated
  ]
end

.new_from_hashes(hash) ⇒ Bootloader

Creates an instance based on the profile representation used by the AutoYaST modules (hash with nested hashes and arrays).

Parameters:

  • hash (Hash)

    Bootloader section from an AutoYaST profile

Returns:



66
67
68
69
70
# File 'src/lib/bootloader/autoinst_profile/bootloader_section.rb', line 66

def self.new_from_hashes(hash)
  result = new
  result.init_from_hashes(hash)
  result
end

Instance Method Details

#init_from_hashes(hash) ⇒ Object

Method used by new_from_hashes to populate the attributes.

Parameters:



82
83
84
85
86
87
88
# File 'src/lib/bootloader/autoinst_profile/bootloader_section.rb', line 82

def init_from_hashes(hash)
  super
  @device_map = hash.fetch("device_map", []).map do |entry|
    DeviceMapEntrySection.new_from_hashes(entry, self)
  end
  @global = GlobalSection.new_from_hashes(hash["global"] || {}, self)
end