• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

yast / yast-bootloader / 11823138700

13 Nov 2024 06:04PM UTC coverage: 87.695% (+0.3%) from 87.378%
11823138700

Pull #707

github

schubi2
parent <a class=hub.com/yast/yast-bootloader/commit/f931f86756ce867e928721fb823ce7e869ea1fd9">f931f8675
author Stefan Schubert <schubi@suse.de> 1729782721 +0200
committer Stefan Schubert <schubi@suse.de> 1731520801 +0100

parent f931f86756ce867e928721fb823ce7e869ea1fd9
author Stefan Schubert <schubi@suse.de> 1729782721 +0200
committer Stefan Schubert <schubi@suse.de> 1731520720 +0100

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2-bls

grub2-bls

grub2-bls

grub2-bls

grub2-bls

grub2-bls

grub2-bls

grub2-bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

rubocop

rubocop

grub2bls

grub2bls

grub2bls

sync text about secure boot on s390 to be correct (bsc#1219989)

make rubocop happy

rubocop

rubocop

fixed test cases

fixed test cases

grub2bls

grub2bls

grub2bls

grub2bls

grub2bls

rubocop

rubocop

rubocop

rubocop

rubocop

docu

added yast-bootloader

added yast-bootloader

removed merge conflict

added grafic

added grafic

added grafic

merged with master

adapt more tests

make rubocop happy

merged with master

package
Pull Request #707: Supporting Grub2-BLS

309 of 352 new or added lines in 14 files covered. (87.78%)

138 existing lines in 10 files now uncovered.

3371 of 3844 relevant lines covered (87.7%)

13.03 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

87.18
/src/lib/bootloader/systemdboot_widgets.rb
1
# frozen_string_literal: true
2

3
require "yast"
1✔
4
require "bootloader/generic_widgets"
1✔
5
require "bootloader/systeminfo"
1✔
6

7
Yast.import "UI"
1✔
8
Yast.import "Arch"
1✔
9

10
module Bootloader
1✔
11
  module SystemdBootWidget
1✔
12
    # Adds to generic widget systemd-boot specific helpers
13
    module SystemdBootHelper
1✔
14
      def systemdboot
1✔
15
        BootloaderFactory.current
5✔
16
      end
17
    end
18

19
    # Represents bootloader timeout value
20
    class TimeoutWidget < CWM::CustomWidget
1✔
21
      include SystemdBootHelper
1✔
22

23
      def initialize
1✔
24
        textdomain "bootloader"
11✔
25

26
        super()
11✔
27

28
        @minimum = 0
11✔
29
        @maximum = 600
11✔
30
        @default = 10
11✔
31
      end
32

33
      attr_reader :minimum, :maximum, :default
1✔
34

35
      def contents
1✔
36
        CheckBoxFrame(
2✔
37
          Id(:cont_boot),
38
          _("Automatically boot the default entry after a timeout"),
39
          false,
40
          HBox(
41
            IntField(Id(:seconds), _("&Timeout in Seconds"), @minimum, @maximum,
42
              systemdboot.menu_timeout.to_i),
43
            HStretch()
44
          )
45
        )
46
      end
47

48
      def help
1✔
49
        _("<p>Continue boot process after defined seconds.</p>" \
1✔
50
          "<p><b>Timeout in Seconds</b>\n" \
51
          "specifies the time the boot loader will wait until the default kernel is loaded.</p>\n")
52
      end
53

54
      def init
1✔
NEW
55
        Yast::UI.ChangeWidget(Id(:cont_boot), :Value, systemdboot.menu_timeout >= 0)
×
NEW
56
        systemdboot.menu_timeout = default_value if systemdboot.menu_timeout < 0
×
NEW
57
        Yast::UI.ChangeWidget(Id(:seconds), :Value, systemdboot.menu_timeout)
×
58
      end
59

60
      def store
1✔
61
        cont_boot = Yast::UI.QueryWidget(Id(:cont_boot), :Value)
1✔
62
        systemdboot.menu_timeout = cont_boot ? Yast::UI.QueryWidget(Id(:seconds), :Value) : -1
1✔
63
      end
64

65
    private
1✔
66

67
      def default_value
1✔
68
        # set default
NEW
69
        ret = Yast::ProductFeatures.GetIntegerFeature("globals",
×
70
          "boot_timeout").to_i
NEW
71
        ret = @default if ret <= 0
×
NEW
72
        ret
×
73
      end
74
    end
75

76
    # Represents switcher for secure boot on EFI
77
    class SecureBootWidget < CWM::CheckBox
1✔
78
      include SystemdBootHelper
1✔
79

80
      def initialize
1✔
81
        textdomain "bootloader"
4✔
82

83
        super
4✔
84
      end
85

86
      def label
1✔
87
        _("&Secure Boot Support")
1✔
88
      end
89

90
      def help
1✔
91
        _(
1✔
92
          "<p><b>Secure Boot Support</b> if checked enables Secure Boot support.<br>" \
93
          "This does not turn on secure booting. " \
94
          "It only sets up the boot loader in a way that supports secure booting. " \
95
          "You still have to enable Secure Boot in the UEFI Firmware.</p> "
96
        )
97
      end
98

99
      def init
1✔
100
        self.value = systemdboot.secure_boot
1✔
101
      end
102

103
      def store
1✔
104
        systemdboot.secure_boot = value
1✔
105
      end
106
    end
107

108
    # represents Tab with kernel related configuration
109
    class KernelTab < CWM::Tab
1✔
110
      def label
1✔
111
        textdomain "bootloader"
1✔
112

113
        _("&Kernel Parameters")
1✔
114
      end
115

116
      def contents
1✔
117
        VBox(
1✔
118
          VSpacing(1),
119
          MarginBox(1, 0.5, KernelAppendWidget.new),
120
          MarginBox(1, 0.5, Left(CpuMitigationsWidget.new)),
121
          VStretch()
122
        )
123
      end
124
    end
125

126
    # Represent tab with options related to stage1 location and bootloader type
127
    class BootCodeTab < CWM::Tab
1✔
128
      include SystemdBootHelper
1✔
129

130
      def label
1✔
131
        textdomain "bootloader"
1✔
132

133
        _("Boot Co&de Options")
1✔
134
      end
135

136
      def contents
1✔
137
        VBox(
1✔
138
          VSpacing(1),
139
          HBox(
140
            HSpacing(1),
141
            Left(LoaderTypeWidget.new)
142
          ),
143
          VSpacing(1),
144
          *widgets,
145
          VStretch()
146
        )
147
      end
148

149
    private
1✔
150

151
      def widgets
1✔
152
        w = []
1✔
153
        if Yast::Stage.initial && # while new installation only (currently)
1✔
154
            secure_boot_widget?
UNCOV
155
          w << SecureBootWidget.new
×
156
        end
157

158
        w.map do |widget|
1✔
UNCOV
159
          MarginBox(horizontal_margin, 0, Left(widget))
×
160
        end
161
      end
162

163
      def horizontal_margin
1✔
UNCOV
164
        @horizontal_margin ||= Yast::UI.TextMode ? 1 : 1.5
×
165
      end
166

167
      def secure_boot_widget?
1✔
UNCOV
168
        Systeminfo.secure_boot_available?(systemdboot.name)
×
169
      end
170
    end
171

172
    # Represents bootloader specific options like its timeout,
173
    # default section or password protection
174
    class BootloaderTab < CWM::Tab
1✔
175
      def label
1✔
176
        textdomain "bootloader"
1✔
177

178
        _("Boot&loader Options")
1✔
179
      end
180

181
      def contents
1✔
182
        VBox(
1✔
183
          VSpacing(2),
184
          HBox(
185
            HSpacing(1),
186
            TimeoutWidget.new,
187
            HSpacing(1)
188
          ),
189
          VStretch()
190
        )
191
      end
192
    end
193
  end
194
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc