cfa_grub2 1.0.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/cfa/grub2/default.rb +6 -4
- data/lib/cfa/grub2/device_map.rb +4 -2
- data/lib/cfa/grub2/grub_cfg.rb +4 -2
- data/lib/cfa/grub2/install_device.rb +3 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 890fcf07a4b2ff7f2dfb61b0d6ccd49da05dd711af20cfcb12e603f789fc5755
|
4
|
+
data.tar.gz: 3ab9c2f8db91d235e3776eb119a9aff04ffaf558e435c76ba1752b33dfc42ae2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e5dbf9abfcb38e1037e2d90982bf5ae24d5e627bdf0798c9f8cbba15d21a974eb3925b577309ba3ceb85a1d069258e8f06e64007f8d2590791afb85b978750a
|
7
|
+
data.tar.gz: c0e0192cbb31b604e29ba2d054e8dddee654b40325df2f05ec2709c02708b605bb56137085380eeb4baf495c402377257cba67f0d62cd613e26e3043b6252698
|
data/lib/cfa/grub2/default.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "cfa/base_model"
|
2
4
|
require "cfa/augeas_parser"
|
3
5
|
require "cfa/placer"
|
@@ -24,14 +26,14 @@ module CFA
|
|
24
26
|
timeout: "GRUB_TIMEOUT"
|
25
27
|
)
|
26
28
|
|
27
|
-
PATH = "/etc/default/grub"
|
29
|
+
PATH = "/etc/default/grub"
|
28
30
|
|
29
31
|
def initialize(file_handler: nil)
|
30
32
|
super(AugeasParser.new("sysconfig.lns"), PATH,
|
31
33
|
file_handler: file_handler)
|
32
34
|
end
|
33
35
|
|
34
|
-
def save
|
36
|
+
def save
|
35
37
|
# serialize kernel params object before save
|
36
38
|
kernels = [@kernel_params, @xen_hypervisor_params, @xen_kernel_params,
|
37
39
|
@recovery_params]
|
@@ -99,7 +101,7 @@ module CFA
|
|
99
101
|
|
100
102
|
def cryptodisk
|
101
103
|
@cryptodisk ||= BooleanValue.new("GRUB_ENABLE_CRYPTODISK", self,
|
102
|
-
|
104
|
+
true_value: "y", false_value: "n")
|
103
105
|
end
|
104
106
|
|
105
107
|
VALID_TERMINAL_OPTIONS = [:serial, :console, :gfxterm].freeze
|
@@ -132,7 +134,7 @@ module CFA
|
|
132
134
|
def terminal=(values)
|
133
135
|
values = [] if values.nil?
|
134
136
|
|
135
|
-
msg = "A value is invalid: #{values.inspect}"
|
137
|
+
msg = "A value is invalid: #{values.inspect}"
|
136
138
|
invalid = values.any? { |v| !VALID_TERMINAL_OPTIONS.include?(v) }
|
137
139
|
raise ArgumentError, msg if invalid
|
138
140
|
|
data/lib/cfa/grub2/device_map.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "cfa/base_model"
|
2
4
|
require "cfa/augeas_parser"
|
3
5
|
require "cfa/placer"
|
@@ -16,14 +18,14 @@ module CFA
|
|
16
18
|
# Limitation is caused by BIOS Int 13 used by grub2 for selecting boot
|
17
19
|
# device.
|
18
20
|
class DeviceMap < BaseModel
|
19
|
-
PATH = "/boot/grub2/device.map"
|
21
|
+
PATH = "/boot/grub2/device.map"
|
20
22
|
|
21
23
|
def initialize(file_handler: nil)
|
22
24
|
super(AugeasParser.new("device_map.lns"), PATH,
|
23
25
|
file_handler: file_handler)
|
24
26
|
end
|
25
27
|
|
26
|
-
def save
|
28
|
+
def save
|
27
29
|
raise "Too many grub devices. Limit is 8." if grub_devices.size > 8
|
28
30
|
|
29
31
|
super
|
data/lib/cfa/grub2/grub_cfg.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "cfa/base_model"
|
2
4
|
|
3
5
|
module CFA
|
@@ -7,7 +9,7 @@ module CFA
|
|
7
9
|
#
|
8
10
|
# - List of generated sections including translations
|
9
11
|
class GrubCfg < BaseModel
|
10
|
-
PATH = "/boot/grub2/grub.cfg"
|
12
|
+
PATH = "/boot/grub2/grub.cfg"
|
11
13
|
|
12
14
|
# @private only internal parser
|
13
15
|
class Parser
|
@@ -25,7 +27,7 @@ module CFA
|
|
25
27
|
|
26
28
|
def self.serialize(_string)
|
27
29
|
raise NotImplementedError,
|
28
|
-
|
30
|
+
"Serializing not implemented, use grub2 generator"
|
29
31
|
end
|
30
32
|
|
31
33
|
def self.empty
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "cfa/base_model"
|
2
4
|
|
3
5
|
module CFA
|
@@ -36,7 +38,7 @@ module CFA
|
|
36
38
|
|
37
39
|
# Model representing configuration in file /etc/default/grub_installdevice
|
38
40
|
class InstallDevice < BaseModel
|
39
|
-
PATH = "/etc/default/grub_installdevice"
|
41
|
+
PATH = "/etc/default/grub_installdevice"
|
40
42
|
|
41
43
|
def initialize(file_handler: nil)
|
42
44
|
super(InstallDeviceParser, PATH, file_handler: file_handler)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cfa_grub2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josef Reidinger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cfa
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0
|
19
|
+
version: '1.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0
|
26
|
+
version: '1.0'
|
27
27
|
description: Models allowing easy read and modification of GRUB2 configuration files.
|
28
28
|
It is a plugin for cfa framework.
|
29
29
|
email:
|