loader.efi: add version support
Prepare to drop boot1.
When we activate boot environment (beadm activate, or pkg update) or install boot loader files manually with bootadm install-bootloader or directly with installboot, the installboot command does test the currently installed boot program and new ones by comparing the embedded version. This is needed to avoid downgrading the boot programs. Even as we currently do not support automatic boot program update for UEFI, the boot1.efi is built with embedded versioning and to be able to repace boot1 with loader, we also need loader.efi to be built with embedded versioning.
Add rules to create attached version for loader.efi. There is a catch however - with PEI file, we can not really control the location for .text segment and in loader.efi case, it is just outside the "normal" multiboot header search. So we also need to extend the search area - 64KB seems to be sufficient.
tsoome@beastie:/code/illumos-gate/usr/src/boot$ installboot -i /boot/loader64.efi Extended version string: 1.1-2018.11.05.2 MD5 hash: db2e366ebbc3493a37f939d1dcd869ac tsoome@beastie:/code/illumos-gate/usr/src/boot$ installboot -i /boot/loader32.efi Extended version string: 1.1-2018.11.05.2 MD5 hash: 7e3e70adbc442668a4db40f360205c86 tsoome@beastie:/code/illumos-gate/usr/src/boot$
From Andrew’s comment about in place updates, we had to implement https://www.illumos.org/rb/r/1297/ first, after that we do have functional btxld -o outfile for versioning (-o was previously only working for linking BTX engine). So we got more reasonable build chain:
1. create loader.sym as normal ELF shared object,
2. then use objcopy to create EFI APP loader.bin,
3. then attach version with btxld and get loader.efi
Updated by Electric Monk over 1 year ago
- Status changed from In Progress to Closed
- % Done changed from 90 to 100
commit 7d1eae8c55720848a7a807e8b76f4b8c7e339af3 Author: Toomas Soome <firstname.lastname@example.org> Date: 2018-12-03T18:41:41.000Z 9987 loader.efi: add version support Reviewed by: Igor Kozhukhov <email@example.com> Reviewed by: Robert Mustacchi <firstname.lastname@example.org> Reviewed by: Andy Stormont <email@example.com> Approved by: Dan McDonald <firstname.lastname@example.org>