Commit Graph

82 Commits

Author SHA1 Message Date
Marcus Schäfer
638f94b551
Fixup grub2 template parameters
The boot_directory_name parameters was missing for live and
install image builds
2017-04-05 11:33:26 +02:00
Marcus Schäfer
883aaf3bf4
Fixup grub2 bios module setup
Only copy grub2 bios modules if the architecture supports it
2017-04-05 11:21:06 +02:00
Marcus Schäfer
44ba8803c8 Merge pull request #291 from SUSE/no_grub_distributor_setup
Avoid GRUB_DISTRIBUTOR setup in etc/default/grub
2017-04-05 10:21:03 +02:00
Marcus Schäfer
58a477e461 Merge pull request #290 from SUSE/no_prefix_if_displayname_is_set
Fixup bootloader menu title setup
2017-04-05 10:20:42 +02:00
Marcus Schäfer
295a7faaf3 Avoid GRUB_DISTRIBUTOR setup in etc/default/grub
The GRUB_DISTRIBUTOR information can't be provided in a generic
way for all distributions. The information should be either placed
by a package post script (as done by most of the distributions)
or by a custom kiwi config.sh or images.sh script. Fixes #286
Fixes (bsc#1032119)
2017-04-04 16:54:49 +02:00
Marcus Schäfer
20d12a18c2 Fixup grub2 setup and tool calls
Depending on the distribution the grub tools are either named
grub2-tool or grub-tool. Additionally the grub configuration
data is expected to live in boot/grub2 or boot/grub. This commit
handles the tool calls and also the grub boot directory setup
in a generic way
2017-04-04 16:17:31 +02:00
Marcus Schäfer
d85e0899e3 Fixup bootloader menu title setup
If the menu title is setup via the displayname attribute in
the XML configuration, kiwi should not change this text by
a prefix or any other style adaptions. Fixes #287
Fixes (bsc#1032118)
2017-04-04 12:01:05 +02:00
Marcus Schäfer
afe9d42d2e
Fixup theme setup in boot
Make sure grub theme data is populated in the boot directory.
Checking only for the presence of the theme directory is not
enough. If the theme directory in boot does not contain the
requested theme it must be provided including a warning if
the theme data could not be found in the system
2017-03-28 14:23:05 +02:00
Marcus Schäfer
28e0656345
Delete no longer needed btrfs bootpath setup
The adaption of the bootpath in the grub.cfg file with regards
to the btrfs toplevel volume named '@' was the wrong solution.
The fixes in the btrfs filesystem setup and the config files
etc/default/grub and sysconfig/bootloader caused the grub
toolchain to work properly. This Fixes (bsc#1030038)
2017-03-27 10:28:12 +02:00
Marcus Schäfer
c8304d0fb6
ensure grub.cfg exists in EFI path for iso images
For live and install iso image boot configurations the
bootloader configuration must also exist in the EFI boot
path
2017-03-23 18:16:07 +01:00
Marcus Schäfer
1a5257a0e8 Prevent use of project relative import statements
For details on the motivation of this change please visit:
https://wiki.python.org/moin/FutureProofPython
2017-03-07 11:23:37 +01:00
Marcus Schäfer
ecb07e10f7 Make sure bootenv can be initialized
An existing grub bootenv file should be deleted prior to calling
grub2-install in order to allow grub2 to create a new correct
bootenv file
2017-02-24 14:50:59 +01:00
Marcus Schäfer
f37070a435
Fixup isolinux timeout configuration
isolinux counts the timeout in units of 1/10 seconds.
Thus the value provided in the image description needs
to be adapted correctly. This Fixes #228
2017-01-26 14:38:37 +01:00
Marcus Schäfer
374be7c042 Completion for grub bootloader configuration
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
2017-01-23 17:24:04 +01:00
Marcus Schäfer
88686d3253
Make sure there is a storage default setup on s390
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
2017-01-19 14:47:27 +01:00
Marcus Schäfer
35a77008af Merge pull request #206 from SUSE/grub_install_mountpoints
LVM volumes management during grub2 install
2016-12-01 09:45:50 +01:00
David Cassany
0cfcf2fb9a LVM volumes management during grub2 install
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.
2016-11-30 15:54:34 +01:00
Marcus Schäfer
4a25dd78ba
Fixup of string + operator vs. join use 2016-11-24 13:38:27 +01:00
Marcus Schäfer
996d9f4abe
Fixed setup_disk_image_config in bootloader setup
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
2016-11-24 13:29:08 +01:00
Marcus Schäfer
fa92bd3328 Merge pull request #194 from thkukuk/master
Move source of grub-snapshot.cfg to the right position
2016-11-15 15:44:44 +01:00
Thorsten Kukuk
cf11dac326 Replace tabs with spaces 2016-11-15 15:31:38 +01:00
Marcus Schäfer
810535b05c
Fixed busy mount state
Make sure subvolumes are umounted first. This prevents a
busy state in a partition setup with an extra boot
partition
2016-11-15 12:16:51 +01:00
Marcus Schäfer
893efe30ad Fixup creation of etc/default/grub config file
Only create the file if the base directory structure
in etc/default exists.
2016-11-14 14:24:39 +01:00
Thorsten Kukuk
132fd3d3dc Remove empty line too much 2016-11-13 11:15:04 +01:00
Thorsten Kukuk
119541c611 Implement loading of snapshots and fix snapshot menu layout.
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.
2016-11-13 11:08:03 +01:00
Thorsten Kukuk
9c355a796c Move source of grub-snapshot.cfg to the right position
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.
2016-11-12 18:24:38 +01:00
Marcus Schäfer
45d9a1eaa3
grub.cfg: Fixes for btrfs as rootfs
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
2016-11-09 17:15:56 +01:00
Marcus Schäfer
c90211efe7
grub.cfg: Source grub-snapshot.cfg if present
Add a lookup for /.snapshots/grub-snapshot.cfg to the generated
grub.cfg. The file is shell sourced if it exists
2016-11-09 17:13:56 +01:00
David Cassany
908716f8ec Load the default unicode font in grub2
This commit fixes #179. The default font was never loaded,
the loadfont call for the default was missing.
2016-11-04 11:02:23 +01:00
Marcus Schäfer
1f85063007 Handle target_removable in kiwi disk builder 2016-10-14 08:31:41 +02:00
Marcus Schäfer
6a611b2e91
Fixed secure boot setup for iso media
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
2016-09-30 15:00:22 +02:00
Marcus Schäfer
bb26fc71b7 Call grub2-install as chroot operation
In addition to the chrooted call make sure all volumes from
the volume manager (if used) are mounted at call time
2016-09-27 15:40:43 +02:00
Marcus Schäfer
6cabd4f030
Only sync .mod grub2 module files
When syncing the grub2 modules to the boot directory only the
.mod version of the module needs to be present
2016-09-26 17:03:22 +02:00
Marcus Schäfer
72341dbfb0
Mount boot volumes on grub install
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
2016-09-26 16:53:11 +02:00
Marcus Schäfer
0377b8fe02
Fixup theme setup in grub2 config template
Only set the theme if the .txt file describing it exists
2016-09-16 11:21:25 +02:00
Marcus Schäfer
c6e80a13c9
Make sure EFI modules are provided in uefi mode
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.
2016-09-11 22:20:17 +02:00
Marcus Schäfer
630f26e350 Preserve timestamp on grub2-install copy
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)
2016-08-16 10:58:43 +02:00
Marcus Schäfer
7e3ad64466
Fixed use of shutil.copytree
The target dir must not exist. However in order to force copy
a potentially existing target is deleted before
2016-06-29 14:50:18 +02:00
Marcus Schäfer
3e7676c85d
Added serial console support for isolinux loader
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
2016-06-24 14:30:26 +02:00
Marcus Schäfer
1a78ff2b6b
Fixed setup of default install menu entry
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
2016-06-24 11:16:39 +02:00
Marcus Schäfer
db238fe899
Fix landscape Smells 2016-06-23 17:11:46 +02:00
Marcus Schäfer
c0888eacbf
Better warning message for root cmdline setup
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
2016-06-22 15:59:03 +02:00
Marcus Schäfer
b031748cdd
Fix grub bootloader template
Keep gfxpayload
2016-06-21 14:26:42 +02:00
Marcus Schäfer
ce102396a2 Fixed grub2 bootloader config template
Load fonts only when they exist, do not duplicate font
setup in template
2016-06-21 11:18:12 +02:00
Marcus Schäfer
b84ae83d75
Fixed bootloader theme check
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
2016-06-21 10:39:19 +02:00
Marcus Schäfer
a4a9ffa9aa Added support for setting the bootloader console
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
2016-06-20 18:24:43 +02:00
Marcus Schäfer
be36f103b4
Style fixes: E275 missing whitespace after keyword 2016-06-16 10:33:54 +02:00
Marcus Schäfer
319fb9e6e4
Adapt to common python style
Private methods should start with _f() not __f()
2016-06-15 16:27:45 +02:00
Marcus Schäfer
c2ae0cdcc1
Fixed use of shutil.copytree 2016-06-10 11:03:02 +02:00
Marcus Schäfer
5e8c10471a
Update grub2 config tempplate
Load font collection
2016-06-09 17:50:07 +02:00