Commit Graph

69 Commits

Author SHA1 Message Date
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
Marcus Schäfer
88d34d6284
Integrate python improvement suggestions 2016-06-09 16:34:22 +02:00
Marcus Schäfer
e699dc10ee Fixup grub2 theme setup
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
2016-06-08 20:41:10 +02:00
Marcus Schäfer
17de09d26d
Added support for grub2 console switch entry
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
2016-05-23 11:33:46 +02:00
Marcus Schäfer
400468a455 Cleanup use of temporary directories
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
2016-05-04 11:05:03 +02:00
Marcus Schäfer
cf991c1a4c
Update grub2 bootloader template menuentries
Mark all menuentries as --unrestricted. Fixes #64
2016-04-29 15:49:10 +02:00
Marcus Schäfer
894758547c
Fixed typo in message
Fix condition to show the grub module info message
2016-04-27 11:02:16 +02:00
Marcus Schäfer
2f1e892fb6 Make grub2 installation path lookup dynamic
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
2016-04-25 12:50:10 +02:00
Marcus Schäfer
4f5322f618
Fixed typo 2016-04-14 16:34:39 +02:00
Marcus Schäfer
b24f500549
Complete bootloader inline API documentation
References #49
2016-04-14 14:25:49 +02:00
Marcus Schäfer
37ad6008aa
Update bootloader/template inline API documentation
References #49
2016-04-13 11:50:14 +02:00
Marcus Schäfer
e2966efe63
Complete bootloader install interface 2016-04-13 11:42:28 +02:00
Marcus Schäfer
48695c6125
Update bootloader/install inline API documentation
References #49
2016-04-13 11:40:25 +02:00
Marcus Schäfer
6e1b7c9c88
Move get_failsafe_kernel_options to Defaults 2016-04-13 11:22:46 +02:00