Bug 10126

Summary: RMC: Bring supported RMC functions to grub-efi bootloader
Product: [Build System, Metadata & Runtime] BSPs Reporter: Jianxun Zhang <jianxun.zhang>
Component: bsps-meta-intelAssignee: Todor Minchev <todor.minchev>
Status: RESOLVED OBSOLETE QA Contact:
Severity: enhancement    
Priority: Medium CC: bluelightning, sgw
Version: 2.2   
Target Milestone: 2.4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Bug Depends on: 10086, 10212, 11320, 11321    
Bug Blocks: 10089    

Description Jianxun Zhang 2016-08-11 20:59:37 UTC
So far RMC only supports systemd-boot with patches to it. The functions supported now are:
- Global command line fragment (KBOOTPARAM)
- Installer to deploy any files for board in RMC DB
- Boot entries (This gummiboot-specific feature may not be compatible with grub-efi's configuration approach)

This ticket tracks the task to bring these RMC functions into grub-efi as much as we can.
Comment 1 Jianxun Zhang 2016-08-11 21:02:39 UTC
Depends on 10086 "single library, single API" since we don't want to revise necessary patches with current RMC design again.
Comment 2 Jianxun Zhang 2016-08-31 17:53:07 UTC
I pull this enhancement in with its blocker 10086 because we need consider grub when refactoring the API and library in 10086.

It seems grub-efi doesn't consume gnu-efi lib but has its own EFI code. This makes the single API in EFI context more tricky than I expected.
Comment 3 Jianxun Zhang 2016-09-02 19:48:06 UTC
Add blocker https://bugzilla.yoctoproject.org/show_bug.cgi?id=10212 for this task since we don't want to have another bbclass to use grub-efi to deploy rmc.db. We should have a better way to deploy a non-bootloader file to EFI partition for RMC and other valid use cases.
Comment 4 Jianxun Zhang 2016-11-28 22:06:32 UTC
I put this back to the new status since I actually haven't work on this in the current release plan.
Comment 5 Jianxun Zhang 2016-12-13 22:45:17 UTC
Todor,
I am not sure if we still need extra enhancements in systemd-boot like global kernel command line fragment in grub-efi, but just from the point to load a grub.cfg from rmc database, this location in grub-efi looks promising.

This is from my unfinished research, you could find a better location too...

[kern/main.c] grub_main (void)->grub_load_normal_mode ()->   grub_command_execute ("normal", 0, 0) ->... ->[normal/main.c] grub_cmd_normal(0) -> grub_enter_normal_mode (const char *config) -> grub_normal_execute (config, 0, 0) -> read_config_file (config)
Comment 6 Todor Minchev 2017-05-18 16:23:20 UTC
Won't apply to RMC2. No bootloader patching will be required.