Commit Graph

25 Commits

Author SHA1 Message Date
David Cassany
70bf9e98de
Fix the patch applied on grub.cfg
This commit fixes the patch applied on grub.cfg when EFI mode is
selected and grub < 2.04. There are some distros that make use of the
`linux16` command instead of `linux` in grub configuration, this commit
extends the regex to also consider `linux16` command.
2020-05-26 12:41:15 +02:00
Marcus Schäfer
024c3b6834
Fix scope for linuxefi grub config adaption
In kiwi we support a one time patch for the grub config file
that changes the static use of linuxefi to be dynamic. In
grub2 >= 2.04 all this has already been fixed but for grub2
version older than this version we applied the patch. The
patch however was only applied based on the presence of a
grub setting named GRUB_USE_LINUXEFI. It has turned out that
this variable is a custom extension not part of grub upstream
which makes the test functional only on distributions that
supports this setting. The use of linuxefi however is code
that belongs to grub upstream. Therefore this patch changes
the scope of the one time patch to be only based on the
version of grub no matter if GRUB_USE_LINUXEFI is supported
by the distro or not. This Fixes #1453
2020-05-25 12:33:19 +02:00
Marcus Schäfer
9218a9abdb
Fixed root device setup in vendor grubenv
In addition to the root device setup in grub.cfg we also
need to patch the vendor grubenv file which contains an
invalid kernelopts value written by grub2-mkconfig under
the conditions explained in Issue #1287. This Fixes
Issue #1454
2020-05-23 19:22:05 +02:00
Marcus Schäfer
9fddb90a6b
Allow setup of serial line in bootloader
So far kiwi used a static serial line setup of the console
type was configured to use a serial console. However if
different parameters are needed there was no way to change
the static setup. This commit adds a new bootloader attribute
called serial_line which allows to specify the serial line
parameters for the grub bootloader e.g

    serial_line="serial --speed=9600 --unit=0 --word=8 --parity=no --stop=1"

Please note serial_line takes the value as it is given and
adds this as a line to the grub configuration or as content
to the variable GRUB_SERIAL_COMMAND. No further validation
of the information takes place by kiwi. This Fixes #1401
2020-05-13 11:25:42 +02:00
Marcus Schäfer
d276394660
Support grub timeout_style parameter
Grub supports a style setting that influences the display of
the menu depending on the configured timeout value. With this
patch kiwi allows to specify the style via a new bootloader
parameter named timeout_style="hidden|countdown". If not set
the grub default applies which shows the menu in any case.
This Fixes bsc#1165730 and Fixes #1404
2020-05-11 12:38:28 +02:00
Marcus Schäfer
feaf6b0863
Refactor setup of bootloader parameters
The bootloader settings are handled through attributes in the
type element. Over the years some attributes were added and
there are requests for more settings. Therefore the bootloader
setup deservers its own section. With this commit the schema
changes from v7.1 to v7.2 and moves bootloader, bootloader_console
boottimeout and zipl_targettype into a new bootloader subsection
below type. The commit also adds an auto transformation template
such that customers don't have to change their image descriptions.
This is related to Issue #1401
2020-05-08 13:30:43 +02:00
Marcus Schäfer
43c00d0b09
Use auto video mode as default for grub
An explicit video mode 800x600 was used for grub if no
video mode setup exists in the XML description. For grub
this should better result in the auto mode. Related to
bsc#1165730
2020-04-29 11:20:14 +02:00
Marcus Schäfer
7e836ad7a5
Do not set GRUB_DISTRIBUTOR
grub mkconfig creates a proper string based on /etc/os-release
if GRUB_DISTRIBUTOR is not set. We assume this to be true
for all distributions. This Fixes #1416
2020-04-28 17:49:20 +02:00
Marcus Schäfer
f6b3b14020
Fixed return value from _get_grub2_mkconfig_tool
The method returned the basename of the tool if it could
be found by Path.which(). But the method's scope has been
changed in a way that the return value of the method must
be the result from Path.which() to allow working on the
full path name.
2020-04-16 11:24:28 +02:00
Marcus Schäfer
a46c56a546
Validate use of GRUB_USE_LINUXEFI
On systems that uses GRUB_USE_LINUXEFI with grub2 version
less than 2.04 there is no support for dynamic EFI
environment checking. In this condition we extend the grub
setup to add this support. The change kiwi does is as
follows:

