Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow value of GRUB_TERMINAL to be empty #2346

Merged
merged 3 commits into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions kiwi/bootloader/config/grub2.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,10 @@ def post_init(self, custom_args):
if self.custom_args and 'config_options' in self.custom_args:
self.config_options = self.custom_args['config_options']

self.terminal = self.xml_state.get_build_type_bootloader_console() \
or 'gfxterm'
self.terminal = self.xml_state.get_build_type_bootloader_console()
if self.terminal is None:
self.terminal = 'gfxterm'

self.gfxmode = self.get_gfxmode('grub2')
self.theme = self.get_boot_theme()
self.timeout = self.get_boot_timeout_seconds()
Expand Down
2 changes: 1 addition & 1 deletion kiwi/schema/kiwi.rnc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ vhd-tag-type = xsd:token {pattern = "[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}"}
groups-list = xsd:token {pattern = "[a-zA-Z0-9_\-\.:]+(,[a-zA-Z0-9_\-\.:]+)*"}
arch-name = xsd:token {pattern = "(x86_64|i586|i686|ix86|aarch64|arm64|armv5el|armv5tel|armv6hl|armv6l|armv7hl|armv7l|ppc|ppc64|ppc64le|s390|s390x|riscv64)(,(x86_64|i586|i686|ix86|aarch64|arm64|armv5el|armv5tel|armv6hl|armv6l|armv7hl|armv7l|ppc|ppc64|ppc64le|s390|s390x|riscv64))*"}
portnum-type = xsd:token {pattern = "(\d+|\d+/(udp|tcp))"}
grub_console = xsd:token {pattern = "(console|gfxterm|serial)( (console|gfxterm|serial))*"}
grub_console = xsd:token {pattern = "(\s*|console|gfxterm|serial)( (console|gfxterm|serial))*"}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we make this more explicit by providing a none console type ? Something like this

grub_console = xsd:token {pattern = "(none|console|gfxterm|serial)( (console|gfxterm|serial))*"}

It imho makes it more clear what is expected to happen with the console setting and could also be
found better in the documentation.

Talking about the docs, could you add some words about this in
doc/source/image_description/elements.rst

Thanks much

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@leifliddy any thoughts ? Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, that makes perfect sense. Sorry, I was on a motorcycle trip over the last several days. I'll try and make these changes tonight.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

excellent thanks much 👍

fs_attributes = xsd:token {pattern = "(no-copy-on-write|synchronous-updates)(,(no-copy-on-write|synchronous-updates))*"}
package-version-type = xsd:token {pattern = "(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])(\.(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])){3}"}
simple-uri-type = xsd:token {pattern = "(file:|https:|http:|ftp:).*"}
Expand Down
2 changes: 1 addition & 1 deletion kiwi/schema/kiwi.rng
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
</define>
<define name="grub_console">
<data type="token">
<param name="pattern">(console|gfxterm|serial)( (console|gfxterm|serial))*</param>
<param name="pattern">(\s*|console|gfxterm|serial)( (console|gfxterm|serial))*</param>
</data>
</define>
<define name="fs_attributes">
Expand Down
6 changes: 3 additions & 3 deletions kiwi/xml_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def parsexmlstring_(instring, parser=None, **kwargs):
try:
from generatedssuper import GeneratedsSuper
except ImportError as exp:

class GeneratedsSuper(object):
tzoff_pattern = re_.compile(r'(\+|-)((0\d|1[0-3]):[0-5]\d|14:00)$')
class _FixedOffsetTZ(datetime_.tzinfo):
Expand Down Expand Up @@ -426,7 +426,7 @@ def __eq__(self, other):
return self.__dict__ == other.__dict__
def __ne__(self, other):
return not self.__eq__(other)

def getSubclassFromModule_(module, class_):
'''Get the subclass of a class from a specific module.'''
name = class_.__name__ + 'Sub'
Expand Down Expand Up @@ -5606,7 +5606,7 @@ def validate_grub_console(self, value):
if not self.gds_validate_simple_patterns(
self.validate_grub_console_patterns_, value):
warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_grub_console_patterns_, ))
validate_grub_console_patterns_ = [['^(console|gfxterm|serial)( (console|gfxterm|serial))*$']]
validate_grub_console_patterns_ = [['^(\s*|console|gfxterm|serial)( (console|gfxterm|serial))*$']]
def hasContent_(self):
if (
self.bootloadersettings is not None
Expand Down
Loading