2019-04-08 07:47:42 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# exit when any command fails
|
|
|
|
set -e
|
|
|
|
|
2024-12-05 10:15:28 +00:00
|
|
|
os_name=$(grep ^ID= /etc/os-release | sed -e 's/^ID=//' -e 's/rhel/redhat/' -e 's/\"//g')
|
|
|
|
|
2019-04-08 07:47:42 +00:00
|
|
|
declare -A archs
|
|
|
|
archs[ia64]="efi_alt_arch=none
|
|
|
|
efi_alt_arch_upper=NONE
|
|
|
|
efi_arch=ia64
|
|
|
|
efi_arch_upper=IA64
|
|
|
|
efi_has_alt_arch=00
|
|
|
|
efi_has_arch=01"
|
2024-12-05 10:15:28 +00:00
|
|
|
archs[x86_64]="efi_alt_arch=none
|
|
|
|
efi_alt_arch_upper=NONE
|
2019-04-08 07:47:42 +00:00
|
|
|
efi_arch=x64
|
|
|
|
efi_arch_upper=X64
|
2024-12-05 10:15:28 +00:00
|
|
|
efi_has_alt_arch=00
|
2019-04-08 07:47:42 +00:00
|
|
|
efi_has_arch=01"
|
|
|
|
archs["%{ix86}"]="efi_alt_arch=none
|
|
|
|
efi_alt_arch_upper=NONE
|
|
|
|
efi_arch=ia32
|
|
|
|
efi_arch_upper=IA32
|
|
|
|
efi_has_alt_arch=00
|
|
|
|
efi_has_arch=01"
|
|
|
|
archs[aarch64]="efi_alt_arch=none
|
|
|
|
efi_alt_arch_upper=NONE
|
|
|
|
efi_arch=aa64
|
|
|
|
efi_arch_upper=AA64
|
|
|
|
efi_has_alt_arch=00
|
|
|
|
efi_has_arch=01"
|
|
|
|
archs["%{arm}"]="efi_alt_arch=none
|
|
|
|
efi_alt_arch_upper=NONE
|
|
|
|
efi_arch=arm
|
|
|
|
efi_arch_upper=ARM
|
|
|
|
efi_has_alt_arch=00
|
|
|
|
efi_has_arch=01"
|
|
|
|
|
|
|
|
common="efi_esp_boot=/boot/efi/EFI/BOOT
|
2024-12-05 10:15:28 +00:00
|
|
|
efi_esp_dir=/boot/efi/EFI/$os_name
|
2019-04-08 07:47:42 +00:00
|
|
|
efi_esp_efi=/boot/efi/EFI
|
|
|
|
efi_esp_root=/boot/efi
|
2024-12-05 10:15:28 +00:00
|
|
|
efi_vendor=$os_name"
|
2019-04-08 07:47:42 +00:00
|
|
|
|
|
|
|
output=$(mktemp)
|
|
|
|
|
|
|
|
for arch in "${!archs[@]}"; do
|
|
|
|
echo "Testing ${arch}"
|
|
|
|
rpmbuild -bp --target ${arch}-redhat-linux test.spec \
|
|
|
|
| grep -A12 %prep > $output
|
|
|
|
|
|
|
|
for item in ${archs[$arch]}; do
|
|
|
|
grep ^$item $output
|
|
|
|
done
|
|
|
|
for item in ${common}; do
|
|
|
|
grep ^$item $output
|
|
|
|
done
|
|
|
|
echo ""
|
|
|
|
done
|