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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
|
# File '../../src/include/autoinstall/AdvancedPartitionDialog.rb', line 55
def AdvancedPartitionDisplay(part, isPV)
part = deep_copy(part)
result = deep_copy(part)
helpText = _(
"<p><b>Mount in /etc/fstab By:</b>\n" +
"\tNormally, a file system to mount is identified in /etc/fstab\n" +
"\tby the device name. This identification can be changed so the file system to mount\n" +
"\tis found by searching for a UUID or a volume label. Not all file systems can be\n" +
"\tmounted by UUID or a volume label. If an option is disabled, it is not possible.\n" +
"\t"
)
helpText = Ops.add(
helpText,
_(
"<p><b>Volume Label:</b>\n" +
"\t The name entered in this field is used as the volume label. This usually makes sense only \n" +
"\t when you activate the option for mounting by volume label.\n" +
"\t A volume label cannot contain the / character or spaces.\n" +
"\t "
)
)
cryptFrame = CheckBoxFrame(
Id(:cbfCrypt),
_("Encryption"),
encryptionEnabled(part),
TextEntry(
Id(:crypt_key),
_("Encryption key"),
Ops.get_string(part, "crypt_key", "No key set")
)
)
if isPV
cryptFrame = Frame(
_("Encryption"),
Label(_("Encryption is not available for physical volumes"))
)
end
contents = HBox(
HSpacing(1),
HWeight(
70,
HCenter(
VBox(
Heading(_("Advanced Partition Settings")),
VCenter(
VBox(
cryptFrame,
VSpacing(1),
VSquash(
Frame(
_("Fstab options"),
VBox(
Left(Label(_("Mount by"))),
RadioButtonGroup(
Id(:rbgMountBy),
HBox(
Top(
VBox(
mkRadioButton(part, :device, _("Device name")),
mkRadioButton(part, :id, _("Device id")),
mkRadioButton(part, :label, _("Volume label"))
)
),
Top(
VBox(
mkRadioButton(part, :path, _("Device path")),
mkRadioButton(part, :uuid, _("UUID"))
)
)
)
),
Top(
TextEntry(
Id(:volLabel),
_("Volume label"),
Ops.get_string(part, "label", "No options set")
)
)
)
)
),
VSpacing(1),
ButtonBox(
PushButton(Id(:pbCancel), Label.CancelButton),
PushButton(Id(:pbOK), Label.OKButton)
)
)
),
VStretch()
)
)
),
HSpacing(1)
)
UI.OpenDialog(Opt(), contents)
UI.ChangeWidget(
Id(:crypt_key),
:ValidChars,
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#* ,.;:._-+!$%&/|?{[()]}@^\\<>"
)
if isPV
widgets = [:device, :id, :label, :path, :uuid]
Builtins.foreach(widgets) do |widget|
UI.ChangeWidget(Id(widget), :Enabled, false)
end
end
widgetID = nil
widgetID = Convert.to_symbol(UI.UserInput)
while widgetID != :pbCancel && widgetID != :pbOK
if :pbFsOpts == widgetID
Ops.set(result, "fstopt", UI.QueryWidget(Id(:fsOpts), :Value))
UI.ChangeWidget(
Id(:fsOpts),
:Value,
Ops.get_string(result, "fstopt", "")
)
end
widgetID = Convert.to_symbol(UI.UserInput)
end
if :pbCancel == widgetID
UI.CloseDialog
return deep_copy(part)
end
if true == UI.QueryWidget(Id(:cbfCrypt), :Value)
Ops.set(result, "crypt_fs", true)
Ops.set(result, "crypt_key", UI.QueryWidget(Id(:crypt_key), :Value))
Ops.set(result, "crypt", "twofish256")
end
Ops.set(result, "label", UI.QueryWidget(Id(:volLabel), :Value))
Ops.set(result, "mountby", UI.QueryWidget(Id(:rbgMountBy), :Value))
UI.CloseDialog
deep_copy(result)
end
|