The configuration files /etc/sysconfig/bootloader and
/etc/default/grub needs to be created/updated with the
relevant values regarding the bootloader setup done by
kiwi. This Fixes#226
Storage disks on s390 requires an information about the
type and the blocksize. In case these information is not
provided in the kiwi XML configuration, None was set as
value in the zipl configuration which lead to an error.
This commit provides default values for those parameters
During the grub2 install process volumes were not mounted properly,
a proper mount order was not taken into consideration and LV device
information was not given by the method get_volumes in VolumeManger.
This commit forces the mount (and umount) operations to be done in
coherent order and also modifies the get_volumes method in order
to return the device associated to each volume.
The parameter for the uuid is not enough to handle all
supported disk geometries. If the disk has an extra boot
partition the bootloader setup must read the boot data
from the boot partition but must set the root for the
kernel cmdline to the root partition. Therefore the
interface needs to change and must provide both the
boot_uuid and the root_uuid in oder to allow the method
to setup the correct values
If you want to boot an old snapshot, but not to do a rollback,
we need to tell the kernel which snapshot to use. This patch
also fixes the broken layout of the grub snapshot menu.
grub-snapshot.cfg should not be sourced at the begining, but
at the end of grub.cfg. Else with creating the first snapshot
this entry is getting the default boot target and the system
does not boot automatically anymore.
This addresses the following issues
* An image based on btrfs using the entire boot as a subvolume
causes grub to be unable to find its config file. Thus kiwi
now raises an exception in this situation
* Don't prefix the bootpath with the snapshot path if the
btrfs root is placed in a snapshot. Instead the file
etc/default/grub must be written/updated with the
SUSE_BTRFS_SNAPSHOT_BOOTING variable set to true. Once
this is done the bootpath is consistently set to /boot
no matter which snapshot is active
Provide the shim loader and the shim signed grub loader in the
required boot path. Normally this task is done by the shim-install
tool. However, shim-install does not exist on all distributions
and the script does not operate well in CD environments from which
we generate live and/or install media. Thus shim-install is used
if possible at install time of the bootloader because it requires
access to the target block device. In any other case the kiwi
fallback code applies
If there are volumes below /boot they need to be mounted before
grub2-install / shim-install is called in order to make sure all
data is available in the volume
For EFI secure boot (uefi) the grub2 efi modules were not
copied to the target directory. shim-install normally does
that by invoking grub2-install. However shim-install does
not allow to call grub2-install with the required parameters
as needed for loop (image) based targets. Thus kiwi calls
shim-install but skips grub2-install and takes care to
provide the needed EFI modules.
In order to workaround the bug in shim-install which
unnecessarily calls grub2-install we replace the binary
by a noop before calling shim-install. However all file
attributes of the grub2-install binary, timestamp, modes,
etc should stay untouched (bnc#993825)
Generate a serial line setup for the isolinux.cfg file
according to the bootloader_console attribute from the
XML description. In addition delete the use of the obsolete
vga kernel parameter and work with the MENU RESOLUTION
ui configuration parameter instead
The attribute installboot allows to specify the default boot
menu entry in an install image. It can be set to harddisk,
install or failsafe install. The setup of that information
in the bootloader configuration was not properly processed
Under certain circumstance the root=UUID=<uuid> parameter must be
setup in the cmdline of the image. If the required uuid value
is not provided a warning message is shown to the user. This
commit makes the warning message more meaningful
The check for the theme was not always called, but this
is required since the theme check will reset the bootloader
console if no graphics theme could be found
Some bootloader e.g grub supports graphics, text and also
serial consoles to hand over the output of the bootloader
menu. With this patch we allow to customize the console
used by the bootloader. So far only grub makes use of the
new attribute
<type ... bootloader_console="serial|console|gfxterm"/>
This references Trello:
https://trello.com/c/q9EhNKKV/155-support-for-grub2-serial-console
We can't expect that specific fonts to exist for all theme packages
in all distributions. The code here should rely only on theme.txt
In addition we check if any theme or font related data is found
in the legacy grub location boot/grub which imho should not be
used for grub2
An additional hidden entry allows the user to switch between the
graphics and the serial console by pressing the 't' key. The kiwi
grub2 template adds this switch if the terminal mode is set to
graphics. The additional entries are only effective of the
grub_platform is set to efi. Fixes#80
All mkdtemp created directories are created with the 'kiwi_'
prefix. In addition all code parts which leaves tmpdirs in
the system after kiwi is done were fixed
Not all linux systems installs grub2 below /usr/lib/grub2
For example RHEL7 packages it below /usr/lib/grub. Therefore
kiwi needs to be flexible with this path