Commit Graph

49 Commits

Author SHA1 Message Date
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
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
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
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
6cc0b2085d Flake cleanup for unit tests 2017-03-07 13:03:10 +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
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
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
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
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
0c8cbf6c1c Fixup grub default module list
The test module is a required module in any case
2016-09-27 15:40:39 +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
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
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
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
c2ae0cdcc1
Fixed use of shutil.copytree 2016-06-10 11:03:02 +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
Bo Maryniuk
06b95b727d Replace 'builtins.open' with patch_open decorator 2016-06-07 17:54:24 +02:00
Marcus Schäfer
33468110b1
Add part_msdos module for self build EFI image 2016-04-18 09:36:44 +02:00
Marcus Schäfer
c46f692397 Revert "Delete efi_uga module from list"
This reverts commit 191d423eb5.
2016-03-23 17:37:57 +01:00
Marcus Schäfer
191d423eb5 Delete efi_uga module from list 2016-03-23 17:04:29 +01:00
Marcus Schäfer
7ce8a3d8f5
add multiboot grub module only on demand
multiboot is only needed for self build grub images in Xen
guest mode
2016-03-23 16:52:34 +01:00
Marcus Schäfer
3b5c937cd3 Fixed architecture dependant tests 2016-03-23 09:23:56 +01:00
Marcus Schäfer
f97dbf6fda
Refactor grub2 EFI support
EFI support was target specific to the x86_64 architecture
This commit changes the structure to allow more architectures
supporting EFI. Thus the arm64 EFI support has been added
as a plus
2016-03-16 12:57:25 +01:00
Marcus Schäfer
e6cc5bfa09 Move from nose to pytest
nose is no longer maintained, thus we have to move to another
testing system. This commit updates the tox setup and all tests
to use pytest instead of nose.
2016-03-14 12:23:14 +01:00
Marcus Schäfer
8fb633257b
Delete obsolete shim setup code from kiwi
Due to the use of shim-install the code in kiwi to setup
for secure boot is no longer needed
2016-03-09 18:33:16 +01:00
Dinar Valeev
24c27b8a97 Add support for POWER architecture
Implements requirements for the partition and bootloader setup
in order to build images for ppc64 architectures. Fixes #18
2016-03-08 11:54:09 +01:00
Marcus Schäfer
80bb7c5e78 Consolidate all rsync calls into DataSync class 2016-03-07 12:11:15 +01:00
Thomas Schraitle
45bc5a03a7 Refactor into subpackage to fix #23
Codecoverage are 100% and tests are green

Changes:
* Refactor archive_*.py -> archive subpackage
* Refactor partitioner_*.py -> partitioner subpackage
* Refactor package_manager_*.py -> package_manager/ subpackage
* Refactor bootloader_config*.py -> bootloader/config/ subpackage
* Refactor bootloader_template*.py -> bootloader/template/ subpackage
* Refactor bootloader_install*.py -> bootloader/install/ subpackage
* Refactor repository*.py -> repository/ subpackage
* Refactor filesystem*.py -> filesystem/ subpackage
* Refactor dist_*.py -> dist/dformat subpackage
  The name `dformat` as package name is needed to avoid any name
  conflicts with the built-in function `format`.
* Refactor volume_manager*.py -> volume_manager/ subpackage
* Refactor boot_image*.py -> boot/image/ subpackage
2016-02-27 10:31:31 +01:00
Marcus Schäfer
31bffb7b3d
Don't write grub.cfg to EFI directory
Originally the file was written there as reference, but nothing
will ever update that file if the real grub configuration changes.
Thus it doesn't make sense to provide this information (bnc#968270)
2016-02-26 09:31:26 +01:00
Marcus Schäfer
147c0706eb
Refactor grub2 bootloader installation
Make use of grub2-install to install the bootloader
2016-02-25 17:18:31 +01:00
Marcus Schäfer
40e6308aa9 Port application from python 2.7 to 3.4
For new applications like this kiwi version and its use cases
it is better to base it on a more recent python version
2016-02-17 22:38:38 +01:00
Marcus Schäfer
4d1fcbad37
Allow building 32bit bios images 2016-02-15 12:46:07 +01:00
Marcus Schäfer
ff09a80349
Allow alternative locations for grub installation
Different distributions install grub2 to different places.
Therefore kiwi should not use a fixed location but allow
to lookup grub data at several places
2016-02-09 15:28:06 +01:00
Marcus Schäfer
79be39945b
Fixed grub2 xen guest bootloader config 2016-01-26 09:33:41 +01:00
Marcus Schäfer
e8f0a651bf
More modules not present for grub2/x86_64-xen 2016-01-25 22:05:07 +01:00
Marcus Schäfer
6358ff6806
There is no multiboot module for grub2/x86_64-xen 2016-01-25 21:57:08 +01:00
Marcus Schäfer
bfe75b869f
Platform mock for grub2 bootloader tests 2016-01-25 09:12:24 +01:00
Marcus Schäfer
d4da290701
Platform mock for grub2 bootloader tests 2016-01-25 09:09:09 +01:00
Marcus Schäfer
2bdf0ad686
Delete unused patch statement from test 2016-01-22 10:49:14 +01:00
Marcus Schäfer
9524e79d52 Allow custom options for bootloader config classes 2016-01-21 15:39:22 +01:00
Marcus Schäfer
febd69ec0f Refactor variable name for root directory
If it is clear the source directory is the root directory of
the image the variable should be named root_dir not source_dir
2016-01-19 11:15:18 +01:00
Marcus Schäfer
3710354997
Added live ISO grub2 efi template and setup 2016-01-13 12:04:09 +01:00
Marcus Schäfer
61ea327a4c
Added isolinux bootloader support 2015-12-09 10:39:21 +01:00
Marcus Schäfer
09daca60c0
KIWI - appliance builder next generation
a rewrite of the current kiwi from https://github.com/openSUSE/kiwi
2015-12-05 16:17:10 +01:00