Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion build-apt-repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ fi

REPO_ROOT="$SCRIPT_DIR"
APT_DIR=""
GPG_KEY_ID="xcat@megware.com"
# Default to the xCAT Signing Key (same key that signs xcat-core), NOT the legacy megware key,
# so xcat-dep apt InRelease is signed by the same key as xcat-core apt. Override with --gpg-key-id.
GPG_KEY_ID="64C82A868D818E69"
SKIP_SIGN=0
DRY_RUN=0

declare -A CODENAME_MAP=(
[ubuntu20.04]=focal
[ubuntu22.04]=jammy
[ubuntu24.04]=noble
[ubuntu26.04]=resolute
Expand Down
32 changes: 27 additions & 5 deletions elilo/elilo-xcat.spec
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,32 @@ Patch1: elilo-xcat.patch
Patch2: elilo-big-bzimage-limit.patch
Patch3: elilo-gnu-efi-strncpy-conflict.patch
Source4: elilo-xcat-3.14-6.noarch.rpm
# Ship the tracked prebuilt EFI payload (SOURCE4) instead of compiling on targets where the
# gnu-efi toolchain layout does not support elilo's build: ppc64le (no x86 EFI toolchain) and
# EL8 (gnu-efi-devel places elf_x86_64_efi.lds under a path elilo's Makefile does not find).
# elilo-x64.efi is a noarch artifact, so the prebuilt is byte-identical to the compiled one.
# Use the tracked prebuilt on ppc (no x86 EFI toolchain) and on EL8 (gnu-efi lds path gap).
# Three SEPARATE %if blocks, each a single simple compare -- NOT one `A || B` expression (the
# older rpm in the EL8/EL9 mock chroot mis-evaluates `||`), and NOT %ifarch (during `rpmbuild -bs`
# the srpm's BuildRequires are frozen against %{_host_cpu}, not the target). Crucially, alma ppc
# chroots report %{_host_cpu}=powerpc64le while rocky reports ppc64le, so BOTH must be matched --
# that mismatch is exactly why elilo pulled in the (ppc-absent) gnu-efi BuildRequires on alma ppc.
%if "%{_host_cpu}" == "ppc64le"
%global use_prebuilt 1
%endif
%if "%{_host_cpu}" == "powerpc64le"
%global use_prebuilt 1
%endif
%if 0%{?rhel} == 8
%global use_prebuilt 1
%endif
%if 0%{?suse_version}
%global use_prebuilt 1
%endif
BuildRequires: gcc
BuildRequires: make
BuildRequires: cpio
%if "%{_host_cpu}" != "ppc64le"
%if ! 0%{?use_prebuilt}
BuildRequires: gnu-efi
BuildRequires: gnu-efi-devel
%endif
Expand All @@ -48,8 +70,8 @@ sed -i 's|^GNUEFILIB[[:space:]]*=.*|GNUEFILIB = /usr/lib64|' Make.defaults
sed -i 's|^EFILIB[[:space:]]*=.*|EFILIB = /usr/lib64|' Make.defaults
sed -i 's|^EFICRT0[[:space:]]*=.*|EFICRT0 = /usr/lib|' Make.defaults
%endif
%if "%{_host_cpu}" == "ppc64le"
# On ppc64le, reuse the prebuilt EFI payload from the tracked noarch package.
%if 0%{?use_prebuilt}
# Reuse the prebuilt EFI payload from the tracked noarch package (ppc64le / EL8).
mkdir -p prebuilt
rpm2cpio %{SOURCE4} | (cd prebuilt && cpio -idm --quiet)
test -f prebuilt/tftpboot/xcat/elilo-x64.efi
Expand All @@ -59,15 +81,15 @@ test -f prebuilt/tftpboot/xcat/elilo-x64.efi

rm -rf %{buildroot}

%if "%{_host_cpu}" != "ppc64le"
%if ! 0%{?use_prebuilt}
make
%endif


%install

mkdir -p %{buildroot}/tftpboot/xcat
%if "%{_host_cpu}" == "ppc64le"
%if 0%{?use_prebuilt}
cp prebuilt/tftpboot/xcat/elilo-x64.efi %{buildroot}/tftpboot/xcat/elilo-x64.efi
%else
cp elilo.efi %{buildroot}/tftpboot/xcat/elilo-x64.efi
Expand Down
Loading