This repository has been archived by the owner on Sep 18, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 150
build_library: support uefi boot from iso #551
Open
mischief
wants to merge
1
commit into
coreos:master
Choose a base branch
from
mischief:iso-uefi
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,14 +54,14 @@ case "${FLAGS_target}" in | |
CORE_NAME="core.img" | ||
;; | ||
x86_64-efi) | ||
CORE_MODULES+=( serial linuxefi efi_gop getenv smbios efinet verify http ) | ||
CORE_MODULES+=( serial linuxefi efi_gop getenv smbios efinet verify http iso9660 ) | ||
CORE_NAME="core.efi" | ||
;; | ||
x86_64-xen) | ||
CORE_NAME="core.elf" | ||
;; | ||
arm64-efi) | ||
CORE_MODULES+=( serial efi_gop getenv smbios efinet verify http ) | ||
CORE_MODULES+=( serial linux efi_gop getenv smbios efinet verify http iso9660 ) | ||
CORE_NAME="core.efi" | ||
BOARD_GRUB=1 | ||
;; | ||
|
@@ -134,19 +134,16 @@ for file in "${GRUB_SRC}"/*{.lst,.mod}; do | |
done | ||
|
||
info "Generating ${GRUB_DIR}/load.cfg" | ||
# Include a small initial config in the core image to search for the ESP | ||
# by filesystem ID in case the platform doesn't provide the boot disk. | ||
# The existing $root value is given as a hint so it is searched first. | ||
ESP_FSID=$(sudo grub-probe -t fs_uuid -d "${LOOP_DEV}p1") | ||
# Include a small initial config to set prefix and dump variables. | ||
sudo_clobber "${ESP_DIR}/${GRUB_DIR}/load.cfg" <<EOF | ||
search.fs_uuid ${ESP_FSID} root \$root | ||
set prefix=(memdisk) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In other cleanup news, prefix is already set to memdisk at this point (implied by calling mkimage with the memdisk option) so this line isn't really needed any more. |
||
set | ||
EOF | ||
|
||
# Generate a memdisk containing the appropriately generated grub.cfg. Doing | ||
# this because we need conflicting default behaviors between verity and | ||
# non-verity images. | ||
ESP_FSID=$(sudo grub-probe -t fs_uuid -d "${LOOP_DEV}p1") | ||
GRUB_TEMP_DIR=$(mktemp -d) | ||
if [[ ! -f "${ESP_DIR}/coreos/grub/grub.cfg.tar" ]]; then | ||
info "Generating grub.cfg memdisk" | ||
|
@@ -162,6 +159,9 @@ if [[ ! -f "${ESP_DIR}/coreos/grub/grub.cfg.tar" ]]; then | |
sed 's/@@MOUNTUSR@@/mount.usr/' > "${GRUB_TEMP_DIR}/grub.cfg" | ||
fi | ||
|
||
# fix up ESP UUID for PC boot. EFI boot will be able to provide the disk to grub. | ||
sed --in-place --expression "s/@@ESP_FSID@@/${ESP_FSID}/" "${GRUB_TEMP_DIR}/grub.cfg" | ||
|
||
sudo tar cf "${ESP_DIR}/coreos/grub/grub.cfg.tar" \ | ||
-C "${GRUB_TEMP_DIR}" "grub.cfg" | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this form of and actually work in grub? I know in the past we've switched to a nested if because and didn't work but that was probably using a different syntax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you confirm that this syntax is properly supported by grub?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-a
is already used other places in this config, like line 77 belowThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, that must work then. Must have been && that isn't valid.