* Apply only on grub < 2.04
  1. Modify 10_linux to set linux/initrd as variables
  2. Write hybrid setup as 01_efihybrid

This Fixes bsc#1165960 and bsc#1168480
2020-04-15 15:24:13 +02:00
David Cassany
fe3c2f3c73
Add SECURE_BOOT parameter for grub2 in efi mode
This commit adds the SECURE_BOOT parameter on bootloader sysconfig
for grub2.

Fixes bsc#1167746
2020-03-26 15:38:47 +01:00
Marcus Schäfer
e566153138
Fixed bootloader install
Mount EFI partition in any case not only for the shim target
2020-03-20 17:53:28 +01:00
David Cassany
1466a6c69a
Make use of Path.which including root_dir parameter
This commit refactors the use of Path.which in several parts of the
code. Since dd4d2ed78 the Path utility is capable to run Path.which
on certain chroot env, thus no need to adapt the PATH environment
variable.

Fixes #1281
2020-01-22 16:12:08 +01:00
David Cassany
2e271b882d
Fix grub2 configuration for shim fallback setup
If shim fallback setup is enabled the grub.cfg is copied to the EFI
partition. This commit makes sure that the grub.cfg is copied to the EFI
partition according to the efi mount point.

Fixes bsc#1159235
2019-12-18 18:51:59 +01:00
386aecb36e
Merge pull request #1284 from OSInside/fix_grub_default_setup
Fixed setup of default grub config
2019-11-29 11:54:06 -05:00
Marcus Schäfer
9a9e62018f
Fixed setup of default grub config
In /etc/default/grub GRUB_CMDLINE_LINUX_DEFAULT also contained
the root= information. If grub2-mkconfig runs with that information
it places the root device information twice because grub2-mkconfig
resolves this information itself. This commit prevents the root=
information to be placed in the default grub config and
Fixes bsc#1156908
2019-11-29 17:36:54 +01:00
Marcus Schäfer
f7d89f9868
Lookup distribution specific grub font dir
In addition to the generic grub font directory also lookup
distribution specific font paths in the system and copy the
grub unicode font into it. This Fixes #1253
2019-11-28 14:43:02 +01:00
David Cassany
c8ec226664
Include grub.cfg inside the efi partition
This commit ensures the grub.cfg file is included within the vfat efi
partition.

This fixes #1271 and bsc#1157354
2019-11-22 09:39:59 +01:00
Marcus Schäfer
726eeacee5
Fixed zipl bootloader setup for s390 images
The preparation to call zipl and the call itself were wrong.
For whatever reason the kernel image the initrd are moved
to another location prior to calling zipl. That move broke
the system because no kernel/initrd existed at the expected
place anymore. In addition the zipl call itself was issued
from a the wrong directory. Also no config file was written
as an after effect of the refactoring in Issue #1194. This
Fixes #1173 and bsc#1156694
2019-11-14 12:01:06 +01:00
David Cassany
60659a2dde
Ensure grub.cfg is copied in EFI/BOOT folder
This commit fixes the live images in efi mode. Grub configuration file
is copied to the correct location in <boot_dir>/EFI/BOOT.

Fixes bsc#1155815
2019-11-06 12:58:49 +01:00
Marcus Schäfer
416116cded
Merge pull request #1252 from martinezjavier/enable-bls
Enable BLS configuration if is supported
2019-10-28 10:49:59 +01:00
Javier Martinez Canillas
9d8ce7eedb
Enable BLS configuration if is supported
Fedora now uses a BLS configuration by default, but this is not supported
by all distributions. So check if is supported by the grub2-mkconfig tool
and only enable the option if that's the case.

Fixes: #1248
2019-10-25 18:05:02 +02:00
Marcus Schäfer
66f735c109
Delete left over print statement from unit test 2019-10-25 15:10:42 +02:00
Marcus Schäfer
bdb7123fa1
Refactor use of logging facility
Use getLogger method instead of a global log object
Also use caplog fixture to capture log messages in
unit tests. This Fixes #1244
2019-10-23 17:54:27 +02:00
David Cassany
4b3a105026
Re-structure unit tests folders
This commit relocates unit tests to a folder structure that matches
the source code structure.

Fixes #1128
2019-10-21 14:00:05 +02:00