cfa_grub2 0.6.3 → 0.6.4

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cfa/grub2/default.rb +16 -8
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2dd1c3360b6cc4a6ddee9e466df84dd939419225
4
- data.tar.gz: bacfa69a00b15fc4a24ddcc3f32a2fbd83169cd4
3
+ metadata.gz: 1da92fc0c60471bb86fa2fd4a2f34fdabfc5f00f
4
+ data.tar.gz: 40dca436f09e1af024629f4fff80610e2c087015
5
5
  SHA512:
6
- metadata.gz: da3abad04fc23659e5c3884754817ad32e7653854634f461472e571437b994d3d4246f8fdf4ee769755a284ab212c9d1c82cb6bafef99fb25b4e907a341a4675
7
- data.tar.gz: abe48fc3bf07252f823f8b67b6db18cb5f3e713ae0766808cf678e6b8f60071a0be9fd8e3841fad29660d4912d90de00b6ab6c9f56e7e910c6fa605858d363ff
6
+ metadata.gz: ce4ab7c565ab5f29cf685345fa6b3b01d027081ae208d3e7f919ec68c9c42fa1e348c30f7319bda4961d6417807bc29acd5e1d494ed52cf7d3afc56dbb48b947
7
+ data.tar.gz: bfa469d565c5acf02fd2d0ba1ef4efa3fc0e07d81b72c7b48120241df15c2e2b7cef08ebbd52f81d6b782b1d2b039ec669a7e367c39b61fbb18d31d7830aad01
@@ -49,7 +49,7 @@ module CFA
49
49
  kernels = [kernel_params, xen_hypervisor_params, xen_kernel_params,
50
50
  recovery_params]
51
51
  kernels.each do |kernel|
52
- param_line = data[kernel.key]
52
+ param_line = value_for(kernel.key)
53
53
  kernel.replace(param_line) if param_line
54
54
  end
55
55
  end
@@ -64,27 +64,28 @@ module CFA
64
64
 
65
65
  def kernel_params
66
66
  @kernel_params ||= KernelParams.new(
67
- data["GRUB_CMDLINE_LINUX_DEFAULT"], "GRUB_CMDLINE_LINUX_DEFAULT"
67
+ value_for("GRUB_CMDLINE_LINUX_DEFAULT"), "GRUB_CMDLINE_LINUX_DEFAULT"
68
68
  )
69
69
  end
70
70
 
71
71
  def xen_hypervisor_params
72
72
  @xen_hypervisor_params ||= KernelParams.new(
73
- data["GRUB_CMDLINE_XEN_DEFAULT"],
73
+ value_for("GRUB_CMDLINE_XEN_DEFAULT"),
74
74
  "GRUB_CMDLINE_XEN_DEFAULT"
75
75
  )
76
76
  end
77
77
 
78
78
  def xen_kernel_params
79
79
  @xen_kernel_params ||= KernelParams.new(
80
- data["GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT"],
80
+ value_for("GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT"),
81
81
  "GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT"
82
82
  )
83
83
  end
84
84
 
85
85
  def recovery_params
86
86
  @recovery_params ||= KernelParams.new(
87
- data["GRUB_CMDLINE_LINUX_RECOVERY"], "GRUB_CMDLINE_LINUX_RECOVERY"
87
+ value_for("GRUB_CMDLINE_LINUX_RECOVERY"),
88
+ "GRUB_CMDLINE_LINUX_RECOVERY"
88
89
  )
89
90
  end
90
91
 
@@ -102,13 +103,14 @@ module CFA
102
103
  end
103
104
 
104
105
  def terminal
105
- case data["GRUB_TERMINAL"]
106
+ value = value_for("GRUB_ENABLE_CRYPTODISK")
107
+ case value
106
108
  when "", nil then nil
107
109
  when "console" then :console
108
110
  when "serial" then :serial
109
111
  when "gfxterm" then :gfxterm
110
112
  else
111
- raise "unknown GRUB_TERMINAL option #{data["GRUB_TERMINAL"].inspect}"
113
+ raise "unknown GRUB_TERMINAL option #{value.inspect}"
112
114
  end
113
115
  end
114
116
 
@@ -127,7 +129,13 @@ module CFA
127
129
  end
128
130
 
129
131
  def serial_console
130
- data["GRUB_SERIAL_COMMAND"]
132
+ value_for("GRUB_SERIAL_COMMAND")
133
+ end
134
+
135
+ private
136
+
137
+ def value_for(key)
138
+ data[key].respond_to?(:value) ? data[key].value : data[key]
131
139
  end
132
140
 
133
141
  # Represents kernel append line with helpers to easier modification.
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: 0.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josef Reidinger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-02 00:00:00.000000000 Z
11
+ date: 2017-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cfa
@@ -56,7 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
56
  version: 1.3.6
57
57
  requirements: []
58
58
  rubyforge_project:
59
- rubygems_version: 2.4.5.2
59
+ rubygems_version: 2.6.11
60
60
  signing_key:
61
61
  specification_version: 4
62
62
  summary: Models for GRUB2 configuration files.