Project

General

Profile

Feature #9987

loader.efi: add version support

Added by Toomas Soome about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
bootloader
Start date:
2018-11-18
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

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


Related issues

Related to illumos gate - Feature #9989: Make loader.efi dual boot, step 2: remove boot1Closed2018-11-18

Actions

History

#1

Updated by Toomas Soome about 1 year ago

  • Description updated (diff)
#2

Updated by Toomas Soome about 1 year ago

  • Description updated (diff)
#3

Updated by Electric Monk about 1 year ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit 7d1eae8c55720848a7a807e8b76f4b8c7e339af3

commit  7d1eae8c55720848a7a807e8b76f4b8c7e339af3
Author: Toomas Soome <tsoome@me.com>
Date:   2018-12-03T18:41:41.000Z

    9987 loader.efi: add version support
    Reviewed by: Igor Kozhukhov <igor@dilos.org>
    Reviewed by: Robert Mustacchi <rm@joyent.com>
    Reviewed by: Andy Stormont <astormont@racktopsystems.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

#4

Updated by Joshua M. Clulow about 1 year ago

  • Related to Feature #9989: Make loader.efi dual boot, step 2: remove boot1 added

Also available in: Atom PDF