10 Commits

Author SHA1 Message Date
Dmitry Tantsur
f09f6c9f1a Do not try to guess EFI partition path by its number
The logic of adding a partition number to the device path does not work
for devicemapper devices (e.g. a multipath storage device).

Change-Id: I9a445e847d282c50adfa4bad5e7136776861005d
2022-05-04 15:06:02 +02:00
Zuul
a247fbcc8c Merge "Refactor efi_utils for easier maintaining and debugging" 2022-03-18 20:55:57 +00:00
Riccardo Pittau
697fa6f3b6 Use utf-16-le if BOM not present
In case no BOM is present in the CSV file the utf-16 codec won't work.
We fail over to utf-16-le as Little Endian is commonly used.

Change-Id: I3e25ce4997f5dd3df87caba753daced65838f85a
2022-02-22 15:53:54 +01:00
Dmitry Tantsur
3d3df17e5a Refactor efi_utils for easier maintaining and debugging
* Move irrelevant code from inside the giant try..except block
* Do not bother removing the (empty) temporary mountpoint
* Fix log messages according to the actual code
* Fix some code duplication
* Add missing unit tests for failure case

Change-Id: Id7b557419d513375816d73901e2ab6f139d765ad
2022-02-14 12:46:25 +01:00
Arne Wiebalck
a83f38479e Move prepare_boot_partitions_for_softraid to raid_utils
prepare_boot_partitions_for_softraid() is used in BIOS and UEFI
modes to prepare the partitions for the bootloader. Move it from
the image extensions to raid_utils to reflect this and avoid the
import of an extension to efi_utils.

Follow-up to 62c5674a600baeeef0af3b12baeab486870eb103.

Change-Id: I9f5974fbbfea5e8cdfbb7e49bea375e5cbfdd145
2022-02-14 11:21:36 +01:00
Arne Wiebalck
62c5674a60 SoftwareRAID: Use efibootmgr (and drop grub2-install)
Move the software RAID code path from grub2-install to
efibootmgr:

- remove the UEFI efibootmgr exception for software RAID
- create and populate the ESPs on the holder disks
- update the NVRAM with all ESPs (the component devices
  of the ESP mirror, use unique labels to avoid unintentional
  deduplication of entries in the NVRAM)

Story: #2009794

Change-Id: I7ed34e595215194a589c2f1cd0b39ff0336da8f1
2022-01-26 14:43:40 +01:00
Dmitry Tantsur
5cf61e797a Trivial: split away efibootmgr helpers
These are very useful for downstream deploy steps, make them public.

Change-Id: I26106a07049f751d3e3cc646431e2176001f4645
2021-11-19 17:27:27 +01:00
Dmitry Tantsur
abe38a6a5f Fix compatibility with disk_utils.find_efi_partition
This function returns the complete block device record, not just number.
Fixes regression in 89bc73aa0105850c6ae44428642e31802bba3b20.

Also fix the incorrect job in the gate queue, which prevented us from
catching this issue on merging.

Change-Id: I4cbc359ceabfc193ce18fed14a1952359460e7d9
2021-11-19 14:51:27 +01:00
Dmitry Tantsur
89bc73aa01 Use two more functions from disk_utils
Change-Id: If01c9cd7f95b4495509369786360741b731161db
2021-11-18 13:49:51 +01:00
Dmitry Tantsur
36d4a18fbc Move manage_uefi from the image extension to a public location
This call is very useful for custom deploy implementations, such as one
we maintain for OpenShift. Splitting it out also makes image.py slightly
more manageable.

The get_partition call is moved to partition_utils.

Change-Id: I60a6a2823d3eb27a4ae78e913e3655dae7b54ffe
2021-11-16 17:58:16 +01:00