Project

General

Profile

Feature #9987

Updated by Toomas Soome almost 3 years ago

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. 

 <pre> 
 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$ 
 </pre> 

 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

Back