shim, coreos-sb-keys, grub_install.sh: retab to spaces

Signed-off-by: Sayan Chowdhury <schowdhury@microsoft.com>
This commit is contained in:
Sayan Chowdhury 2024-01-19 17:36:35 +05:30 committed by Kai Lueke
parent 4648be9dbb
commit 99bfcf5f32
3 changed files with 42 additions and 42 deletions

View File

@ -60,7 +60,7 @@ case "${FLAGS_target}" in
CORE_NAME="core.img" CORE_NAME="core.img"
;; ;;
x86_64-efi) x86_64-efi)
CORE_MODULES+=( serial linux efi_gop efinet pgp http tftp ) CORE_MODULES+=( serial linux efi_gop efinet pgp http tftp )
CORE_NAME="core.efi" CORE_NAME="core.efi"
SBAT_ARG=( --sbat "${BOARD_ROOT}/usr/share/grub/sbat.csv" ) SBAT_ARG=( --sbat "${BOARD_ROOT}/usr/share/grub/sbat.csv" )
;; ;;
@ -168,7 +168,7 @@ if [[ ! -f "${ESP_DIR}/flatcar/grub/grub.cfg.tar" ]]; then
fi fi
sudo tar cf "${ESP_DIR}/flatcar/grub/grub.cfg.tar" \ sudo tar cf "${ESP_DIR}/flatcar/grub/grub.cfg.tar" \
-C "${GRUB_TEMP_DIR}" "grub.cfg" -C "${GRUB_TEMP_DIR}" "grub.cfg"
fi fi
info "Generating ${GRUB_DIR}/${CORE_NAME}" info "Generating ${GRUB_DIR}/${CORE_NAME}"
@ -197,8 +197,8 @@ case "${FLAGS_target}" in
x86_64-efi) x86_64-efi)
info "Installing default x86_64 UEFI bootloader." info "Installing default x86_64 UEFI bootloader."
sudo mkdir -p "${ESP_DIR}/EFI/boot" sudo mkdir -p "${ESP_DIR}/EFI/boot"
# Use the test keys for signing unofficial builds # Use the test keys for signing unofficial builds
if [[ ${COREOS_OFFICIAL:-0} -ne 1 ]]; then if [[ ${COREOS_OFFICIAL:-0} -ne 1 ]]; then
# Sign the GRUB with the shim-embedded key # Sign the GRUB with the shim-embedded key
sudo sbsign --key /usr/share/sb_keys/shim.key \ sudo sbsign --key /usr/share/sb_keys/shim.key \
--cert /usr/share/sb_keys/shim.pem \ --cert /usr/share/sb_keys/shim.pem \
@ -221,7 +221,7 @@ case "${FLAGS_target}" in
"${ESP_DIR}/EFI/boot/grub.efi" "${ESP_DIR}/EFI/boot/grub.efi"
sudo cp "/usr/lib/shim/shim.efi" \ sudo cp "/usr/lib/shim/shim.efi" \
"${ESP_DIR}/EFI/boot/bootx64.efi" "${ESP_DIR}/EFI/boot/bootx64.efi"
fi fi
# copying from vfat so ignore permissions # copying from vfat so ignore permissions
if [[ -n "${FLAGS_copy_efi_grub}" ]]; then if [[ -n "${FLAGS_copy_efi_grub}" ]]; then
cp --no-preserve=mode "${ESP_DIR}/EFI/boot/grubx64.efi" \ cp --no-preserve=mode "${ESP_DIR}/EFI/boot/grubx64.efi" \

View File

@ -15,16 +15,16 @@ IUSE=""
S="${WORKDIR}" S="${WORKDIR}"
src_install() { src_install() {
insinto /usr/share/sb_keys insinto /usr/share/sb_keys
newins "${FILESDIR}/PK.key" PK.key newins "${FILESDIR}/PK.key" PK.key
newins "${FILESDIR}/PK.crt" PK.crt newins "${FILESDIR}/PK.crt" PK.crt
newins "${FILESDIR}/KEK.key" KEK.key newins "${FILESDIR}/KEK.key" KEK.key
newins "${FILESDIR}/KEK.crt" KEK.crt newins "${FILESDIR}/KEK.crt" KEK.crt
newins "${FILESDIR}/DB.key" DB.key newins "${FILESDIR}/DB.key" DB.key
newins "${FILESDIR}/DB.crt" DB.crt newins "${FILESDIR}/DB.crt" DB.crt
# shim keys # shim keys
newins "${FILESDIR}/shim.key" shim.key newins "${FILESDIR}/shim.key" shim.key
newins "${FILESDIR}/shim.der" shim.der newins "${FILESDIR}/shim.der" shim.der
newins "${FILESDIR}/shim.pem" shim.pem newins "${FILESDIR}/shim.pem" shim.pem
} }

View File

@ -19,37 +19,37 @@ RDEPEND=""
# to be addressed by patching this check out after making sure that # to be addressed by patching this check out after making sure that
# our copy of gnu-efi is as usable as the bundled one. # our copy of gnu-efi is as usable as the bundled one.
DEPEND=" DEPEND="
dev-libs/openssl dev-libs/openssl
coreos-base/coreos-sb-keys coreos-base/coreos-sb-keys
" "
src_compile() { src_compile() {
local emake_args=( local emake_args=(
CROSS_COMPILE="${CHOST}-" CROSS_COMPILE="${CHOST}-"
) )
# Apparently our environment already has the ARCH variable in # Apparently our environment already has the ARCH variable in
# it, and Makefile picks it up instead of figuring it out # it, and Makefile picks it up instead of figuring it out
# itself with the compiler -dumpmachine flag. But also it # itself with the compiler -dumpmachine flag. But also it
# expects a different format of the values. It wants x86_64 # expects a different format of the values. It wants x86_64
# instead of amd64, and aarch64 instead of arm64. # instead of amd64, and aarch64 instead of arm64.
if use amd64; then if use amd64; then
emake_args+=( ARCH=x86_64 ) emake_args+=( ARCH=x86_64 )
elif use arm64; then elif use arm64; then
emake_args+=( ARCH=aarch64 ) emake_args+=( ARCH=aarch64 )
fi fi
emake_args+=( ENABLE_SBSIGN=1 ) emake_args+=( ENABLE_SBSIGN=1 )
emake_args+=( VENDOR_CERT_FILE="/usr/share/sb_keys/shim.der" ) emake_args+=( VENDOR_CERT_FILE="/usr/share/sb_keys/shim.der" )
emake "${emake_args[@]}" || die emake "${emake_args[@]}" || die
} }
src_install() { src_install() {
local suffix local suffix
suffix='' suffix=''
if use amd64; then if use amd64; then
suffix=x64 suffix=x64
elif use arm64; then elif use arm64; then
suffix=aa64 suffix=aa64
fi fi
insinto /usr/lib/shim insinto /usr/lib/shim
newins "shim${suffix}.efi" 'shim.efi' newins "shim${suffix}.efi" 'shim.efi'
newins "mm${suffix}.efi" "mm${suffix}.efi" newins "mm${suffix}.efi" "mm${suffix}.efi"
} }