Class: Yast::InstFunctionsClass
- Inherits:
-
Module
- Object
- Module
- Yast::InstFunctionsClass
- Defined in:
- ../../src/modules/InstFunctions.rb
Instance Method Summary (collapse)
-
- (Boolean) feature_ignored?(feature_name)
Returns whether feature was set to be ignored, see ignored_features().
-
- (Array) ignored_features
Returns list of ignored features defined via Linuxrc commandline.
- - (Object) main
-
- (Object) reset_ignored_features
Resets the stored ignored features Used for easier testing.
-
- (Boolean) second_stage_required?
(also: #second_stage_required)
Determines if the second stage should be executed.
Instance Method Details
- (Boolean) feature_ignored?(feature_name)
Returns whether feature was set to be ignored, see ignored_features()
92 93 94 95 96 97 98 99 100 |
# File '../../src/modules/InstFunctions.rb', line 92 def feature_ignored?(feature_name) if feature_name.nil? Builtins.y2warning("Undefined feature to check") return false end feature = polish(feature_name) ignored_features.include?(feature) end |
- (Array) ignored_features
Returns list of ignored features defined via Linuxrc commandline
-
Allowed format is ignore[_]feature=$feature1[,$feature2,]
-
Multiple ignored_features are allowed on one command line
-
Command and features are case-insensitive and all dashes, underscores and dots are ignored to be compatible with Linuxrc, see #polish and en.opensuse.org/SDB:Linuxrc#Passing_parameters
-
If entries are also mentioned in PTOptions, they do not appear in 'Cmdline' but as separate entries, see en.opensuse.org/SDB:Linuxrc#p_ptoptions
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 |
# File '../../src/modules/InstFunctions.rb', line 55 def ignored_features return @ignored_features if @ignored_features # Features defined as individual entries in install.inf features_keys = Linuxrc.keys.select do |key| polish(key) =~ /^ignored?features?$/ end unparsed_features = features_keys.map do |key| polish(Linuxrc.InstallInf(key)) end # Features mentioned in 'Cmdline' entry, it might not be defined (bnc#861465) cmdline = polish(Linuxrc.InstallInf("Cmdline") || "").split cmdline_features = cmdline.select do |cmd| cmd =~ /^ignored?features?=/i end cmdline_features.collect! do |feature| feature.gsub(/^ignored?features?=(.*)/i, '\1') end # Both are supported together ignored_features = unparsed_features + cmdline_features @ignored_features = ignored_features.map { |f| f.split(",") }.flatten.uniq end |
- (Object) main
33 34 35 36 37 38 39 40 41 |
# File '../../src/modules/InstFunctions.rb', line 33 def main textdomain "installation" Yast.import "Linuxrc" Yast.import "AutoinstConfig" Yast.import "Stage" Yast.import "Mode" Yast.import "ProductControl" end |
- (Object) reset_ignored_features
Resets the stored ignored features Used for easier testing
84 85 86 |
# File '../../src/modules/InstFunctions.rb', line 84 def reset_ignored_features @ignored_features = nil end |
- (Boolean) second_stage_required? Also known as: second_stage_required
Determines if the second stage should be executed
Checks Mode, AutoinstConfig and ProductControl to decide if it's needed.
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
# File '../../src/modules/InstFunctions.rb', line 108 def second_stage_required? return false unless Stage.initial # the current one is 'initial' if (Mode.autoinst || Mode.autoupgrade) && !AutoinstConfig.second_stage run_second_stage = false Builtins.y2milestone("Autoyast: second stage is disabled") else # after reboot/kexec it would be 'continue' stage_to_check = "continue" # for matching the control file mode_to_check = Mode.mode Builtins.y2milestone( "Checking RunRequired (%1, %2)", stage_to_check, mode_to_check ) run_second_stage = ProductControl.RunRequired(stage_to_check, mode_to_check) end run_second_stage end |