/
bootloader_auto_client.rb
101 lines (80 loc) · 1.77 KB
/
bootloader_auto_client.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# encoding: utf-8
# File:
# bootloader_auto.ycp
#
# Module:
# Bootloader installation and configuration
#
# Summary:
# Bootloader autoinstallation preparation
#
# Authors:
# Jiri Srain <jsrain@suse.cz>
#
# $Id$
#
require "installation/auto_client"
module Bootloader
class BootloaderAutoClient < ::Installation::AutoClient
include Yast::I18n
include Yast::Logger
def initialize
Yast.import "UI"
textdomain "bootloader"
Yast.import "Bootloader"
Yast.import "BootCommon"
Yast.import "Initrd"
Yast.import "Progress"
Yast.import "Mode"
Yast.include self, "bootloader/routines/autoinstall.rb"
Yast.include self, "bootloader/routines/wizards.rb"
end
def run
progress_orig = Yast::Progress.set(false)
super
Yast::Progress.set(@progress_orig)
end
def import(data)
data = AI2Export(data)
if data
ret = Yast::Bootloader.Import(data)
# moved here from inst_autosetup*
if Yast::Stage.initial
Yast::BootCommon.DetectDisks
Yast::Bootloader.Propose
end
else
ret = false
end
ret
end
def summary
formatted_summary = Yast::Bootloader.Summary.map { |l| "<LI>#{l}</LI>" }
"<UL>" + formatted_summary.join("\n") + "</UL>"
end
def modified?
BootCommon.changed
end
def modified
BootCommon.changed = true
end
def reset
Bootloader.Reset
{}
end
def change
BootloaderAutoSequence()
end
def export
Export2AI(Yast::Bootloader.Export)
end
def write
Yast::Bootloader.Write
end
def read
Yast::Initrd.Read
Yast::Bootloader.Read
end
end
end
Yast::BootloaderAutoClient.new.main