-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
create_disk: fix UEFI secure boot #1105
Merged
Merged
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -307,23 +307,37 @@ install_uefi() { | |
# change our build process to download+extract it separately. | ||
local source_efidir="${deploy_root}/usr/lib/ostree-boot/efi" | ||
local target_efi="$rootfs/boot/efi" | ||
local target_efiboot="${target_efi}/EFI/BOOT" | ||
mkdir -p "${target_efiboot}" | ||
/usr/lib/coreos-assembler/cp-reflink "${source_efidir}/EFI/BOOT/BOOT"* "${target_efiboot}" | ||
local src_grubefi=$(find "${source_efidir}"/EFI/ -name 'grub*.efi') | ||
/usr/lib/coreos-assembler/cp-reflink "${src_grubefi}" "${target_efiboot}" | ||
local src_grubefi=$(find "${source_efidir}"/EFI/ -maxdepth 1 -type d | grep -v BOOT) | ||
local vendor_id="${src_grubefi##*/}" | ||
local vendordir="${target_efi}/EFI/${vendor_id}" | ||
|
||
# Some of the files in EFI/BOOT are _symlinks_ to EFI/$VENDOR | ||
# in the OS tree. We need to make copies here. | ||
mkdir -p "${target_efi}"/EFI/BOOT "${vendordir}" | ||
for t in BOOT "${vendor_id}"; | ||
do | ||
( | ||
cd "${source_efidir}"/EFI/${t} | ||
for i in *; do | ||
/usr/lib/coreos-assembler/cp-reflink -vRL \ | ||
$(readlink -f $i) \ | ||
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. Having both |
||
"${target_efi}"/EFI/"${t}"/ | ||
done | ||
) | ||
done | ||
|
||
local vendor_id="$(basename $(dirname ${src_grubefi}))" | ||
local vendordir="${target_efi}/EFI/${vendor_id}" | ||
mkdir -p "${vendordir}" | ||
cat > ${vendordir}/grub.cfg << 'EOF' | ||
search --label boot --set prefix | ||
set prefix=($prefix)/grub2 | ||
normal | ||
set prefix=($prefix) | ||
configfile $prefix/grub2/grub.cfg | ||
boot | ||
EOF | ||
mkdir -p $rootfs/boot/grub2 | ||
|
||
# copy the grub config and any other files we might need | ||
cp $grub_script $rootfs/boot/grub2/grub.cfg | ||
mkdir -p $rootfs/boot/grub2 | ||
cp -v $grub_script $rootfs/boot/grub2/grub.cfg | ||
} | ||
|
||
# Other arch-specific bootloader changes | ||
|
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.
Seems like it's just
grubenv
that's a symlink; may be easier to special case that?Also worth commenting here probably are
coreos/rpm-ostree#969
and
ostreedev/ostree#1873
which may be related to some of this being awkward.
In fact we should probably change coreos-assembler (and/or rpm-ostree) to download the grub/efi bits separately and not commit them to the ostree as discussed. But, definitely that can come later.